Search in sources :

Example 56 with FieldVisitor

use of org.objectweb.asm.FieldVisitor in project soot by Sable.

the class InnerClassTest method generate.

@Override
protected void generate(TraceClassVisitor visitor) {
    MethodVisitor mv;
    FieldVisitor fv;
    visitor.visit(V1_1, ACC_SUPER, "soot/asm/backend/targets/InnerClass$Inner", null, "java/lang/Object", null);
    visitor.visitSource("InnerClass.java", null);
    visitor.visitInnerClass("soot/asm/backend/targets/InnerClass$Inner", "soot/asm/backend/targets/InnerClass", "Inner", ACC_PRIVATE);
    {
        fv = visitor.visitField(ACC_FINAL + ACC_STATIC, "a", "I", null, new Integer(3));
        fv.visitEnd();
    }
    {
        fv = visitor.visitField(ACC_FINAL + ACC_SYNTHETIC, "this$0", "Lsoot/asm/backend/targets/InnerClass;", null, null);
        fv.visitEnd();
    }
    {
        mv = visitor.visitMethod(ACC_PRIVATE, "<init>", "(Lsoot/asm/backend/targets/InnerClass;)V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 1);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/InnerClass$Inner", "this$0", "Lsoot/asm/backend/targets/InnerClass;");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    visitor.visitEnd();
}
Also used : FieldVisitor(org.objectweb.asm.FieldVisitor) MethodVisitor(org.objectweb.asm.MethodVisitor)

Example 57 with FieldVisitor

use of org.objectweb.asm.FieldVisitor in project soot by Sable.

the class ConstantPoolTest method generate.

@Override
protected void generate(TraceClassVisitor cw) {
    FieldVisitor fv;
    MethodVisitor mv;
    cw.visit(V1_1, ACC_PUBLIC + ACC_SUPER, "soot/asm/backend/targets/ConstantPool", null, "java/lang/Object", null);
    cw.visitSource("ConstantPool.java", null);
    {
        fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "s1", "Ljava/lang/String;", null, "H:mm:ss.SSS");
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "s2", "Ljava/lang/String;", null, null);
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "o1", "Ljava/lang/Object;", null, null);
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "o2", "Ljava/lang/Object;", null, null);
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "o3", "Ljava/lang/Object;", null, null);
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "o4", "Ljava/lang/Object;", null, null);
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "o5", "Ljava/lang/Object;", null, null);
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "i1", "I", null, new Integer(123));
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "i2", "I", null, null);
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "l1", "J", null, new Long(12233L));
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "l2", "J", null, new Long(123L));
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "l3", "J", null, null);
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "d1", "D", null, new Double("123.142"));
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "d2", "D", null, new Double("1234.123046875"));
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "d3", "D", null, null);
        fv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_STATIC, "<clinit>", "()V", null, null);
        mv.visitCode();
        mv.visitInsn(ACONST_NULL);
        mv.visitFieldInsn(PUTSTATIC, "soot/asm/backend/targets/ConstantPool", "s2", "Ljava/lang/String;");
        mv.visitLdcInsn("O");
        mv.visitFieldInsn(PUTSTATIC, "soot/asm/backend/targets/ConstantPool", "o1", "Ljava/lang/Object;");
        mv.visitInsn(ACONST_NULL);
        mv.visitFieldInsn(PUTSTATIC, "soot/asm/backend/targets/ConstantPool", "o2", "Ljava/lang/Object;");
        mv.visitIntInsn(BIPUSH, 123);
        mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false);
        mv.visitFieldInsn(PUTSTATIC, "soot/asm/backend/targets/ConstantPool", "o3", "Ljava/lang/Object;");
        mv.visitLdcInsn(new Long(1234L));
        mv.visitMethodInsn(INVOKESTATIC, "java/lang/Long", "valueOf", "(J)Ljava/lang/Long;", false);
        mv.visitFieldInsn(PUTSTATIC, "soot/asm/backend/targets/ConstantPool", "o4", "Ljava/lang/Object;");
        mv.visitLdcInsn(new Double("123.3"));
        mv.visitMethodInsn(INVOKESTATIC, "java/lang/Double", "valueOf", "(D)Ljava/lang/Double;", false);
        mv.visitFieldInsn(PUTSTATIC, "soot/asm/backend/targets/ConstantPool", "o5", "Ljava/lang/Object;");
        mv.visitTypeInsn(NEW, "java/lang/Integer");
        mv.visitInsn(DUP);
        mv.visitIntInsn(BIPUSH, 123);
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Integer", "<init>", "(I)V", false);
        mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Integer", "intValue", "()I", false);
        mv.visitFieldInsn(PUTSTATIC, "soot/asm/backend/targets/ConstantPool", "i2", "I");
        mv.visitTypeInsn(NEW, "java/lang/Long");
        mv.visitInsn(DUP);
        mv.visitLdcInsn(new Long(12341L));
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Long", "<init>", "(J)V", false);
        mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Long", "longValue", "()J", false);
        mv.visitFieldInsn(PUTSTATIC, "soot/asm/backend/targets/ConstantPool", "l3", "J");
        mv.visitTypeInsn(NEW, "java/lang/Double");
        mv.visitInsn(DUP);
        mv.visitLdcInsn(new Double("1234.123"));
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Double", "<init>", "(D)V", false);
        mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Double", "doubleValue", "()D", false);
        mv.visitFieldInsn(PUTSTATIC, "soot/asm/backend/targets/ConstantPool", "d3", "D");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    cw.visitEnd();
}
Also used : FieldVisitor(org.objectweb.asm.FieldVisitor) MethodVisitor(org.objectweb.asm.MethodVisitor)

Example 58 with FieldVisitor

use of org.objectweb.asm.FieldVisitor in project soot by Sable.

the class MethodExampleTest method generate.

@Override
protected void generate(TraceClassVisitor visitor) {
    FieldVisitor fv;
    MethodVisitor mv;
    visitor.visit(Opcodes.V1_1, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, "soot/asm/backend/targets/Bean", null, "java/lang/Object", null);
    visitor.visitSource("Bean.java", null);
    {
        fv = visitor.visitField(Opcodes.ACC_PRIVATE, "f", "I", null, null);
        fv.visitEnd();
    }
    {
        mv = visitor.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
        mv.visitInsn(Opcodes.RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = visitor.visitMethod(Opcodes.ACC_PUBLIC, "checkAndSetF", "(I)V", null, null);
        mv.visitCode();
        mv.visitVarInsn(Opcodes.ILOAD, 1);
        Label l0 = new Label();
        mv.visitJumpInsn(Opcodes.IFLT, l0);
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitVarInsn(Opcodes.ILOAD, 1);
        mv.visitFieldInsn(Opcodes.PUTFIELD, "soot/asm/backend/targets/Bean", "f", "I");
        Label l1 = new Label();
        mv.visitJumpInsn(Opcodes.GOTO, l1);
        mv.visitLabel(l0);
        mv.visitTypeInsn(Opcodes.NEW, "java/lang/IllegalArgumentException");
        mv.visitInsn(Opcodes.DUP);
        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/IllegalArgumentException", "<init>", "()V", false);
        mv.visitInsn(Opcodes.ATHROW);
        mv.visitLabel(l1);
        mv.visitInsn(Opcodes.RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = visitor.visitMethod(Opcodes.ACC_PUBLIC, "getF", "()I", null, null);
        mv.visitCode();
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitFieldInsn(Opcodes.GETFIELD, "soot/asm/backend/targets/Bean", "f", "I");
        mv.visitInsn(Opcodes.IRETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = visitor.visitMethod(Opcodes.ACC_PUBLIC, "setF", "(I)V", null, null);
        mv.visitCode();
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitVarInsn(Opcodes.ILOAD, 1);
        mv.visitFieldInsn(Opcodes.PUTFIELD, "soot/asm/backend/targets/Bean", "f", "I");
        mv.visitInsn(Opcodes.RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    visitor.visitEnd();
}
Also used : Label(org.objectweb.asm.Label) FieldVisitor(org.objectweb.asm.FieldVisitor) MethodVisitor(org.objectweb.asm.MethodVisitor)

Example 59 with FieldVisitor

use of org.objectweb.asm.FieldVisitor in project soot by Sable.

the class ModifiersTest method generate.

@Override
protected void generate(TraceClassVisitor cw) {
    MethodVisitor mv;
    FieldVisitor fv;
    cw.visit(V1_3, ACC_PUBLIC + ACC_SUPER + ACC_ABSTRACT, "soot/asm/backend/targets/Modifiers", null, "java/lang/Object", null);
    cw.visitSource("Modifiers.java", null);
    {
        fv = cw.visitField(ACC_PRIVATE + ACC_VOLATILE, "i", "I", null, null);
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PRIVATE + ACC_FINAL, "j", "I", null, new Integer(213));
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PRIVATE + ACC_TRANSIENT, "k", "I", null, null);
        fv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_PUBLIC + ACC_STRICT, "<init>", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitIntInsn(SIPUSH, 213);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/Modifiers", "j", "I");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL + ACC_STRICT, "a", "()V", null, null);
        mv.visitCode();
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_PUBLIC + ACC_SYNCHRONIZED + ACC_STRICT, "b", "()V", null, null);
        mv.visitCode();
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC + ACC_STRICT, "c", "()V", null, null);
        mv.visitCode();
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_STRICT, "d", "()V", null, null);
        mv.visitCode();
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_PROTECTED + ACC_STRICT, "e", "()V", null, null);
        mv.visitCode();
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_ABSTRACT, "f", "()V", null, null);
        mv.visitEnd();
    }
    {
        if (targetCompiler == TargetCompiler.eclipse)
            mv = cw.visitMethod(ACC_PRIVATE + ACC_NATIVE, "g", "()V", null, null);
        else
            mv = cw.visitMethod(ACC_PRIVATE + ACC_NATIVE + ACC_STRICT, "g", "()V", null, null);
        mv.visitEnd();
    }
    cw.visitEnd();
}
Also used : FieldVisitor(org.objectweb.asm.FieldVisitor) MethodVisitor(org.objectweb.asm.MethodVisitor)

Example 60 with FieldVisitor

use of org.objectweb.asm.FieldVisitor in project soot by Sable.

the class LogicalOperationsTest method generate.

@Override
protected void generate(TraceClassVisitor cw) {
    MethodVisitor mv;
    FieldVisitor fv;
    cw.visit(V1_1, ACC_PUBLIC + ACC_SUPER, "soot/asm/backend/targets/LogicalOperations", null, "java/lang/Object", null);
    cw.visitSource("LogicalOperations.java", null);
    {
        fv = cw.visitField(ACC_PRIVATE, "i1", "I", null, null);
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PRIVATE, "b1", "Z", null, null);
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PRIVATE, "l1", "J", null, null);
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PRIVATE, "i2", "I", null, null);
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PRIVATE, "b2", "Z", null, null);
        fv.visitEnd();
    }
    {
        fv = cw.visitField(ACC_PRIVATE, "l2", "J", null, null);
        fv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_PUBLIC, "doAnd", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "i2", "I");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "i1", "I");
        mv.visitInsn(IAND);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "i1", "I");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "l2", "J");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "l1", "J");
        mv.visitInsn(LAND);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "l1", "J");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "b2", "Z");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "b1", "Z");
        mv.visitInsn(IAND);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "b1", "Z");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_PUBLIC, "doInv", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "i2", "I");
        mv.visitInsn(ICONST_M1);
        mv.visitInsn(IXOR);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "i1", "I");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "i2", "I");
        mv.visitInsn(ICONST_M1);
        mv.visitInsn(IXOR);
        mv.visitInsn(I2L);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "l1", "J");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_PUBLIC, "doOr", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "i2", "I");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "i1", "I");
        mv.visitInsn(IOR);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "i1", "I");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "l2", "J");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "l1", "J");
        mv.visitInsn(LOR);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "l1", "J");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "b2", "Z");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "b1", "Z");
        mv.visitInsn(IOR);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "b1", "Z");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_PUBLIC, "doShl", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "i1", "I");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "i2", "I");
        mv.visitInsn(ISHL);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "i1", "I");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "l1", "J");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "l2", "J");
        mv.visitInsn(L2I);
        mv.visitInsn(LSHL);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "l1", "J");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_PUBLIC, "doShr", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "i1", "I");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "i2", "I");
        mv.visitInsn(ISHR);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "i1", "I");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "l1", "J");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "l2", "J");
        mv.visitInsn(L2I);
        mv.visitInsn(LSHR);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "l1", "J");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_PUBLIC, "doUShr", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "i1", "I");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "i2", "I");
        mv.visitInsn(IUSHR);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "i1", "I");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "l1", "J");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "l2", "J");
        mv.visitInsn(L2I);
        mv.visitInsn(LUSHR);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "l1", "J");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    {
        mv = cw.visitMethod(ACC_PUBLIC, "doXOr", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "i2", "I");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "i1", "I");
        mv.visitInsn(IXOR);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "i1", "I");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "l2", "J");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "l1", "J");
        mv.visitInsn(LXOR);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "l1", "J");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "b2", "Z");
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, "soot/asm/backend/targets/LogicalOperations", "b1", "Z");
        mv.visitInsn(IXOR);
        mv.visitFieldInsn(PUTFIELD, "soot/asm/backend/targets/LogicalOperations", "b1", "Z");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    cw.visitEnd();
}
Also used : FieldVisitor(org.objectweb.asm.FieldVisitor) MethodVisitor(org.objectweb.asm.MethodVisitor)

Aggregations

FieldVisitor (org.objectweb.asm.FieldVisitor)90 MethodVisitor (org.objectweb.asm.MethodVisitor)59 Label (org.objectweb.asm.Label)33 ClassWriter (org.objectweb.asm.ClassWriter)28 AnnotationVisitor (org.objectweb.asm.AnnotationVisitor)9 ClassReader (org.objectweb.asm.ClassReader)8 Type (org.objectweb.asm.Type)7 Method (java.lang.reflect.Method)6 ClassVisitor (org.objectweb.asm.ClassVisitor)6 IOException (java.io.IOException)4 GeneratorAdapter (org.objectweb.asm.commons.GeneratorAdapter)4 ArrayList (java.util.ArrayList)3 HashSet (java.util.HashSet)3 LitString (lucee.transformer.expression.literal.LitString)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 File (java.io.File)2 FileOutputStream (java.io.FileOutputStream)2 PrintWriter (java.io.PrintWriter)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 URL (java.net.URL)2