This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GIJ _Jv_InterpMethod::run question


Kyle Galloway wrote:
Thanks for the info. From what I can see, however, this is the variable for the Class object as in SomeClass.class. What I am looking for is the Object variable, an actual reference to the instance of the class that invoked the method. So for example:

SomeClass a = new SomeClass();
a.someMethod();

I am looking for the instance a, not the class SomeClass.

The first argument to a non-static method is "this", ie the object it is being invoked on. In the interpreter, the arguments are passed to _Jv_InterpMethod::run in "args". So, to see the current "this" inside a call to a.someMethod(), you can look at:


args[0].ptr

Bryce


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]