List of Java bytecode instructions: Difference between revisions

Content deleted Content added
Add missing parenthesis on if_* instruction descriptions
BattyBot (talk | contribs)
top: Fixed reference date error(s) (see CS1 errors: dates for details) and AWB general fixes
 
(3 intermediate revisions by 3 users not shown)
Line 1:
{{Short description|none}} <!-- This short description is INTENTIONALLY "none" - please see WP:SDNONE before you consider changing it! -->
{{Main|Java bytecode}}
 
This is a list of the instructions that make up the [[Java bytecode]], an abstract machine language that is ultimately executed by the [[Java virtual machine]].<ref>{{cite web|url=https://docs.oracle.com/javase/specs/jvms/se12se24/html/index.html |title=The Java® Virtual Machine Specification – Java SE 1224 Edition |access-date=MayJuly 2226, 20212025}}</ref> The Java bytecode is generated from languages running on the [[Java Platform]], most notably the [[Java (programming language)|Java programming language]].
 
''Note that any referenced "value" refers to a 32-bit int as per the Java instruction set.''
Line 754 ⟶ 755:
|2: branchbyte1, branchbyte2
|value1, value2 →
|if references are equal, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes ({{mono|branchbyte1 &lt;&lt; 8 {{pipe}} branchbyte2}})
|-
|if_acmpne
Line 761 ⟶ 762:
|2: branchbyte1, branchbyte2
|value1, value2 →
|if references are not equal, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes ({{mono|branchbyte1 &lt;&lt; 8 {{pipe}} branchbyte2}})
|-
|if_icmpeq
Line 768 ⟶ 769:
|2: branchbyte1, branchbyte2
|value1, value2 →
|if ints are equal, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes ({{mono|branchbyte1 &lt;&lt; 8 {{pipe}} branchbyte2}})
|-
|if_icmpge
Line 775 ⟶ 776:
|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 &lt;&lt; 8 {{pipe}} branchbyte2}})
|-
|if_icmpgt
Line 782 ⟶ 783:
|2: branchbyte1, branchbyte2
|value1, value2 →
|if ''value1'' is greater than ''value2'', branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes ({{mono|branchbyte1 &lt;&lt; 8 {{pipe}} branchbyte2}})
|-
|if_icmple
Line 789 ⟶ 790:
|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 &lt;&lt; 8 {{pipe}} branchbyte2}})
|-
|if_icmplt
Line 796 ⟶ 797:
|2: branchbyte1, branchbyte2
|value1, value2 →
|if ''value1'' is less than ''value2'', branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes ({{mono|branchbyte1 &lt;&lt; 8 {{pipe}} branchbyte2}})
|-
|if_icmpne
Line 803 ⟶ 804:
|2: branchbyte1, branchbyte2
|value1, value2 →
|if ints are not equal, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes ({{mono|branchbyte1 &lt;&lt; 8 {{pipe}} branchbyte2}})
|-
|ifeq
Line 810 ⟶ 811:
|2: branchbyte1, branchbyte2
|value →
|if ''value'' is 0, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes ({{mono|branchbyte1 &lt;&lt; 8 {{pipe}} branchbyte2}})
|-
|ifge
Line 817 ⟶ 818:
|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 &lt;&lt; 8 {{pipe}} branchbyte2}})
|-
|ifgt
Line 824 ⟶ 825:
|2: branchbyte1, branchbyte2
|value →
|if ''value'' is greater than 0, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes ({{mono|branchbyte1 &lt;&lt; 8 {{pipe}} branchbyte2}})
|-
|ifle
Line 831 ⟶ 832:
|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 &lt;&lt; 8 {{pipe}} branchbyte2}})
|-
|iflt
Line 838 ⟶ 839:
|2: branchbyte1, branchbyte2
|value →
|if ''value'' is less than 0, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes ({{mono|branchbyte1 &lt;&lt; 8 {{pipe}} branchbyte2}})
|-
|ifne
Line 845 ⟶ 846:
|2: branchbyte1, branchbyte2
|value →
|if ''value'' is not 0, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes ({{mono|branchbyte1 &lt;&lt; 8 {{pipe}} branchbyte2}})
|-
|ifnonnull
Line 852 ⟶ 853:
|2: branchbyte1, branchbyte2
|value →
|if ''value'' is not null, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes ({{mono|branchbyte1 &lt;&lt; 8 {{pipe}} branchbyte2}})
|-
|ifnull
Line 859 ⟶ 860:
|2: branchbyte1, branchbyte2
|value →
|if ''value'' is null, branch to instruction at ''branchoffset'' (signed short constructed from unsigned bytes ({{mono|branchbyte1 &lt;&lt; 8 {{pipe}} branchbyte2}})
|-
|iinc
Line 1,458 ⟶ 1,459:
|}
{{Refbegin}}
{{note label|Deprecated|†||Deprecated in Java 7 (major class version 51).<ref>{{cite web|url=https://docs.oracle.com/javase/specs/jvms/se8se24/html/jvms-4.html#jvms-4.9.1 |title=Chapter 4. The class File Format 4.9.1. Static Constraints |access-date=MayJuly 2226, 20212025}}</ref> They will not appear in class files generated from a compiler newer than that. <code>ret</code> is not explicitly deprecated, but useless without the <code>jsr</code> and <code>jsr_w</code> opcodes.}}
{{Refend}}
 
Line 1,469 ⟶ 1,470:
 
== External links ==
*[https://docs.oracle.com/javase/specs/jvms/se12se24/html/jvms-6.html The Java Virtual Machine Instruction Set]
 
{{Java (Sun)}}