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

项目:Cojac    文件:FloatVariablesSorter.java   
public FloatVariablesSorter(int access, String oldDesc, AnalyzerAdapter mv) {
    super(Opcodes.ASM5, mv);
    Type[] args = Type.getArgumentTypes(oldDesc);
    firstFrameMapping = new int[1+args.length*2]; // +1 for 'this'
    Arrays.fill(firstFrameMapping, -1); // so that erroneously using unwritten cells will cause problems...
    boolean hasTarget = (Opcodes.ACC_STATIC & access) == 0; // not static -> there is a 'this' param
    int oldVarIndex = 0;
    int newVarIndex = 0;
    int lastIndexSet = -1;
    if (hasTarget) {
        oldVarIndex=newVarIndex=1;
        firstFrameMapping[0]=0; // 'this' remains 'this' after remapping...
        lastIndexSet=0;
    }
    for (Type arg : args) {
        firstFrameMapping[oldVarIndex] = newVarIndex;
        lastIndexSet=oldVarIndex;
        oldVarIndex += arg.getSize();
        newVarIndex += arg.getSize();
        if (arg.equals(Type.DOUBLE_TYPE)) {
            newVarIndex--;
        }
        assert !arg.equals(COJAC_DOUBLE_WRAPPER_TYPE); // this would be strange (the descriptor is the old one)
    }
    maxRenumber = lastIndexSet;
}
项目:jephyr    文件:ActiveObjectClassAdapter.java   
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
    MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
    if (activeObject) {
        if ((access & ACC_STATIC) != 0 && name.equals("<clinit>") && desc.equals("()V")) {
            clinit = true;
            return new ClinitMethodAdapter(mv);
        } else if (name.charAt(0) == '<') {
            InitMethodAdapter adapter = new InitMethodAdapter(access, desc, mv);
            AnalyzerAdapter analyzerAdapter = new AnalyzerAdapter(this.name, access, name, desc, adapter);
            adapter.adapter = analyzerAdapter;
            return analyzerAdapter;
        } else {
            return new MethodAdapter(access, name, desc, signature, exceptions, mv);
        }
    }
    return mv;
}
项目:Cojac    文件:FloatReplacerMethodVisitor.java   
FloatReplacerMethodVisitor(AnalyzerAdapter aa, 
          MethodVisitor lvs, 
          ReplaceFloatsMethods rfm, 
          InstrumentationStats stats, 
          IOpcodeInstrumenterFactory factory, 
          CojacReferences references) {
      super(Opcodes.ASM5, lvs);

      //this.lvs=lvs;
      this.aa = aa;
      this.rfm = rfm;
this.references = references;
      this.stats = stats;
      this.factory = factory;
  }
项目:jephyr    文件:ContinuationMethodAdapter.java   
static MethodVisitor create(String owner, int access, String name, String desc, String signature,
        String[] exceptions, MethodVisitor mv) {
    ContinuationMethodAdapter adapter =
            new ContinuationMethodAdapter(owner, access, name, desc, signature, exceptions, mv);
    AnalyzerAdapter analyzerAdapter = new AnalyzerAdapter(owner, access, name, desc, adapter);
    adapter.adapter = analyzerAdapter;
    return analyzerAdapter;
}
项目:jephyr    文件:NewRelocatorMethodAdapter.java   
static MethodVisitor create(String owner, int access, String name, String desc, String signature,
        String[] exceptions, MethodVisitor mv) {
    NewRelocatorMethodAdapter adapter =
            new NewRelocatorMethodAdapter(access, name, desc, signature, exceptions, mv);
    AnalyzerAdapter analyzerAdapter = new AnalyzerAdapter(owner, access, name, desc, adapter);
    adapter.adapter = analyzerAdapter;
    return analyzerAdapter;
}
项目:buck-cutom    文件: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;
}
项目: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;
}
项目:Cojac    文件:FloatProxyMethod.java   
@SuppressWarnings("unused")
public void setUsefulPartners(AnalyzerAdapter aaAfter, MyLocalAdder mla) {
    this.aaAfter=aaAfter;
    // this.mla=mla;
}