newarray = 188 |
atype |
Stack: ..., size => resultsize must be an integer. It represents the number of elements in the new array.
atype is an internal code that indicates the type of array to allocate. Possible values for atype are as follows:
T_BOOLEAN | 4 |
T_CHAR | 5 |
T_FLOAT | 6 |
T_DOUBLE | 7 |
T_BYTE | 8 |
T_SHORT | 9 |
T_INT | 10 |
T_LONG | 11 |
If size is less than zero, a NegativeArraySizeException
is thrown. If there is not enough memory to allocate the array, an OutOfMemoryError
is thrown.
anewarray = 189 |
indexbyte1 |
indexbyte2 |
Stack: ..., size=> resultsize must be an integer. It represents the number of elements in the new array.
indexbyte1 and indexbyte2 are used to construct an index into the constant pool of the current class. The item at that index is resolved. The resulting entry must be a class.
A new array of the indicated class type and capable of holding size elements is allocated, and result is a reference to this new object. Allocation of an array large enough to contain size items of the given class type is attempted. All elements of the array are initialized to null
.
If size is less than zero, a NegativeArraySizeException
is thrown. If there is not enough memory to allocate the array, an OutOfMemoryError
is thrown.
anewarray
is used to create a single dimension of an array of object references. For example, to create
new Thread[7]
the following code is used:
bipush 7
anewarray <Class "java.lang.Thread">
anewarray
can also be used to create the first dimension of a multi-dimensional array. For example, the following array declaration:
new int[6][]
is created with the following code:
bipush 6
anewarray <Class "[I">
See CONSTANT_Class
in the "Class File Format" chapter for information on array class names.
multianewarray = 197 |
indexbyte1 |
indexbyte2 |
dimensions |
Stack: ..., size1 size2...sizen => resultEach size must be an integer. Each represents the number of elements in a dimension of the array.
indexbyte1 and indexbyte2 are used to construct an index into the constant pool of the current class. The item at that index is resolved. The resulting entry must be an array class of one or more dimensions.
dimensions has the following aspects:
new int[6][3][]
the following code is used:
bipush 6
bipush 3
multianewarray <Class "[[[I"> 2
If any of the size arguments on the stack is less than zero, a NegativeArraySizeException
is thrown. If there is not enough memory to allocate the array, an OutOfMemoryError
is thrown.The result is a reference to the new array object.
Note: More explanation needed about how this is an array of arrays.
Note: It is more efficient to use newarray
or anewarray
when creating a single dimension.
See CONSTANT_Class
in the "Class File Format" chapter for information on array class names.
arraylength = 190 |
Stack: ..., objectref => ..., lengthobjectref must be a reference to an array object. The length of the array is determined and replaces objectref on the top of the stack.
If the objectref is null
, a NullPointerException
is thrown.
iaload = 46 |
Stack: ..., arrayref, index => ..., valuearrayref must be a reference to an array of integers. index must be an integer. The integer value at position number index in the array is retrieved and pushed onto the top of the stack.
If arrayref is null
a NullPointerException
is thrown. If index is not within the bounds of the array an ArrayIndexOutOfBoundsException
is thrown.
laload = 47 |
Stack: ..., arrayref, index => ..., valuearrayref must be a reference to an array of long integers. index must be an integer. The long integer value at position number index in the array is retrieved and pushed onto the top of the stack.-word1
, value-word2
If arrayref is null
a NullPointerException
is thrown. If index is not within the bounds of the array an ArrayIndexOutOfBoundsException
is thrown.
faload = 48 |
Stack: ..., arrayref, index => ..., valuearrayref must be a reference to an array of single-precision floating point numbers. index must be an integer. The single-precision floating point number value at position number index in the array is retrieved and pushed onto the top of the stack.
If arrayref is null
a NullPointerException
is thrown. If index is not within the bounds of the array an ArrayIndexOutOfBoundsException
is thrown.
daload = 49 |
Stack: ..., arrayref, index => ..., valuearrayref must be a reference to an array of double-precision floating point numbers. index must be an integer. The double-precision floating point number value at position number index in the array is retrieved and pushed onto the top of the stack.-word1
, value-word2
If arrayref is null
a NullPointerException
is thrown. If index is not within the bounds of the array an ArrayIndexOutOfBoundsException
is thrown.
aaload = 50 |
Stack: ..., arrayref, index => ..., valuearrayref must be a reference to an array of references to objects. index must be an integer. The object reference at position number index in the array is retrieved and pushed onto the top of the stack.
If arrayref is null
a NullPointerException
is thrown. If index is not within the bounds of the array an ArrayIndexOutOfBoundsException
is thrown.
baload = 51 |
Stack: ..., arrayref, index => ..., valuearrayref must be a reference to an array of signed bytes. index must be an integer. The signed byte value at position number index in the array is retrieved, expanded to an integer, and pushed onto the top of the stack.
If arrayref is null
a NullPointerException
is thrown. If index is not within the bounds of the array an ArrayIndexOutOfBoundsException
is thrown.
caload = 52 |
Stack: ..., arrayref, index => ..., valuearrayref must be a reference to an array of characters. index must be an integer. The character value at position number index in the array is retrieved, zero-extended to an integer, and pushed onto the top of the stack.
If arrayref is null
a NullPointerException
is thrown. If index is not within the bounds of the array an ArrayIndexOutOfBoundsException
is thrown.
saload = 53 |
Stack: ..., arrayref, index => ..., valuearrayref must be a reference to an array of short integers. index must be an integer. The ;signed short integer value at position number index in the array is retrieved, expanded to an integer, and pushed onto the top of the stack.
If arrayref is null
, a NullPointerException
is thrown. If index is not within the bounds of the array an ArrayIndexOutOfBoundsException
is thrown.
iastore = 79 |
Stack: ..., arrayref, index, value => ...arrayref must be a reference to an array of integers, index must be an integer, and value an integer. The integer value is stored at position index in the array.
If arrayref is null
, a NullPointerException
is thrown. If index is not within the bounds of the array an ArrayIndexOutOfBoundsException
is thrown.
lastore = 80 |
Stack: ..., arrayref, index, valuearrayref must be a reference to an array of long integers, index must be an integer, and value a long integer. The long integer value is stored at position index in the array.-word1
, value-word2
=> ...
If arrayref is null
, a NullPointerException
is thrown. If index is not within the bounds of the array, an ArrayIndexOutOfBoundsException
is thrown.
fastore = 81 |
Stack: ..., arrayref, index, value => ...arrayref must be an array of single-precision floating point numbers, index must be an integer, and value a single-precision floating point number. The single float value is stored at position index in the array.
If arrayref is null
, a NullPointerException
is thrown. If index is not within the bounds of the array an ArrayIndexOutOfBoundsException
is thrown.
dastore = 82 |
Stack: ..., arrayref, index, valuearrayref must be a reference to an array of double-precision floating point numbers, index must be an integer, and value a double-precision floating point number. The double float value is stored at position index in the array.-word1
, value-word2
=> ...
If arrayref is null
, a NullPointerException
is thrown. If index is not within the bounds of the array an ArrayIndexOutOfBoundsException
is thrown.
aastore = 83 |
Stack: ..., arrayref, index, value => ...arrayref must be a reference to an array of references to objects, index must be an integer, and value a reference to an object. The object reference value is stored at position index in the array.
If arrayref is null
, a NullPointerException
is thrown. If index is not within the bounds of the array, an ArrayIndexOutOfBoundsException
is thrown.
The actual type of value must be conformable with the actual type of the elements of the array. For example, it is legal to store an instance of class Thread
in an array of class Object
, but not vice versa. (See the Java Language Specification for information on how to determine whether a object reference is an instance of a class.) An ArrayStoreException
is thrown if an attempt is made to store an incompatible object reference.
Note: Mustn't refer to the Java Language Specification; give semantics here.
bastore = 84 |
Stack: ..., arrayref, index, value => ...arrayref must be a reference to an array of signed bytes, index must be an integer, and value an integer. The integer value is stored at position index in the array. If value is too large to be a signed byte, it is truncated.
If arrayref is null
, a NullPointerException
is thrown. If index is not within the bounds of the array an ArrayIndexOutOfBoundsException
is thrown.
castore = 85 |
Stack: ..., arrayref, index, value => ...arrayref must be an array of characters, index must be an integer, and value an integer. The integer value is stored at position index in the array. If value is too large to be a character, it is truncated.
If arrayref is null
, a NullPointerException
is thrown. If index is not within the bounds of [the array an ArrayIndexOutOfBoundsException
is thrown.
sastore = 86 |
Stack: ..., array, index, value => ...arrayref must be an array of shorts, index must be an integer, and value an integer. The integer value is stored at position index in the array. If value is too large to be an short, it is truncated.
If arrayref is null
, a NullPointerException
is thrown. If index is not within the bounds of the array an ArrayIndexOutOfBoundsException
is thrown.