List of usage examples for org.objectweb.asm Opcodes ASM5
int ASM5
To view the source code for org.objectweb.asm Opcodes ASM5.
Click Source Link
From source file:blue.origami.asm.OGeneratorAdapter.java
License:Apache License
public OGeneratorAdapter(MethodVisitor mv, int acc, String name, String methodDesc) { super(Opcodes.ASM5, mv, acc, name, methodDesc); int startIndex = 0; if ((acc & Opcodes.ACC_STATIC) != Opcodes.ACC_STATIC) { startIndex = 1;//from w w w.ja va 2 s . c o m } this.varScopes = new VarScopes(startIndex); }
From source file:br.ufpr.gres.core.premutation.PreMutationAnalyser.java
public PreMutationAnalyser() { super(Opcodes.ASM5); }
From source file:br.ufpr.gres.core.premutation.PreMutationMethodAnalyzer.java
public PreMutationMethodAnalyzer(final PremutationClassInfo classInfo) { super(Opcodes.ASM5, new TryWithResourcesMethodVisitor(classInfo)); this.classInfo = classInfo; this.loggingClasses = new HashSet<>(LOGGING_CLASSES); }
From source file:br.ufpr.gres.core.visitors.methods.TryWithResourcesMethodVisitor.java
/** * @param context to store detected line numbers *//*from w w w . j a v a 2s .c om*/ public TryWithResourcesMethodVisitor(final PremutationClassInfo context) { super(Opcodes.ASM5); this.context = context; }
From source file:br.usp.each.saeg.badua.cli.Report.java
License:Open Source License
public void run() throws IOException, ClassNotFoundException { data = read(inputFile);/* ww w .j ava 2 s.c om*/ final List<File> files = Files.listRecursive(classes, new FilenameFilter() { @Override public boolean accept(final File dir, final String name) { return new File(dir, name).isFile(); } }); for (final File file : files) { final InputStream input = new FileInputStream(file); final ContentTypeDetector detector = new ContentTypeDetector(input); try { if (detector.getType() == ContentTypeDetector.CLASSFILE) { final ClassReader cr = new ClassReader(detector.getInputStream()); final ClassNode cn = new ClassNode(Opcodes.ASM5); cr.accept(cn, ClassReader.EXPAND_FRAMES); classId = CRC64.checksum(cr.b); analyze(cn); } } finally { input.close(); } } }
From source file:br.usp.each.saeg.badua.core.internal.instr.ClassInstrumenter.java
License:Open Source License
public ClassInstrumenter(final long classId, final ClassVisitor cv) { super(Opcodes.ASM5, cv); this.classId = classId; }
From source file:br.usp.each.saeg.badua.core.internal.instr.MethodInstrumenter.java
License:Open Source License
public MethodInstrumenter(final int access, final String name, final String desc, final String signature, final String[] exceptions, final MethodVisitor next, final MethodTransformer mt) { super(Opcodes.ASM5, access, name, desc, signature, exceptions); this.exceptions = exceptions; this.next = next; this.mt = mt; }
From source file:bug_regression_jdk7.javassist.asm.BytecodeVerifyTestClassVisitor.java
License:Apache License
public BytecodeVerifyTestClassVisitor(final ClassVisitor cv) { super(Opcodes.ASM5, cv); }
From source file:ch.eiafr.cojac.Agent.java
License:Apache License
/** * This method works only with the FloatReplacerClasses class * It instruments it to create a static initializer block to set * all the static variables used by the agent and injected in the * instrumented application./*from ww w. j a v a2s . c o m*/ * Warning: this is not the only place to set these variables, see class * "CojacReferences" ! * This is used when there is more than one classloader in the application */ private byte[] setGlobalFields(byte[] byteCode, ClassLoader loader) { ClassReader cr = new ClassReader(byteCode); ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_FRAMES); ClassVisitor cv = new ClassVisitor(Opcodes.ASM5, cw) { @Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { super.visit(version, access, name, signature, superName, interfaces); MethodVisitor mv = cv.visitMethod(Opcodes.ACC_STATIC, "<clinit>", "()V", null, null); mv.visitLdcInsn(references.getDoubleWrapper()); mv.visitMethodInsn(Opcodes.INVOKESTATIC, name, "setNgWrapper", "(Ljava/lang/String;)V", false); mv.visitLdcInsn(references.getNgWrapper()); mv.visitMethodInsn(Opcodes.INVOKESTATIC, name, "setDoubleWrapper", "(Ljava/lang/String;)V", false); mv.visitLdcInsn(references.getFloatWrapper()); mv.visitMethodInsn(Opcodes.INVOKESTATIC, name, "setFloatWrapper", "(Ljava/lang/String;)V", false); mv.visitLdcInsn(references.getBigDecimalPrecision()); mv.visitMethodInsn(Opcodes.INVOKESTATIC, name, "setBigDecimalPrecision", "(I)V", false); mv.visitLdcInsn(references.getStabilityThreshold()); mv.visitMethodInsn(Opcodes.INVOKESTATIC, name, "setStabilityThreshold", "(D)V", false); mv.visitLdcInsn(references.getCheckUnstableComparisons() ? 1 : 0); mv.visitMethodInsn(Opcodes.INVOKESTATIC, name, "setCheckUnstableComparisons", "(Z)V", false); mv.visitInsn(Opcodes.RETURN); mv.visitMaxs(0, 0); } }; cr.accept(cv, ClassReader.EXPAND_FRAMES); return cw.toByteArray(); }
From source file:ch.eiafr.cojac.CojacCheckerMethodVisitor.java
License:Apache License
CojacCheckerMethodVisitor(int access, String desc, MethodVisitor mv, InstrumentationStats stats, Args args, String classPath, IOpcodeInstrumenterFactory factory) { super(Opcodes.ASM5, access, desc, mv); this.stats = stats; this.args = args; this.factory = factory; this.classPath = classPath; }