5

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.

W.Zhe
  • 87
  • 1
  • 8

2 Answers2

6

I suppose it is LoaD Constant but I do not have any reference.

Stilgar
  • 21,249
  • 9
  • 61
  • 99
6

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.

Holger
  • 267,107
  • 35
  • 402
  • 715
Charles Forsythe
  • 1,761
  • 10
  • 12