iflt 0x9b
Pops an int; jumps if it is less than zero.
- Opcode
0x9b(155)- Family
- Branches and switches
- Operands
- 2 bytes: signed branch offset
- Length
- 3 bytes
- Operand stack
…, value (int) → …- Can throw
- nothing at run time (beyond linking errors)
- Spec name
if<cond>
What it does
Pops an int and jumps if it is < 0. The offset is two signed bytes, relative to this instruction.
javac compiles an if statement as a jump past the then-part when the condition is false, so the instruction is usually the opposite of the source: if (x >= 0) becomes iflt to the else-part. It also follows lcmp, fcmpl and the other compare instructions, which push an int for it to test.
How often javac uses it
In JDK 25.0.5's java.base module, iflt appears 1,676 times in 590 of its 7,391 classes: 0.09% of all instructions, the 96th most common of 194 opcodes in use. Some of the methods that use it: java.io.CharArrayReader.<init>, java.io.File.getTotalSpace, java.io.FileInputStream.readAllBytes, java.io.InputStream.readNBytes.
Example
From the sample classes, compiled by javac 25 with -g. Each Java line is shown above the bytecode it compiled to; iflt is highlighted.
public Point(int x, int y) in Point, compiled by javac 25Related instructions
ifge Pops an int; jumps if it is greater than or equal to zero.if_icmplt Pops two ints; jumps if the first is less than the second.lcmp Compares two longs and pushes -1, 0 or 1.
Specification: JVMS §6.5, if<cond> (Java SE 25).