new_quick |
indexbyte1 |
indexbyte2 |
Stack: ... => ..., objectrefindexbyte1 and indexbyte2 are used to construct an index into the constant pool of the current class. The item at that index must be a class. A new instance of that class is then created and objectref, a reference to that object is pushed on the stack.
checkcast_quick |
indexbyte1 |
indexbyte2 |
Stack: ..., objectref => ..., objectrefobjectref must be a reference to an object. indexbyte1 and indexbyte2 are used to construct an index into the constant pool of the current class. The object at that index of the constant pool must have already been resolved.
checkcast
then determines whether objectref can be cast to a reference to an object of class class. A null
reference can be cast to any class, and otherwise the superclasses of objectref's type are searched for class. If class is determined to be a superclass of objectref's type, or if objectref is null, it can be cast to objectref cannot be cast to class, a ClassCastException
is thrown.
Note: here (and probably in other places) we assume casts don't change the reference; this is implementation dependent.
instanceof_quick |
indexbyte1 |
indexbyte2 |
Stack: ..., objectref => ..., resultobjectref must be a reference to an object.
indexbyte1
and indexbyte2 are used to construct an index into the constant pool of the current class. The item of class class at that index of the constant pool must have already been resolved.
instanceof
determines whether objectref can be cast to an object of the class class. A null
objectref can be cast to any class, and otherwise the superclasses of objectref's type are searched for class. If class is determined to be a superclass of objectref's type, result is 1 (true
). Otherwise, result is 0 (false
). If handle is null
, result is 0 (false
).