= Java virtual machine
{c}
The <Java virtual machine> is the abstract execution machine specified for Java class files and <bytecode>. It defines runtime data areas, <stack frames>, <operand stacks>, <local variables> and <machine instruction>[instruction] behavior, while leaving implementation choices such as interpretation and <just-in-time compilation> open.<The Java Virtual Machine Specification Java SE 25>[Chapter2, especially §§2.5–2.6 and2.13]{ref}
For example, two integer loads followed by an integer-add <machine instruction>[instruction] obtain operands from a <stack frame> and leave their sum on its <operand stack>. A method call establishes a new <stack frame> and later returns a result to its caller. These specified effects remain the contract even if a compiler keeps the values in <processor registers>[native registers] and emits one <machine instruction>. The virtual-machine interface therefore supports portable compiled code without requiring every implementation to execute <bytecode> one <machine instruction>[instruction] at a time.
Back to article page