ishl 0x78
Shifts left two ints on top of the stack; pushes the result.
- Opcode
0x78(120)- Family
- Arithmetic and bitwise
- Operands
- none
- Length
- 1 byte
- Operand stack
…, value1 (int), value2 (int) → …, result (int)- Can throw
- nothing at run time (beyond linking errors)
What it does
x << n on an int: shifts left, filling with zeros. The shift distance is always an int, and only its low 5 bits are used: 1 << 32 is 1, not 0.
How often javac uses it
In JDK 25.0.5's java.base module, ishl appears 1,122 times in 297 of its 7,391 classes: 0.06% of all instructions, the 106th most common of 194 opcodes in use. Some of the methods that use it: java.io.CharArrayWriter.write, java.io.DataInputStream.readUTF, java.io.ObjectInputStream$BlockDataInputStream.readChars, java.io.ObjectInputStream$HandleTable.grow.
Example
From the sample classes, compiled by javac 25 with -g. Each Java line is shown above the bytecode it compiled to; ishl is highlighted.
static int ints(int a, int b) in Tour, compiled by javac 25Related instructions
lshl Shifts left two longs on top of the stack; pushes the result.
Specification: JVMS §6.5, ishl (Java SE 25).