JVM Knowledge

ifnonnull

Raw .md Oracle

Operation

Branch if reference not null

Format

ifnonnull
branchbyte1
branchbyte2

Forms

ifnonnull = 199 (0xc7)

Operand Stack

..., value →

...

Description

The value must be of type reference. It is popped from the operand stack. If value is not null, the unsigned branchbyte1 and branchbyte2 are used to construct a signed 16-bit offset, where the offset is calculated to be (branchbyte1 << 8) | branchbyte2. Execution then proceeds at that offset from the address of the opcode of this ifnonnull instruction. The target address must be that of an opcode of an instruction within the method that contains this ifnonnull instruction.

Otherwise, execution proceeds at the address of the instruction following this ifnonnull instruction.