Fixup rest of unused method stuff. It appears there are some garbage

fields too places.
This commit is contained in:
Adam
2015-06-28 19:32:54 -04:00
parent d9f4d257a5
commit b0f5f33e89
11 changed files with 56 additions and 50 deletions

View File

@@ -29,12 +29,14 @@ public class IllegalStateExceptions
for (ClassFile cf : group.getClasses())
{
for (Method m : new ArrayList<>(cf.getMethods().getMethods()))
for (Method m : cf.getMethods().getMethods())
{
Code c = m.getCode();
if (c == null)
continue;
assert execution.methods.contains(m);
Instructions instructions = c.getInstructions();
instructions.clearBlockGraph();
@@ -63,8 +65,11 @@ public class IllegalStateExceptions
// remove stack of if.
boolean found = false;
boolean foundMethod = false;
for (Frame f : execution.processedFrames)
if (f.getMethod() == m)
{
foundMethod = true;
for (InstructionContext ic : f.getInstructions())
if (ic.getInstruction() == ins) // this is the if
{
@@ -74,6 +79,8 @@ public class IllegalStateExceptions
ic.removeStack(1);
ic.removeStack(0);
}
}
assert foundMethod;
assert found;
// instruction is no longer at 'i' because we've just removed stuff...
@@ -116,6 +123,7 @@ public class IllegalStateExceptions
public void run(ClassGroup group)
{
Execution execution = new Execution(group);
execution.populateInitialMethods();
execution.run();
int count = 0;