List of Java bytecode instructions: Difference between revisions

Content deleted Content added
Added clauses on the d/fcmpl/g instructions to indicate the difference between them
DayDun (talk | contribs)
m Changed addition to the more standard logical or as written in the specification
Line 75:
|2: indexbyte1, indexbyte2
|count → arrayref
|create a new array of references of length ''count'' and component type identified by the class reference ''index'' ({{mono|indexbyte1 << 8 +{{pipe}} indexbyte2}}) in the constant pool
|-
|areturn
Line 180:
|2: indexbyte1, indexbyte2
|objectref → objectref
|checks whether an ''objectref'' is of a certain type, the class reference of which is in the constant pool at ''index'' ({{mono|indexbyte1 << 8 +{{pipe}} indexbyte2}})
|-
|d2f
Line 600:
|2: indexbyte1, indexbyte2
|objectref → value
|get a field ''value'' of an object ''objectref'', where the field is identified by field reference in the constant pool ''index'' ({{mono|indexbyte1 << 8 +{{pipe}} indexbyte2}})
|-
|getstatic
Line 607:
|2: indexbyte1, indexbyte2
|→ value
|get a static field ''value'' of a class, where the field is identified by field reference in the constant pool ''index'' ({{mono|indexbyte1 << 8 +{{pipe}} indexbyte2}})
|-
|goto
Line 614:
|2: branchbyte1, branchbyte2
|[no change]
|goes to another instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|goto_w
Line 621:
|4: branchbyte1, branchbyte2, branchbyte3, branchbyte4
|[no change]
|goes to another instruction at ''branchoffset'' (signed int constructed from unsigned bytes {{mono|branchbyte1 << 24 +{{pipe}} branchbyte2 << 16 +{{pipe}} branchbyte3 << 8 +{{pipe}} branchbyte4}})
|-
|i2b
Line 754:
|2: branchbyte1, branchbyte2
|value1, value2 →
|if references are equal, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|if_acmpne
Line 761:
|2: branchbyte1, branchbyte2
|value1, value2 →
|if references are not equal, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|if_icmpeq
Line 768:
|2: branchbyte1, branchbyte2
|value1, value2 →
|if ints are equal, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|if_icmpge
Line 775:
|2: branchbyte1, branchbyte2
|value1, value2 →
|if ''value1'' is greater than or equal to ''value2'', branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|if_icmpgt
Line 782:
|2: branchbyte1, branchbyte2
|value1, value2 →
|if ''value1'' is greater than ''value2'', branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|if_icmple
Line 789:
|2: branchbyte1, branchbyte2
|value1, value2 →
|if ''value1'' is less than or equal to ''value2'', branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|if_icmplt
Line 796:
|2: branchbyte1, branchbyte2
|value1, value2 →
|if ''value1'' is less than ''value2'', branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|if_icmpne
Line 803:
|2: branchbyte1, branchbyte2
|value1, value2 →
|if ints are not equal, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|ifeq
Line 810:
|2: branchbyte1, branchbyte2
|value →
|if ''value'' is 0, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|ifge
Line 817:
|2: branchbyte1, branchbyte2
|value →
|if ''value'' is greater than or equal to 0, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|ifgt
Line 824:
|2: branchbyte1, branchbyte2
|value →
|if ''value'' is greater than 0, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|ifle
Line 831:
|2: branchbyte1, branchbyte2
|value →
|if ''value'' is less than or equal to 0, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|iflt
Line 838:
|2: branchbyte1, branchbyte2
|value →
|if ''value'' is less than 0, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|ifne
Line 845:
|2: branchbyte1, branchbyte2
|value →
|if ''value'' is not 0, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|ifnonnull
Line 852:
|2: branchbyte1, branchbyte2
|value →
|if ''value'' is not null, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|ifnull
Line 859:
|2: branchbyte1, branchbyte2
|value →
|if ''value'' is null, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}})
|-
|iinc
Line 936:
|2: indexbyte1, indexbyte2
|objectref → result
|determines if an object ''objectref'' is of a given type, identified by class reference ''index'' in constant pool ({{mono|indexbyte1 << 8 +{{pipe}} indexbyte2}})
|-
|invokedynamic
Line 943:
|4: indexbyte1, indexbyte2, 0, 0
|[arg1, [arg2 ...]] → result
|invokes a dynamic method and puts the result on the stack (might be void); the method is identified by method reference ''index'' in constant pool ({{mono|indexbyte1 << 8 +{{pipe}} indexbyte2}})
|-
|invokeinterface
Line 950:
|4: indexbyte1, indexbyte2, count, 0
|objectref, [arg1, arg2, ...] → result
|invokes an interface method on object ''objectref'' and puts the result on the stack (might be void); the interface method is identified by method reference ''index'' in constant pool ({{mono|indexbyte1 << 8 +{{pipe}} indexbyte2}})
|-
|invokespecial
Line 957:
|2: indexbyte1, indexbyte2
|objectref, [arg1, arg2, ...] → result
|invoke instance method on object ''objectref'' and puts the result on the stack (might be void); the method is identified by method reference ''index'' in constant pool ({{mono|indexbyte1 << 8 +{{pipe}} indexbyte2}})
|-
|invokestatic
Line 964:
|2: indexbyte1, indexbyte2
|[arg1, arg2, ...] → result
|invoke a static method and puts the result on the stack (might be void); the method is identified by method reference ''index'' in constant pool ({{mono|indexbyte1 << 8 +{{pipe}} indexbyte2}})
|-
|invokevirtual
Line 971:
|2: indexbyte1, indexbyte2
|objectref, [arg1, arg2, ...] → result
|invoke virtual method on object ''objectref'' and puts the result on the stack (might be void); the method is identified by method reference ''index'' in constant pool ({{mono|indexbyte1 << 8 +{{pipe}} indexbyte2}})
|-
|ior
Line 1,069:
|2: branchbyte1, branchbyte2
|→ address
|jump to subroutine at ''branchoffset'' (signed short constructed from unsigned bytes {{mono|branchbyte1 << 8 +{{pipe}} branchbyte2}}) and place the return address on the stack
|-
|jsr_w
Line 1,076:
|4: branchbyte1, branchbyte2, branchbyte3, branchbyte4
|→ address
|jump to subroutine at ''branchoffset'' (signed int constructed from unsigned bytes {{mono|branchbyte1 << 24 +{{pipe}} branchbyte2 << 16 +{{pipe}} branchbyte3 << 8 +{{pipe}} branchbyte4}}) and place the return address on the stack
|-
|l2d
Line 1,160:
|2: indexbyte1, indexbyte2
|→ value
|push a constant ''#index'' from a constant pool (String, int, float, Class, java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, or a dynamically-computed constant) onto the stack (wide ''index'' is constructed as {{mono|indexbyte1 << 8 +{{pipe}} indexbyte2}})
|-
|ldc2_w
Line 1,167:
|2: indexbyte1, indexbyte2
|→ value
|push a constant ''#index'' from a constant pool (double, long, or a dynamically-computed constant) onto the stack (wide ''index'' is constructed as {{mono|indexbyte1 << 8 +{{pipe}} indexbyte2}})
|-
|ldiv
Line 1,342:
|3: indexbyte1, indexbyte2, dimensions
|count1, [count2,...] → arrayref
|create a new array of ''dimensions'' dimensions of type identified by class reference in constant pool ''index'' ({{mono|indexbyte1 << 8 +{{pipe}} indexbyte2}}); the sizes of each dimension is identified by ''count1'', [''count2'', etc.]
|-
|new
Line 1,349:
|2: indexbyte1, indexbyte2
|→ objectref
|create new object of type identified by class reference in constant pool ''index'' ({{mono|indexbyte1 << 8 +{{pipe}} indexbyte2}})
|-
|newarray
Line 1,384:
|2: indexbyte1, indexbyte2
|objectref, value →
|set field to ''value'' in an object ''objectref'', where the field is identified by a field reference ''index'' in constant pool ({{mono|indexbyte1 << 8 +{{pipe}} indexbyte2}})
|-
|putstatic
Line 1,391:
|2: indexbyte1, indexbyte2
|value →
|set static field to ''value'' in a class, where the field is identified by a field reference ''index'' in constant pool ({{mono|indexbyte1 << 8 +{{pipe}} indexbyte2}})
|-
|ret