I'm curious about what ldc short for in JVM?

时光总嘲笑我的痴心妄想 提交于 2020-05-15 04:12:48

问题


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.


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/28264012/im-curious-about-what-ldc-short-for-in-jvm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!