public void visitLdcInsn(Object cst) { if (cst instanceof Type) { String name = ((Type)cst).getInternalName(); if (name.equals(oldName)) { cst = Type.getType(newNameDesc); } } super.visitLdcInsn(cst); }
public void visitTypeInsn(int opcode, String desc) { if (opcode == ANEWARRAY) { reportError("no.array.creation", desc); } if (opcode == NEW) { if (inlineConcatLevel == 0 || !Type.getInternalName(StringBuilder.class).equals(desc)) { reportError("no.new.object", desc); } } super.visitTypeInsn(opcode, desc); }
inlineConcatLevel--; } else if (!Type.getInternalName(StringBuilder.class).equals(owner) || inlineConcatLevel == 0) { Type[] args = Type.getArgumentTypes(desc); switch (opcode) { if ((inlineConcatLevel == 0 || !Type.getInternalName(StringBuilder.class).equals(owner)) && !ctValidator.isCallTargetValid(owner, name, args.length)) { reportError("no.method.calls", owner + "." + name + desc);
Type.getInternalName(method.getDeclaringClass()), method.getName(), Type.getMethodDescriptor(method));
private int generateClinit(MethodVisitor mv) { Type clazz = Type.getType("L" + cname + ";"); // the client name (the BTrace script class name) mv.visitLdcInsn(runtime); // the name of the currently processed class mv.visitLdcInsn(clazz); // NOI18N // invocatio nof BTraceRuntime.retransform() method mv.visitMethodInsn(Opcodes.INVOKESTATIC, Type.getInternalName(BTraceRuntime.class), "retransform", "(Ljava/lang/String;Ljava/lang/Class;)V"); // NOI18N return clazz.getSize() + Type.getType(String.class).getSize(); } }
public void doProvide() { push(myArgTypes.length); visitTypeInsn(ANEWARRAY, TypeUtils.objectType.getInternalName()); for (int j = 0; j < myArgTypes.length; j++) { dup(); push(j); Type argType = myArgTypes[j]; loadLocal(argType, argPtr); box(argType); arrayStore(TypeUtils.objectType); argPtr += argType.getSize(); } }
t = type.getInternalName(); break;
case '[': case 'L': super.visitTypeInsn(CHECKCAST, Type.getType(desc).getInternalName()); break; case 'Z':