What is the difference between java bytecode astore_1 and astore_2

What is the difference between java bytecode astore_1and astore_2?

+2
source share
2 answers

Instructions astore_n, for small values n, are only abbreviated equivalents for astore n. Any version stores what is on top of the stack in a local variable n.

+7
source

astore_1coincides with astore 1and astore_2coincides with astore 2, except that astore_1and astore_2are one byte, whereas astorea double-byte instruction.

+4
source

All Articles