wide 0xc4

Makes the next instruction take a two-byte local index (and a two-byte iinc constant).

Opcode
0xc4 (196)
Family
Other
Operands
  • 1 byte: the widened opcode
  • 2 bytes: local variable index
  • 2 bytes: signed constant (iinc only)
Length
6 bytes
Operand stack
… → …
Can throw
nothing at run time (beyond linking errors)

What it does

A prefix: the next instruction takes a two-byte local variable index instead of one byte. It applies to the loads, stores, ret and iinc; for iinc the constant grows to two bytes as well.

javac emits it for i += 1000 on an int local (the constant does not fit in a byte) and in methods with more than 256 local variable slots. javap shows the pair as one instruction, such as iinc_w.

How often javac uses it

In JDK 25.0.5's java.base module, wide appears 34 times in 19 of its 7,391 classes: <0.01% of all instructions, the 176th most common of 194 opcodes in use. Some of the methods that use it: java.io.ObjectOutputStream$BlockDataOutputStream.write, java.lang.FdLibm$Hypot.compute, java.lang.FdLibm$Sqrt.compute, java.math.BigDecimal.<init>.

Example

From the sample classes, compiled by javac 25 with -g. Each Java line is shown above the bytecode it compiled to; wide is highlighted.

static void big(int i) in Increments, compiled by javac 25
26i += 1000;
0wide iinc 0, 1000// i
27System.out.println(i);
6getstatic #17// System.out : PrintStream
9iload_0 // i
10invokevirtual #23// PrintStream.println(int) : void
28}

Open in the viewer

Related instructions

iinc Adds a signed constant to an int local variable, without touching the stack.iload Pushes the int in local variable (operand).astore Pops a reference into local variable (operand).

Specification: JVMS §6.5, wide (Java SE 25).