Contents | Prev | Next | Index | The JavaTM Virtual Machine Specification |
multianewarray_quick | |
indexbyte1 | |
indexbyte2 | |
dimensions |
Forms
multianewarray_quick = 223 (0xdf)
Stack
..., count1, [count2, ...] ..., arrayref
Description
The dimensions is an unsigned byte which must be greater than or equal to 1. It represents the number of dimensions of the array to be created. The operand stack must contain dimensions words, which must be of type int
and nonnegative, each representing the number of components in a dimension of the array to be created. The count1 is the desired length in the first dimension, count2 in the second, etc.
All of the count values are popped off the operand stack. The unsigned indexbyte1 and indexbyte2 are used to construct an index into the constant pool of the current class (§3.6), where the value of the index is (indexbyte1 << 8) | indexbyte2. The resulting entry must have already been resolved to an array class type of dimensionality greater than or equal to dimensions.
A new multidimensional array of the array type is allocated from the garbage-collected heap. The components of the first dimension of the array are initialized to subarrays of the type of second dimension, and so on. The components of the array in the final dimension are initialized to the default initial value for its type (§2.5.1). A reference
arrayref to the new array is pushed onto the operand stack.
multianewarray_quick (cont.) multianewarray_quick (cont.)
Runtime Exception
If any of the dimensions values on the operand stack is less than zero, multianewarray_quick throws a NegativeArraySize
-Exception
.
Notes
The opcode of this instruction was originally multianewarray. The operands of the multianewarray instruction are not modified.
Contents | Prev | Next | Index
Java Virtual Machine Specification (HTML generated by chsieh on March 13, 1997)
Copyright © 1996, 1997 Sun Microsystems, Inc.
All rights reserved
Please send any comments or corrections to doug.kramer@sun.com