我正在看书Inside the Java 2 Virtual Machine我不明白这意味着什么:
The Java Virtual Machine is stack-based rather than register-based because its instructions take their operands from the operand stack rather than from registers. Instructions can also take operands from other places, such as immediately following the opcode (the byte representing the instruction) in the bytecode stream, or from the constant pool.
谁能帮我解决这个问题:
Instructions can also take operands from other places, such as immediately following the opcode
,也许有一个例子?
最佳答案
例如,有一个 iinc 指令,它向局部变量添加一个常量值,如下所示:
iinc 1, 8
这意味着“将 8 添加到局部变量 #1”。常量8直接写在字节码中,位于iinc指令代码和常量1之后:0x84 0x01 0x08
。
关于java - "taking operands immediately following the opcode"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30012078/