Why does "jobject" on interpreter stack point to wield locations?

Colin(Du Li) dawn2004 at gmail.com
Mon Apr 13 21:21:49 PDT 2009

I'm playing with stack of c++ interpreter. I have some questions about the
object reference on the stack.
Let's look at the following example:
When interpreter invoke("invokespecial") method  "virtual jobject
java.lang.ClassLoader.loadClass(jobject)", I print out stack frame (last
frame), and the result is as follows:

 - local  [0x7e747b90] ; #0
 - local  [0x7e7489d0] ; #1
 - stack  [0x7e7489d0] ; #1
 - stack  [0x7e747b90] ; #0
 [ - obj 
a 'sun/misc/Launcher$AppClassLoader'
 - lock 
 - monitor[0xbff3f8c8]
 - bcp    [0xb3f3fa4e] ; @2
 - locals [0xbff3f944]
 - method [0xb3f3fa78] ; virtual jobject

According to the jvm specification, stack slot #0 should contain the
"receiver", and stack slot to the parameter of method "loadclass(jobject)".
I use JNIHandles::resolve(obj) to resolve the two jobjects on the above
stack slot. The result of slot #0 is a reference pointing to another slot of
the current stack. The result of slot #1 is a invalid address, "0x1".
The results confuse me. I assumed both of them pointed to some object is
Could you give me some explanation for this question? 
I really need your help.
Thanks a lot!

View this message in context: http://www.nabble.com/Why-does-%22jobject%22-on-interpreter-stack-point-to-wield-locations--tp23033048p23033048.html
Sent from the OpenJDK Hotspot Virtual Machine mailing list archive at Nabble.com.

More information about the hotspot-dev mailing list