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; }
@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; }
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; }
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; }
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; }
@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; }
@SuppressWarnings("unused") public void setUsefulPartners(AnalyzerAdapter aaAfter, MyLocalAdder mla) { this.aaAfter=aaAfter; // this.mla=mla; }