Add the parameter register count to the stored state in MethodAnalyzer

This commit is contained in:
Ben Gruver 2013-04-07 20:32:38 -07:00
parent 4cf7845ea4
commit 4bf810ee76

View File

@ -67,6 +67,8 @@ public class MethodAnalyzer {
@Nonnull private final Method method; @Nonnull private final Method method;
@Nonnull private final MethodImplementation methodImpl; @Nonnull private final MethodImplementation methodImpl;
private final int paramRegisterCount;
@Nonnull private final ClassPath classPath; @Nonnull private final ClassPath classPath;
@Nullable private final InlineMethodResolver inlineResolver; @Nullable private final InlineMethodResolver inlineResolver;
@ -126,6 +128,7 @@ public class MethodAnalyzer {
buildInstructionList(); buildInstructionList();
analyzedState = new BitSet(analyzedInstructions.size()); analyzedState = new BitSet(analyzedInstructions.size());
paramRegisterCount = MethodUtil.getParameterRegisterCount(method);
analyze(); analyze();
} }
@ -134,7 +137,7 @@ public class MethodAnalyzer {
MethodImplementation methodImpl = this.methodImpl; MethodImplementation methodImpl = this.methodImpl;
int totalRegisters = methodImpl.getRegisterCount(); int totalRegisters = methodImpl.getRegisterCount();
int parameterRegisters = MethodUtil.getParameterRegisterCount(method); int parameterRegisters = paramRegisterCount;
int nonParameterRegisters = totalRegisters - parameterRegisters; int nonParameterRegisters = totalRegisters - parameterRegisters;
@ -290,7 +293,10 @@ public class MethodAnalyzer {
RegisterType.getRegisterType(classPath, parameter)); RegisterType.getRegisterType(classPath, parameter));
} }
} }
}
public int getParamRegisterCount() {
return paramRegisterCount;
} }
public int getInstructionAddress(@Nonnull AnalyzedInstruction instruction) { public int getInstructionAddress(@Nonnull AnalyzedInstruction instruction) {