/** * @throws IllegalArgumentException if method has no code */ public CodeDisassembler(MethodInfo method) throws IllegalArgumentException { mMethod = method; mEnclosingClassName = method.getClassFile().getClassName(); mSuperClassName = method.getClassFile().getSuperClassName(); if ((mCode = method.getCodeAttr()) == null) { throw new IllegalArgumentException("Method defines no code"); } mCp = mCode.getConstantPool(); CodeBuffer buffer = mCode.getCodeBuffer(); mByteCodes = buffer.getByteCodes(); mExceptionHandlers = buffer.getExceptionHandlers(); }
boolean saveLocalVariableInfo) { String target = info.getClassFile().getTarget(); if ("1.0".equals(target)) { mTarget = 0x00010000; mClassFile = info.getClassFile(); mCp = mClassFile.getConstantPool(); mInstructions = new InstructionList(saveLocalVariableInfo);
void set(ConstantPool cp, MethodInfo info) { TypeDesc[] paramTypes = info.getMethodDescriptor().getParameterTypes(); VerificationTypeInfo[] infos; int offset; if (info.getModifiers().isStatic()) { infos = new VerificationTypeInfo[paramTypes.length]; offset = 0; } else { infos = new VerificationTypeInfo[1 + paramTypes.length]; if (info.getName().equals("<init>")) { infos[0] = UninitThisVariableInfo.THE; } else { infos[0] = VerificationTypeInfo.forType(cp, info.getClassFile().getType()); } offset = 1; } for (int i=0; i<paramTypes.length; i++) { infos[offset + i] = VerificationTypeInfo.forType(cp, paramTypes[i]); } mLocalInfos = infos; } }
/** * @throws IllegalArgumentException if method has no code */ public CodeDisassembler(MethodInfo method) throws IllegalArgumentException { mMethod = method; mEnclosingClassName = method.getClassFile().getClassName(); mSuperClassName = method.getClassFile().getSuperClassName(); if ((mCode = method.getCodeAttr()) == null) { throw new IllegalArgumentException("Method defines no code"); } mCp = mCode.getConstantPool(); CodeBuffer buffer = mCode.getCodeBuffer(); mByteCodes = buffer.getByteCodes(); mExceptionHandlers = buffer.getExceptionHandlers(); }
boolean saveLocalVariableInfo) String target = info.getClassFile().getTarget(); if ("1.0".equals(target)) { mTarget = 0x00010000; mClassFile = info.getClassFile(); mCp = mClassFile.getConstantPool(); mInstructions = new InstructionList(saveLocalVariableInfo);
void set(ConstantPool cp, MethodInfo info) { TypeDesc[] paramTypes = info.getMethodDescriptor().getParameterTypes(); VerificationTypeInfo[] infos; int offset; if (info.getModifiers().isStatic()) { infos = new VerificationTypeInfo[paramTypes.length]; offset = 0; } else { infos = new VerificationTypeInfo[1 + paramTypes.length]; if (info.getName().equals("<init>")) { infos[0] = UninitThisVariableInfo.THE; } else { infos[0] = VerificationTypeInfo.forType(cp, info.getClassFile().getType()); } offset = 1; } for (int i=0; i<paramTypes.length; i++) { infos[offset + i] = VerificationTypeInfo.forType(cp, paramTypes[i]); } mLocalInfos = infos; } }