本文整理汇总了Java中scouter.javassist.bytecode.ConstPool.CONST_Class方法的典型用法代码示例。如果您正苦于以下问题:Java ConstPool.CONST_Class方法的具体用法?Java ConstPool.CONST_Class怎么用?Java ConstPool.CONST_Class使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scouter.javassist.bytecode.ConstPool
的用法示例。
在下文中一共展示了ConstPool.CONST_Class方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doLDC
import scouter.javassist.bytecode.ConstPool; //导入方法依赖的package包/类
private void doLDC(int index) {
TypeData[] stackTypes = this.stackTypes;
int tag = cpool.getTag(index);
if (tag == ConstPool.CONST_String)
stackTypes[stackTop++] = new TypeData.ClassName("java.lang.String");
else if (tag == ConstPool.CONST_Integer)
stackTypes[stackTop++] = INTEGER;
else if (tag == ConstPool.CONST_Float)
stackTypes[stackTop++] = FLOAT;
else if (tag == ConstPool.CONST_Long) {
stackTypes[stackTop++] = LONG;
stackTypes[stackTop++] = TOP;
}
else if (tag == ConstPool.CONST_Double) {
stackTypes[stackTop++] = DOUBLE;
stackTypes[stackTop++] = TOP;
}
else if (tag == ConstPool.CONST_Class)
stackTypes[stackTop++] = new TypeData.ClassName("java.lang.Class");
else
throw new RuntimeException("bad LDC: " + tag);
}
示例2: evalLDC
import scouter.javassist.bytecode.ConstPool; //导入方法依赖的package包/类
private void evalLDC(int index, Frame frame) throws BadBytecode {
int tag = constPool.getTag(index);
Type type;
switch (tag) {
case ConstPool.CONST_String:
type = STRING_TYPE;
break;
case ConstPool.CONST_Integer:
type = Type.INTEGER;
break;
case ConstPool.CONST_Float:
type = Type.FLOAT;
break;
case ConstPool.CONST_Long:
type = Type.LONG;
break;
case ConstPool.CONST_Double:
type = Type.DOUBLE;
break;
case ConstPool.CONST_Class:
type = CLASS_TYPE;
break;
default:
throw new BadBytecode("bad LDC [pos = " + lastPos + "]: " + tag);
}
simplePush(type, frame);
}