ifle 0x9e
Pops an int; jumps if it is less than or equal to zero.
- Opcode
0x9e(158)- 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 ifle 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, ifle appears 2,075 times in 743 of its 7,391 classes: 0.11% of all instructions, the 87th most common of 194 opcodes in use. Some of the methods that use it: java.io.BufferedInputStream.fill, java.io.BufferedOutputStream.flushBuffer, java.io.BufferedReader.fill, java.io.ByteArrayInputStream.transferTo.
Examples
From the sample classes, compiled by javac 25 with -g. Each Java line is shown above the bytecode it compiled to; ifle is highlighted.
static boolean doubleGreater(double a, double b) in Compare, compiled by javac 25static String sign(int x) in Conditions, compiled by javac 25Related instructions
ifgt Pops an int; jumps if it is greater than zero.if_icmple Pops two ints; jumps if the first is less than or equal to the second.lcmp Compares two longs and pushes -1, 0 or 1.
Specification: JVMS §6.5, if<cond> (Java SE 25).