From 4bf810ee7658c9f09791dc52e862875d22bc07aa Mon Sep 17 00:00:00 2001 From: Ben Gruver Date: Sun, 7 Apr 2013 20:32:38 -0700 Subject: [PATCH] Add the parameter register count to the stored state in MethodAnalyzer --- .../main/java/org/jf/dexlib2/analysis/MethodAnalyzer.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dexlib2/src/main/java/org/jf/dexlib2/analysis/MethodAnalyzer.java b/dexlib2/src/main/java/org/jf/dexlib2/analysis/MethodAnalyzer.java index 248488e6..67e2bd59 100644 --- a/dexlib2/src/main/java/org/jf/dexlib2/analysis/MethodAnalyzer.java +++ b/dexlib2/src/main/java/org/jf/dexlib2/analysis/MethodAnalyzer.java @@ -67,6 +67,8 @@ public class MethodAnalyzer { @Nonnull private final Method method; @Nonnull private final MethodImplementation methodImpl; + private final int paramRegisterCount; + @Nonnull private final ClassPath classPath; @Nullable private final InlineMethodResolver inlineResolver; @@ -126,6 +128,7 @@ public class MethodAnalyzer { buildInstructionList(); analyzedState = new BitSet(analyzedInstructions.size()); + paramRegisterCount = MethodUtil.getParameterRegisterCount(method); analyze(); } @@ -134,7 +137,7 @@ public class MethodAnalyzer { MethodImplementation methodImpl = this.methodImpl; int totalRegisters = methodImpl.getRegisterCount(); - int parameterRegisters = MethodUtil.getParameterRegisterCount(method); + int parameterRegisters = paramRegisterCount; int nonParameterRegisters = totalRegisters - parameterRegisters; @@ -290,7 +293,10 @@ public class MethodAnalyzer { RegisterType.getRegisterType(classPath, parameter)); } } + } + public int getParamRegisterCount() { + return paramRegisterCount; } public int getInstructionAddress(@Nonnull AnalyzedInstruction instruction) {