类org.objectweb.asm.commons.AnalyzerAdapter源码实例Demo

下面列出了怎么用org.objectweb.asm.commons.AnalyzerAdapter的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: bistoury   文件: MonitorClassVisitor.java
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
    final MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
    if (name.equals(methodName) && desc.equals(methodDesc)) {
        logger.debug("visit method, name: {}, desc: {}", name, desc);

        MonitorMethodVisitor monitorMV = new MonitorMethodVisitor(methodVisitor, access, name, desc, className);

        AnalyzerAdapter analyzerAdapter = new AnalyzerAdapter(className, access, name, desc, monitorMV);
        monitorMV.setAnalyzerAdapter(analyzerAdapter);
        LocalVariablesSorter localVariablesSorter = new LocalVariablesSorter(access, desc, analyzerAdapter);
        monitorMV.setLocalVariablesSorter(localVariablesSorter);

        return localVariablesSorter;
    } else {
        return methodVisitor;
    }
}
 
源代码2 项目: bistoury   文件: ASMTest.java
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
    System.out.println(name);
    final MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
    /*if (!"setCount".equals(name)) {
        return methodVisitor;
    }*/
    MonitorAdviceAdapter monitorMV = new MonitorAdviceAdapter(ASM7, methodVisitor, access, name, desc, className, exceptions);
    AnalyzerAdapter analyzerAdapter = new AnalyzerAdapter(className, access, name, desc, monitorMV);
    monitorMV.setAnalyzerAdapter(analyzerAdapter);
    LocalVariablesSorter localVariablesSorter = new LocalVariablesSorter(access, desc, analyzerAdapter);
    monitorMV.setLocalVariablesSorter(localVariablesSorter);
    //MonitorAdviceAdapter monitorMV = new MonitorAdviceAdapter(ASM7, new LocalVariablesSorter(access, desc, methodVisitor), access, name, desc, className, exceptions);

    return localVariablesSorter;
}
 
public TaintTrackingMethodVisitor(InheritanceMap inheritanceMap,
                                  Map<MethodReference.Handle, Set<Integer>> passthroughDataflow,
                                  final int api, final MethodVisitor mv, final String owner, int access,
                                  String name, String desc, String signature, String[] exceptions) {
    super(api, new AnalyzerAdapter(owner, access, name, desc, mv));
    this.inheritanceMap = inheritanceMap;
    this.passthroughDataflow = passthroughDataflow;
    this.analyzerAdapter = (AnalyzerAdapter)this.mv;
    this.access = access;
    this.name = name;
    this.desc = desc;
    this.signature = signature;
    this.exceptions = exceptions;
}
 
源代码4 项目: buck   文件: RegisterSpecAnalyzer.java
@Override
public MethodVisitor visitMethod(
    int access, String name, String desc, String signature, String[] exceptions) {
  RegSpecMethodVisitor mv = new RegSpecMethodVisitor(className, name);
  AnalyzerAdapter adapter = new AnalyzerAdapter(className, access, name, desc, mv);
  mv.adapter = adapter;
  return adapter;
}
 
源代码5 项目: bistoury   文件: MonitorMethodVisitor.java
public void setAnalyzerAdapter(AnalyzerAdapter analyzerAdapter) {
    this.analyzerAdapter = analyzerAdapter;
}
 
源代码6 项目: bistoury   文件: MonitorAdviceAdapter.java
public void setAnalyzerAdapter(AnalyzerAdapter analyzerAdapter) {
    this.analyzerAdapter = analyzerAdapter;
}
 
 类所在包
 同包方法