ByteCode:ldc pushes a one-word constant onto the operand stack. ldc takes a single parameter, , which is the value to push.
Most of the bytecodes in JVM can figure out their name by the code description. However, the ldc, I don't see any clue.
ByteCode:ldc pushes a one-word constant onto the operand stack. ldc takes a single parameter, , which is the value to push.
Most of the bytecodes in JVM can figure out their name by the code description. However, the ldc, I don't see any clue.
It is Load Constant. It loads an item from the constant pool onto the stack. The available types are:
int
float
java.lang.String
java.lang.Class
The Java 7 JVM added java.lang.invoke.MethodType
and java.lang.invoke.MethodHandle
.
The special variant ldc2_w
will load an item of either long
or double
type onto the stack.