问题
What's the difference between java bytecode astore_1
and astore_2
?
回答1:
The instructions astore_n
, for small values of n
, are just shorthand equivalents for astore n
. Either version stores what's on top of the stack into local variable n
.
回答2:
astore_1
is the same as astore 1
, and astore_2
is the same as astore 2
, except that astore_1
and astore_2
are one byte each, whereas astore
is a two-byte instruction.
来源:https://stackoverflow.com/questions/6983641/whats-the-difference-between-java-bytecode-astore-1-and-astore-2