简体   繁体   English

JVM PC计数器和堆栈空间如何与JIT一起使用?

[英]How does JVM PC counter and stack space work with JIT?

When a Java method get JIT-compiled and start running the JIT-ed native code: 当Java方法被JIT编译并开始运行JIT版本的本机代码时:

  1. Is the stack space still the same with previous one which running in interpreter mode? 堆栈空间是否与在解释器模式下运行的堆栈空间相同?
  2. Does the PC counter still being updated when running in JIT mode? 在JIT模式下运行时PC计数器仍在更新吗? if so, how? 如果是这样,怎么办?

(Let's say we are using OpenJDK). (假设我们正在使用OpenJDK)。

Is the stack space still the same with previous one which running in interpreter mode? 堆栈空间是否与在解释器模式下运行的堆栈空间相同?

The call stack is the same. 调用堆栈是相同的。 It doesn't rebuild the stack when JIT-ed code is swapped in. 交换JIT版本的代码时,它不会重建堆栈。

The value stack however can be assigned to registers and thus not maintained in native code. 但是,可以将值堆栈分配给寄存器,因此不能用本机代码维护。

Does the PC counter still being updated when running in JIT mode? 在JIT模式下运行时PC计数器仍在更新吗? if so, how? 如果是这样,怎么办?

The CPU's PC counter is used in native mode. CPU的PC计数器在纯模式下使用。 The virtual registers are notional in native optimised code. 虚拟寄存器在本地优化代码中是名义上的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM