aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Galloway <kgallowa@redhat.com>2007-02-08 18:01:56 +0000
committerKyle Galloway <kgallowa@gcc.gnu.org>2007-02-08 18:01:56 +0000
commit72268e157f2de24a087700a5910db88857c5a236 (patch)
tree62949050654147577945d70db07dfdbfacbe1feb
parent9f05adb09fd35252136f4d28182e5d60cc03fb36 (diff)
downloadgcc-72268e157f2de24a087700a5910db88857c5a236.zip
gcc-72268e157f2de24a087700a5910db88857c5a236.tar.gz
gcc-72268e157f2de24a087700a5910db88857c5a236.tar.bz2
java-interp.h (_Jv_InterpFrame): obj_ptr field added to hold "this" pointer for frame.
2007-02-06 Kyle Galloway <kgallowa@redhat.com> * include/java-interp.h (_Jv_InterpFrame): obj_ptr field added to hold "this" pointer for frame. (_Jv_InterpFrame::get_this_ptr): New method. * interpret-run.cc: Copy the "this" pointer into obj_ptr. From-SVN: r121717
-rw-r--r--libjava/ChangeLog7
-rw-r--r--libjava/include/java-interp.h9
-rw-r--r--libjava/interpret-run.cc9
3 files changed, 25 insertions, 0 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index d99393b..e3fc132 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,10 @@
+2007-02-07 Kyle Galloway <kgallowa@redhat.com>
+
+ * include/java-interp.h (_Jv_InterpFrame): obj_ptr field added
+ to hold "this" pointer for frame.
+ (_Jv_InterpFrame::get_this_ptr): New method.
+ * interpret-run.cc: Copy the "this" pointer into obj_ptr.
+
2007-02-07 Keith Seitz <keiths@redhat.com>
* include/java-interp.h (_Jv_Frame::depth):
diff --git a/libjava/include/java-interp.h b/libjava/include/java-interp.h
index ce2fac2..2b3ae7c 100644
--- a/libjava/include/java-interp.h
+++ b/libjava/include/java-interp.h
@@ -387,6 +387,9 @@ public:
_Jv_word *locals;
char *locals_type;
+ // Object pointer for this frame ("this")
+ jobject obj_ptr;
+
_Jv_InterpFrame (void *meth, java::lang::Thread *thr, jclass proxyCls = NULL)
: _Jv_Frame (reinterpret_cast<_Jv_MethodBase *> (meth), thr,
frame_interpreter)
@@ -394,12 +397,18 @@ public:
next_interp = (_Jv_InterpFrame *) thr->interp_frame;
proxyClass = proxyCls;
thr->interp_frame = (gnu::gcj::RawData *) this;
+ obj_ptr = NULL;
}
~_Jv_InterpFrame ()
{
thread->interp_frame = (gnu::gcj::RawData *) next_interp;
}
+
+ jobject get_this_ptr ()
+ {
+ return obj_ptr;
+ }
};
// A native frame in the call stack really just a placeholder
diff --git a/libjava/interpret-run.cc b/libjava/interpret-run.cc
index 12d0b9a..8a4d204 100644
--- a/libjava/interpret-run.cc
+++ b/libjava/interpret-run.cc
@@ -349,6 +349,15 @@ details. */
*/
memcpy ((void*) locals, (void*) args, meth->args_raw_size);
+#ifdef DEBUG
+ // Get the object pointer for this method, after checking that it is
+ // non-static.
+ _Jv_Method *method = meth->get_method ();
+
+ if ((method->accflags & java::lang::reflect::Modifier::STATIC) == 0)
+ frame_desc.obj_ptr = locals[0].o;
+#endif
+
_Jv_word *pool_data = meth->defining_class->constants.data;
/* These three are temporaries for common code used by several