字节码执行引擎 - Java PC寄存器中的数据在方法正常返回后是如何恢复的,不同的JVM实现会采用不同方法吗?
PHP中文网
PHP中文网 2017-04-17 16:00:57
0
1
572

《深入理解Java虚拟机》中说:“一般来说,方法正常退出时,调用者的PC计数器的值可以作为返回地址,栈帧中很可能会保存这个计数器值。”。为什么是“可以作为”和“很可能”,有点模糊,具体是保存在栈帧的什么地方呢,有什么其他实现吗?

PHP中文网
PHP中文网

认证0级讲师

reply all(1)
PHPzhong

Because the operation of registers is transparent to Java developers, that is to say, JVMs may not necessarily implement it according to the above method. As long as the results of the execution of Java code are consistent under any circumstances, it can be considered that JVM is reliable and does not necessarily operate the registers in the same way.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template