currentSig = sig; methodAccess = access; methodName = sig.getName(); returnType = sig.getReturnType(); argumentTypes = sig.getArgumentTypes(); localOffset = TypeUtils.isStatic(access) ? 0 : 1; remap.clear();  firstLocal = nextLocal = localOffset + getStackSize(argumentTypes); codev = classv.visitMethod(access, methodName, sig.getDescriptor(), toInternalNames(exceptions));  wrapped = new CodeAdapter(codev) { public void visitMaxs(int maxStack, int maxLocals) {  }  public void visitVarInsn(int opcode, int var) { Type type; switch (opcode) { case Constants.RET: case Constants.ILOAD: case Constants.ISTORE: type = Type.INT_TYPE; break; case Constants.FLOAD: case Constants.FSTORE: type = Type.FLOAT_TYPE; break; case Constants.LLOAD: case Constants.LSTORE: type = Type.LONG_TYPE; break; case Constants.DLOAD: case Constants.DSTORE: type = Type.DOUBLE_TYPE; break; default: type = Constants.TYPE_OBJECT; } cv.visitVarInsn(opcode, remapLocal(this, var, type)); }  public void visitIincInsn(int var, int increment) { cv.visitIincInsn(remapLocal(this, var, Type.INT_TYPE), increment); }  public void visitLocalVariable(String name, String desc, Label start, Label end, int index) { cv.visitLocalVariable(name, desc, start, end, remapLocal(this, index, null)); } }; return wrapped;
curMethod = new EmitterMethod(classv, access, sig, exceptions); codev = curMethod.getRaw(); return curMethod;
    public CodeVisitor begin_method(int access, Signature sig, Type[] exceptions) {        closeMethod();        currentSig = sig;        methodAccess = access;        methodName = sig.getName();        returnType = sig.getReturnType();        argumentTypes = sig.getArgumentTypes();        localOffset = TypeUtils.isStatic(access) ? 0 : 1;        remap.clear();                firstLocal = nextLocal = localOffset + getStackSize(argumentTypes);        codev = classv.visitMethod(access,                                   methodName,                                   sig.getDescriptor(),                                   toInternalNames(exceptions));        wrapped = new CodeAdapter(codev) {            public void visitMaxs(int maxStack, int maxLocals) {                // ignore            }            public void visitVarInsn(int opcode, int var) {                Type type;                switch (opcode) {                case Constants.RET: // is this correct?                case Constants.ILOAD:                case Constants.ISTORE:                    type = Type.INT_TYPE;                    break;                case Constants.FLOAD:                case Constants.FSTORE:                    type = Type.FLOAT_TYPE;                    break;                case Constants.LLOAD:                case Constants.LSTORE:                    type = Type.LONG_TYPE;                    break;                case Constants.DLOAD:                case Constants.DSTORE:                    type = Type.DOUBLE_TYPE;                    break;                default:                    type = Constants.TYPE_OBJECT;                }                cv.visitVarInsn(opcode, remapLocal(this, var, type));            }            public void visitIincInsn(int var, int increment) {                cv.visitIincInsn(remapLocal(this, var, Type.INT_TYPE), increment);            }            public void visitLocalVariable(String name, String desc, Label start, Label end, int index) {                cv.visitLocalVariable(name, desc, start, end, remapLocal(this, index, null));            }        };        return wrapped;    }