bipush 0x10
Pushes a byte, sign-extended to int.
- Opcode
0x10(16)- Family
- Constants
- Operands
- 1 byte: signed byte value
- Length
- 2 bytes
- Operand stack
… → …, value (int)- Can throw
- nothing at run time (beyond linking errors)
What it does
Pushes the signed byte operand as an int. javac uses it for int, short, byte and char constants from -128 to 127 (outside -1 to 5, which have iconst forms).
How often javac uses it
In JDK 25.0.5's java.base module, bipush appears 89,187 times in 1,748 of its 7,391 classes: 4.6% of all instructions, the 4th most common of 194 opcodes in use. Some of the methods that use it: java.io.BufferedReader.fill, java.io.ByteArrayOutputStream.<init>, java.io.CharArrayWriter.<init>, java.io.DataInputStream.<init>.
Examples
From the sample classes, compiled by javac 25 with -g. Each Java line is shown above the bytecode it compiled to; bipush is highlighted.
public Nestmates() in Nestmates, compiled by javac 25static int sparse(int code) in Tour, compiled by javac 25Related instructions
iconst_0 Pushes the int constant 0.sipush Pushes a short, sign-extended to int.ldc Pushes a constant from the constant pool (index in one byte).
Specification: JVMS §6.5, bipush (Java SE 25).