Change GetLocalObject(..., 0, ...) to GetLocalInstance(). am: b107101a86
am: 5f2d7f37c8
Change-Id: I9774d8a3058fb8c043d59dba9133829648d56f98
diff --git a/src/share/back/StackFrameImpl.c b/src/share/back/StackFrameImpl.c
index cf80dba..5736bba 100644
--- a/src/share/back/StackFrameImpl.c
+++ b/src/share/back/StackFrameImpl.c
@@ -394,8 +394,10 @@
(void)outStream_writeByte(out, specificTypeKey(env, this_object));
(void)outStream_writeObjectRef(env, out, this_object);
} else {
- error = JVMTI_FUNC_PTR(gdata->jvmti,GetLocalObject)
- (gdata->jvmti, thread, fnum, 0, &this_object);
+ // ANDROID-CHANGED: On ART 'this' is not always in register 0. We just use
+ // GetLocalInstance in all cases.
+ error = JVMTI_FUNC_PTR(gdata->jvmti,GetLocalInstance)
+ (gdata->jvmti, thread, fnum, &this_object);
if (error == JVMTI_ERROR_NONE) {
(void)outStream_writeByte(out, specificTypeKey(env, this_object));
(void)outStream_writeObjectRef(env, out, this_object);
diff --git a/src/share/back/threadControl.c b/src/share/back/threadControl.c
index 78ca297..3d98cf0 100644
--- a/src/share/back/threadControl.c
+++ b/src/share/back/threadControl.c
@@ -593,8 +593,10 @@
jobject object;
FrameNumber fnum = 0;
- error = JVMTI_FUNC_PTR(gdata->jvmti,GetLocalObject)
- (gdata->jvmti, resumingThread, fnum, 0, &object);
+ // ANDROID-CHANGED: On ART 'this' is not always in register 0. We just use GetLocalInstance in
+ // all cases.
+ error = JVMTI_FUNC_PTR(gdata->jvmti,GetLocalInstance)
+ (gdata->jvmti, resumingThread, fnum, &object);
if (error == JVMTI_ERROR_NONE) {
resumee = object;
}