Contents of Stack Frame in Java

血红的双手。 提交于 2019-12-10 09:29:07

问题


It is evident from Java Virtual Machine Implementation (http://docs.oracle.com/javase/specs/jvms/se7/html/index.html) that stack frame present on heap which stores the method's runtime data. But what are the contents of stack frame in java and how the stack frame is organized to store values of local variables and intermediate results. How is the data structure organized.


回答1:


First of all, stack frame is part of JVM stack, not Heap [JVM memory is divided in 5 parts: Method Area, Heap, Stack, PC Register and Native Memory.]

To answer your question, stack frame is divided into three parts: local variable array, frame data and operand stack. Refer to the following link for detailed info: http://www.artima.com/insidejvm/ed2/jvm8.html



来源:https://stackoverflow.com/questions/20441256/contents-of-stack-frame-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!