@Override public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) { return new MethodInsnNode(opcode, owner, name, desc, itf); } }
@Override public void accept(final MethodVisitor mv) { mv.visitMethodInsn(opcode, owner, name, desc, itf); acceptAnnotations(mv); }
ReplacedMethodInsnNode( String newInternalName, Class<?> owner, MethodInsnNode methodInsnNode) { super( methodInsnNode.getOpcode(), newInternalName, replaceName(owner, methodInsnNode.name), methodInsnNode.desc, false); }
return (N)new MethodInsnNode( old.getOpcode(), old.owner, old.name,
if (methodInsnNode.name.equals("withTccl") && methodInsnNode.owner.equals(ASM.getInternalName(ClassLoaderServiceImpl.class))) { MethodInsnNode initWorkInsnNode = (MethodInsnNode)methodInsnNode.getPrevious(); String oldOwnerName = initWorkInsnNode.owner; initWorkInsnNode.owner = ASM.getDescriptor(EntityManagerFactoryBuilderImpl.class), ASM.getDescriptor(XEntityManagerFactoryBuilderImpl.class)); AbstractInsnNode tmpInsnNode = initWorkInsnNode.getPrevious(); while (true) { if (tmpInsnNode.getOpcode() == Opcodes.NEW) {
methodInsnNode.owner.equals(ASM.getInternalName(PersistenceXmlParser.class))) { AbstractInsnNode nextInsnNode = abstractInsnNode.getNext(); instructions.remove(methodInsnNode.getPrevious()); instructions.remove(methodInsnNode); InsnList tmpInstructions = new InsnList();
@Deprecated @Override public void visitMethodInsn(int opcode, String owner, String name, String desc) { if (api >= Opcodes.ASM5) { super.visitMethodInsn(opcode, owner, name, desc); return; } instructions.add(new MethodInsnNode(opcode, owner, name, desc)); }
@Override public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) { if (api < Opcodes.ASM5) { super.visitMethodInsn(opcode, owner, name, desc, itf); return; } instructions.add(new MethodInsnNode(opcode, owner, name, desc, itf)); }
invokedClassEntry = invokedMethodEntry.declaringClassEntry; if (invokedClassEntry.clazz != null /* Not new class entry */) { if (methodInsnNode.getOpcode() == Opcodes.INVOKEVIRTUAL) { invokedMethodEntry = invokedMethodEntry.polymorphicTarget; !invokedMethodEntry.isReplacedFor(invokingMethodEntry)) { if (!invokedMethodEntry.isOverriable(this.targetPackage) || methodInsnNode.getOpcode() != Opcodes.INVOKEVIRTUAL) { if (invokingMethodEntry.isInit()) { throw new AssertionError(
public static InsnList getUnboxInsnList(Class<?> primitiveType, boolean checkcast) { ExceptionUtil.mustNotBeEqualToValue("primitiveType", primitiveType, void.class); InsnList insnList = new InsnList(); if (!primitiveType.isPrimitive()) { return insnList; } Class<?> clazz = ClassInfo.box(primitiveType); String internalName = org.babyfish.org.objectweb.asm.Type.getInternalName(clazz); if (checkcast) { insnList.add(new TypeInsnNode(Opcodes.CHECKCAST, internalName)); } insnList.add( new MethodInsnNode( Opcodes.INVOKEVIRTUAL, internalName, primitiveType.getName() + "Value", "()" + getDescriptor(primitiveType), false)); return insnList; }
public static InsnList getBoxInsnList(Class<?> primitiveType, InsnList loadPrimtiveInsnNodeList) { if (!primitiveType.isPrimitive()) { return loadPrimtiveInsnNodeList; } ExceptionUtil.mustNotBeEqualToValue("primitiveType", primitiveType, void.class); Class<?> clazz = ClassInfo.box(primitiveType); String internalName = org.babyfish.org.objectweb.asm.Type.getInternalName(clazz); InsnList insnList = new InsnList(); insnList.add(new TypeInsnNode(Opcodes.NEW, internalName)); insnList.add(new InsnNode(Opcodes.DUP)); insnList.add(loadPrimtiveInsnNodeList); insnList.add( new MethodInsnNode( Opcodes.INVOKESPECIAL, internalName, "<init>", '(' + getDescriptor(primitiveType) + ")V", false)); return insnList; }
abstractInsnNode = new MethodInsnNode( Opcodes.INVOKESTATIC, this.newInternalName, abstractInsnNode = new MethodInsnNode( Opcodes.INVOKESTATIC, this.newInternalName, abstractInsnNode = new MethodInsnNode( Opcodes.INVOKESTATIC, this.newInternalName, InsnList tmpInstructions = new InsnList(); tmpInstructions.add(new LdcInsnNode(typeInsnNode.desc)); tmpInstructions.add(new MethodInsnNode( Opcodes.INVOKESTATIC, ASM.getInternalName(ClassInfo.class), false)); tmpInstructions.add(new InsnNode(Opcodes.SWAP)); tmpInstructions.add(new MethodInsnNode( Opcodes.INVOKESTATIC, ASM.getInternalName(Array.class),
slotIndex += ASM.getSlotCount(parameterType); instractions.add(new MethodInsnNode( Opcodes.INVOKESPECIAL, lastEntry.clazz.getName().replace('.', '/'),
tmpInstructions.add(new InsnNode(Opcodes.SWAP)); tmpInstructions.add( new MethodInsnNode( Opcodes.INVOKEVIRTUAL, ASM.getInternalName(HqlParser.class), false)); tmpInstructions.add( new MethodInsnNode( Opcodes.INVOKEVIRTUAL, this.getResultInternalName(),
tmpInstructions.add(new InsnNode(Opcodes.SWAP)); tmpInstructions.add( new MethodInsnNode( Opcodes.INVOKEVIRTUAL, ASM.getInternalName(HqlParser.class), false)); tmpInstructions.add( new MethodInsnNode( Opcodes.INVOKESPECIAL, this.getResultInternalName(), afterInstructions.add(new VarInsnNode(Opcodes.ALOAD, 3)); afterInstructions.add( new MethodInsnNode( Opcodes.INVOKESPECIAL, this.getResultInternalName(), afterInstructions.add(new VarInsnNode(Opcodes.ALOAD, 3)); afterInstructions.add( new MethodInsnNode( Opcodes.INVOKESPECIAL, this.getResultInternalName(), afterInstructions.add(new VarInsnNode(Opcodes.ALOAD, 0)); afterInstructions.add( new MethodInsnNode( Opcodes.INVOKEVIRTUAL, this.getResultInternalName(),
instructions.add(new VarInsnNode(Opcodes.ALOAD, 0)); instructions.add( new MethodInsnNode( Opcodes.INVOKEVIRTUAL, this.getResultInternalName(), instructions.add(new LdcInsnNode(true)); instructions.add( new MethodInsnNode( Opcodes.INVOKEVIRTUAL, this.getResultInternalName(), instructions.add(new VarInsnNode(Opcodes.ALOAD, 1)); instructions.add( new MethodInsnNode( Opcodes.INVOKEVIRTUAL, ASM.getInternalName(QueryTranslatorImpl.class), instructions.add(new VarInsnNode(Opcodes.ALOAD, walkerIndex)); instructions.add( new MethodInsnNode( Opcodes.INVOKEVIRTUAL, ASM.getInternalName(HqlSqlWalker.class), instructions.add(new VarInsnNode(Opcodes.ALOAD, sqlAstIndex)); instructions.add( new MethodInsnNode( Opcodes.INVOKEVIRTUAL, this.getResultInternalName(),
tmpInstructions.add(new LdcInsnNode(fieldEntry.declaringClassEntry.clazz.getName())); tmpInstructions.add( new MethodInsnNode( Opcodes.INVOKESTATIC, ASM.getInternalName(ClassInfo.class), tmpInstructions.add(new MethodInsnNode( Opcodes.INVOKEVIRTUAL, "java/lang/Class", tmpInstructions.add(new InsnNode(Opcodes.DUP)); tmpInstructions.add(new LdcInsnNode(true)); tmpInstructions.add(new MethodInsnNode( Opcodes.INVOKEVIRTUAL, Type.getInternalName(Field.class), tmpInstructions.add(new LdcInsnNode("Internal bug: 1")); tmpInstructions.add( new MethodInsnNode( Opcodes.INVOKESPECIAL, Type.getInternalName(AssertionError.class), tmpInstructions.add(new LdcInsnNode("Internal bug: 2")); tmpInstructions.add( new MethodInsnNode( Opcodes.INVOKESPECIAL, Type.getInternalName(AssertionError.class), tmpInstructions.add(new LdcInsnNode(methodEntry.declaringClassEntry.clazz.getName()));
new MethodInsnNode( Opcodes.INVOKEVIRTUAL, Type.getInternalName(Field.class), instructions.add(new InsnNode(Opcodes.DUP)); instructions.add(new LdcInsnNode("Internal bug: 5")); instructions.add(new MethodInsnNode( Opcodes.INVOKESPECIAL, Type.getInternalName(AssertionError.class),
new MethodInsnNode( Opcodes.INVOKEVIRTUAL, Type.getInternalName(Field.class), instructions.add(new InsnNode(Opcodes.DUP)); instructions.add(new LdcInsnNode("Internal bug: 6")); instructions.add(new MethodInsnNode( Opcodes.INVOKESPECIAL, Type.getInternalName(AssertionError.class),