How should I interpret "Operand Stack" in JVM Instruction Set docs?

Viewed 119

I am reading Chapter 6. The Java Virtual Machine Instruction Set

When I read "Operand Stack" in the excerpt below,I'm unsure how to interpret the section. Especially the arrows,does it mean in-stack and out-stack?

mnemonic
Operation
    Short description of the instruction

Format

    mnemonic
    operand1
    operand2
    ...
Forms
    mnemonic = opcode

Operand Stack
    ..., value1, value2 →

    ..., value3

Description
    A longer description detailing constraints on operand stack contents or constant pool entries, the operation performed, the type of the results, etc.
2 Answers

I guess this is explained in the "Notes" section:

In the description of the Java Virtual Machine instructions, the effect of an instruction's execution on the operand stack (§2.6.2) of the current frame (§2.6) is represented textually, with the stack growing from left to right and each value represented separately. Thus,

..., value1, value2 →

..., result

shows an operation that begins by having value2 on top of the operand stack with value1 just beneath it.

It is explained at the top

In the description of the Java Virtual Machine instructions, the effect of an instruction's execution on the operand stack (§2.6.2) of the current frame (§2.6) is represented textually, with the stack growing from left to right and each value represented separately. Thus,

..., value1, value2 →

..., result

shows an operation that begins by having value2 on top of the operand stack with value1 just beneath it. As a result of the execution of the instruction, value1 and value2 are popped from the operand stack and replaced by result value, which has been calculated by the instruction. The remainder of the operand stack, represented by an ellipsis (...), is unaffected by the instruction's execution.

Values of types long and double are represented by a single entry on the operand stack.

Related