
330 An Introduction to Compiler Construction in a Java World
D.5.4 Array Instructions
Mnemonic Operation Operand Stack
newarray Create new array · · · , count ⇒ · · · , arrayref
anewarray Create new array of refer-
ence type
· · · , count ⇒ · · · , arrayref
The above instructions can be added to the code section of a method by sending the
CLEmitter instance the following message:
public void ad d Arr a y Ins t ruct i on ( int opcode ,
String type )
where opcode is the mnemonic of the instruction to be added, and type is the type descriptor
of the array.
Mnemonic Operation Operand Stack
multianewarray Create new multidimen-
sional array
· · · , count1, [count ...