Example usage for org.objectweb.asm Opcodes ASM4

List of usage examples for org.objectweb.asm Opcodes ASM4

Introduction

In this page you can find the example usage for org.objectweb.asm Opcodes ASM4.

Prototype

int ASM4

To view the source code for org.objectweb.asm Opcodes ASM4.

Click Source Link

Usage

From source file:jaspex.speculation.InjectOverloadsClassVisitor.java

License:Open Source License

public InjectOverloadsClassVisitor(ClassVisitor cv, InfoClass currentClass) {
    super(Opcodes.ASM4, cv);
    _currentClass = currentClass;
}

From source file:jaspex.speculation.MethodReplacerMethodVisitor.java

License:Open Source License

public MethodReplacerMethodVisitor(int access, String name, String desc, String signature, String[] exceptions,
        ClassVisitor cv, InfoClass currentClass, Boolean JDKClass) {
    super(Opcodes.ASM4, cv.visitMethod(access, name, desc, signature, exceptions));
    _active = name.endsWith("$transactional") || (name.equals("<clinit>") && !JDKClass) // No modificar <clinit> quando usado com o JDKTransactifier
            || (name.equals("<init>") && desc.contains("jaspex/MARKER/Transactional"));
}

From source file:jaspex.speculation.newspec.CleanupFutureTypeInfoMethodVisitor.java

License:Open Source License

public CleanupFutureTypeInfoMethodVisitor(int access, String name, String desc, String signature,
        String[] exceptions, ClassVisitor cv) {
    super(Opcodes.ASM4, cv.visitMethod(access, name, desc, signature, exceptions));
}

From source file:jaspex.speculation.newspec.FakeLocalsStack.java

License:Open Source License

public DelayGetFutureMethodVisitor(int access, String name, String desc, String signature, String[] exceptions,
        ClassVisitor cv, InfoClass currentClass) {
    super(Opcodes.ASM4, new AnalyzerAdapter(currentClass.type().asmName(), access, name, desc,
            cv.visitMethod(access, name, desc, signature, exceptions)));

    // FIXME: Especulao em constructores disabled por agora (first draft)
    if (name.endsWith(
            "$speculative") /*||
                            (name.equals("<init>") &&
                            CommonTypes.SPECULATIVECTORMARKER.equals(m.argumentTypes().peekLast()))*/) {
        _active = true;/*from  w w w  .  j a v a  2 s.  co m*/
    } else {
        _active = false;
    }

    _analyzerAdapter = (AnalyzerAdapter) mv;
}

From source file:jaspex.speculation.newspec.InsertContinuationSpeculationMethodVisitor.java

License:Open Source License

public InsertContinuationSpeculationMethodVisitor(int access, String name, String desc, String signature,
        String[] exceptions, ClassVisitor cv, InfoClass currentClass,
        HashMap<InfoMethod, UtilList<Integer>> rejectedSpecIdsMap) {
    super(Opcodes.ASM4, cv.visitMethod(access, name, desc, signature, exceptions));

    // FIXME: Especulao em constructores disabled por agora (first draft)
    if (name.endsWith(
            "$speculative") /*||
                            (name.equals("<init>") &&
                            CommonTypes.SPECULATIVECTORMARKER.equals(m.argumentTypes().peekLast()))*/) {
        _active = true;//from ww  w  .  java 2s.c  om
    } else {
        _active = false;
    }

    _currentMethod = currentClass.getMethod(name, desc);
    UtilList<Integer> rejectedSpecIds = rejectedSpecIdsMap.get(_currentMethod);
    _rejectedSpecIds = (rejectedSpecIds != null) ? rejectedSpecIds : new UtilArrayList<Integer>();
    _firstPass = false;
}

From source file:jaspex.speculation.newspec.NopAddBeforeLabelMethodVisitor.java

License:Open Source License

public NopAddBeforeLabelMethodVisitor(int access, String name, String desc, String signature,
        String[] exceptions, ClassVisitor cv) {
    super(Opcodes.ASM4, cv.visitMethod(access, name, desc, signature, exceptions));
}

From source file:jaspex.speculation.newspec.NopRemoveMethodVisitor.java

License:Open Source License

public NopRemoveMethodVisitor(int access, String name, String desc, String signature, String[] exceptions,
        ClassVisitor cv) {//from  w w  w. j  a  v a2s  . c o m
    super(Opcodes.ASM4, cv.visitMethod(access, name, desc, signature, exceptions));
}

From source file:jaspex.speculation.newspec.RemoveInlineMarkerMethodVisitor.java

License:Open Source License

public RemoveInlineMarkerMethodVisitor(int access, String name, String desc, String signature,
        String[] exceptions, ClassVisitor cv) {
    super(Opcodes.ASM4, cv.visitMethod(access, name, desc, signature, exceptions));
}

From source file:jaspex.speculation.SpeculativeCtorMethodVisitor.java

License:Open Source License

public SpeculativeCtorMethodVisitor(int access, String name, String desc, String signature, String[] exceptions,
        ClassVisitor cv) {//from  w  w  w  . jav  a2s . co  m
    super(Opcodes.ASM4, cv.visitMethod(access, name, (name.equals("<init>") ? convertDesc(desc) : desc),
            signature, exceptions));
    _isClinit = name.equals("<clinit>");
    _active = _isClinit || name.endsWith("$transactional")
            || (name.equals("<init>") && desc.contains("jaspex/MARKER/Transactional"));
}

From source file:jaspex.speculation.SpeculativeTransformer.java

License:Open Source License

public static byte[] removeLineNumber(byte[] output) {
    ClassWriter cw = new ClassWriter(0);

    new ClassReader(output).accept(new ClassVisitor(Opcodes.ASM4, cw) {
        @Override/*from   w  w w.ja v a  2  s . c  o  m*/
        public MethodVisitor visitMethod(int access, String name, String desc, String signature,
                String[] exceptions) {
            return new MethodVisitor(Opcodes.ASM4, cv.visitMethod(access, name, desc, signature, exceptions)) {
                @Override
                public void visitLineNumber(int line, Label start) {
                }
            };
        }
    }, 0);

    return cw.toByteArray();
}