Commit 72268e15 by Kyle Galloway Committed by Kyle Galloway

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
parent 9f05adb0
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> 2007-02-07 Keith Seitz <keiths@redhat.com>
* include/java-interp.h (_Jv_Frame::depth): * include/java-interp.h (_Jv_Frame::depth):
......
...@@ -387,6 +387,9 @@ public: ...@@ -387,6 +387,9 @@ public:
_Jv_word *locals; _Jv_word *locals;
char *locals_type; char *locals_type;
// Object pointer for this frame ("this")
jobject obj_ptr;
_Jv_InterpFrame (void *meth, java::lang::Thread *thr, jclass proxyCls = NULL) _Jv_InterpFrame (void *meth, java::lang::Thread *thr, jclass proxyCls = NULL)
: _Jv_Frame (reinterpret_cast<_Jv_MethodBase *> (meth), thr, : _Jv_Frame (reinterpret_cast<_Jv_MethodBase *> (meth), thr,
frame_interpreter) frame_interpreter)
...@@ -394,12 +397,18 @@ public: ...@@ -394,12 +397,18 @@ public:
next_interp = (_Jv_InterpFrame *) thr->interp_frame; next_interp = (_Jv_InterpFrame *) thr->interp_frame;
proxyClass = proxyCls; proxyClass = proxyCls;
thr->interp_frame = (gnu::gcj::RawData *) this; thr->interp_frame = (gnu::gcj::RawData *) this;
obj_ptr = NULL;
} }
~_Jv_InterpFrame () ~_Jv_InterpFrame ()
{ {
thread->interp_frame = (gnu::gcj::RawData *) next_interp; 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 // A native frame in the call stack really just a placeholder
......
...@@ -349,6 +349,15 @@ details. */ ...@@ -349,6 +349,15 @@ details. */
*/ */
memcpy ((void*) locals, (void*) args, meth->args_raw_size); 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; _Jv_word *pool_data = meth->defining_class->constants.data;
/* These three are temporaries for common code used by several /* These three are temporaries for common code used by several
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment