Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JVM stack frames question

843811Apr 15 2004 — edited Apr 16 2004
Does anyone know if it is possible to access local variables on stack frame of a method which called the current one? I am writing compiler which generates code for JVM and want to handle nested functions (like in Pascal). Nested functions should have access to local variables and parameters of calling "parent" function.
I want to enable recursive functions, so the jsr/ret mechanism is not sufficient.
One solution which I considered was passing values of local variables when calling function and retrieving changed values after the function returns but it is a significant performance loss. Any hints how it could be done in a more straightforward way (and not using JNI, only portable JVM instructions)?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 14 2004
Added on Apr 15 2004
3 comments
257 views