I think i see why.

This commit is contained in:
Adam
2016-02-01 16:59:41 -05:00
parent 3faa876ff7
commit 949ce54fb9
3 changed files with 73 additions and 30 deletions

View File

@@ -84,6 +84,8 @@ public class MappingExecutorUtil
while (parallel.step()) while (parallel.step())
{ {
assert e.frames.size() == e2.frames.size();
// get what each frame is paused/exited on // get what each frame is paused/exited on
InstructionContext p1 = parallel.getP1(), p2 = parallel.getP2(); InstructionContext p1 = parallel.getP1(), p2 = parallel.getP2();
@@ -109,6 +111,7 @@ public class MappingExecutorUtil
mi1.map(mappings, p1, p2); mi1.map(mappings, p1, p2);
assert e.frames.size() == e2.frames.size();
e.paused = e2.paused = false; e.paused = e2.paused = false;
} }

View File

@@ -53,7 +53,7 @@ public class Frame
@Override @Override
public String toString() public String toString()
{ {
return "Frame{" + "cur=" + cur + '}'; return "Frame{" + "cur=" + cur + ", last=" + this.lastInstruction() + "}";
} }
public void initialize() public void initialize()
@@ -253,6 +253,11 @@ public class Frame
cur = instructions.get(idx + 1); cur = instructions.get(idx + 1);
} }
private InstructionContext lastInstruction()
{
return instructions.isEmpty() ? null : instructions.get(instructions.size() - 1);
}
private void processExceptions(Instruction i) private void processExceptions(Instruction i)
{ {
if (this.execution.step) if (this.execution.step)

View File

@@ -19,8 +19,16 @@ public class ParallellMappingExecutor
} }
boolean step1 = true, step2 = true; boolean step1 = true, step2 = true;
int count;
public boolean step() public boolean step()
{ {
++count;
if (count == 685)
{
int i = 5;
}
// this no longer holds with recursive stepinfo // this no longer holds with recursive stepinfo
//assert e.frames.size() == e2.frames.size(); //assert e.frames.size() == e2.frames.size();
@@ -47,26 +55,28 @@ public class ParallellMappingExecutor
assert f1.returnTo == null || !e.frames.contains(f1.returnTo); assert f1.returnTo == null || !e.frames.contains(f1.returnTo);
assert f2.returnTo == null || !e2.frames.contains(f2.returnTo); assert f2.returnTo == null || !e2.frames.contains(f2.returnTo);
// I dont know if this is necessary. // Due to jump ob one side can stop while the other side jumps
// if (f1.getInstructions().size() > 0) if (f1.getInstructions().size() > 0)
// { {
// p1 = f1.getInstructions().get(f1.getInstructions().size() - 1); p1 = f1.getInstructions().get(f1.getInstructions().size() - 1);
//
// for (Frame branch : p1.getBranches()) for (Frame branch : p1.getBranches())
// { {
// e.frames.remove(branch); e.frames.remove(branch);
// } }
// } }
//
// if (f2.getInstructions().size() > 0) // this is empty but should be removing a branch, because of the map other, theres no prev instruction.
// { // should always populate prev instruction
// p2 = f2.getInstructions().get(f2.getInstructions().size() - 1); if (f2.getInstructions().size() > 0)
// {
// for (Frame branch : p2.getBranches()) p2 = f2.getInstructions().get(f2.getInstructions().size() - 1);
// {
// e2.frames.remove(branch); for (Frame branch : p2.getBranches())
// } {
// } e2.frames.remove(branch);
}
}
assert e.frames.get(0) == f1; assert e.frames.get(0) == f1;
assert e2.frames.get(0) == f2; assert e2.frames.get(0) == f2;
@@ -96,7 +106,11 @@ public class ParallellMappingExecutor
// assert false; // assert false;
// } // }
Frame f1wtf = e.frames.get(0), f2wtf = e2.frames.get(0); Frame f1wtf = e.frames.get(0),
f2wtf = e2.frames.get(0);
int otherIndex1 = e2.frames.indexOf(f1wtf.other),
otherIndex2 = e.frames.indexOf(f2wtf.other);
// assert f1wtf.other.other == f1wtf; // assert f1wtf.other.other == f1wtf;
// assert f2wtf.other.other == f2wtf; // assert f2wtf.other.other == f2wtf;
@@ -104,11 +118,13 @@ public class ParallellMappingExecutor
assert f1wtf.other == f2wtf; assert f1wtf.other == f2wtf;
assert f2wtf.other == f1wtf; assert f2wtf.other == f1wtf;
step1 = step2 = true;
return step(); return step();
} }
Frame old1 = new Frame(f1), old2 = new Frame(f2); Frame old1 = new Frame(f1), old2 = new Frame(f2);
int s1 = e.frames.size(), s2 = e.frames.size(); int s1 = e.frames.size(), s2 = e2.frames.size();
// step frame // step frame
if (step1) if (step1)
@@ -121,16 +137,25 @@ public class ParallellMappingExecutor
else else
step2 = true; step2 = true;
if (e.frames.size() - s1 != e2.frames.size() - s2)
{
System.out.println("fr mismatch");
}
Frame oldf1 = f1, oldf2 = f2; Frame oldf1 = f1, oldf2 = f2;
f1 = popStack(f1); f1 = popStack(f1);
f2 = popStack(f2); f2 = popStack(f2);
// if (e.frames.size() - s1 != e2.frames.size() - s2)
// {
// System.out.println("fr mismatch");
// }
if (oldf1 != f1 || oldf2 != f2)
{
if (f1 == oldf1)
step1 = false;
if (f2 == oldf2)
step2 = false;
return step();
}
if (oldf1 != f1 || oldf2 != f2) if (oldf1 != f1 || oldf2 != f2)
{ {
// assert oldf1 != f1; // assert oldf1 != f1;
@@ -157,6 +182,11 @@ public class ParallellMappingExecutor
return step(); return step();
} }
if (!(e.frames.size() == e2.frames.size()))
{
int i =56;
}
if (MappingExecutorUtil.isInlineable(p1.getInstruction()) && !MappingExecutorUtil.isInlineable(p2.getInstruction())) if (MappingExecutorUtil.isInlineable(p1.getInstruction()) && !MappingExecutorUtil.isInlineable(p2.getInstruction()))
{ {
f1 = stepInto(f1); f1 = stepInto(f1);
@@ -197,6 +227,11 @@ public class ParallellMappingExecutor
return step(); return step();
} }
if (!(e.frames.size() == e2.frames.size()))
{
int i =56;
}
assert e.paused; assert e.paused;
assert e2.paused; assert e2.paused;
@@ -229,7 +264,7 @@ public class ParallellMappingExecutor
assert methods.size() == 1; assert methods.size() == 1;
Method to = is.getMethods().get(0); Method to = methods.get(0);
Frame f2 = new Frame(e, to); Frame f2 = new Frame(e, to);
f2.initialize(i); f2.initialize(i);
@@ -263,7 +298,7 @@ public class ParallellMappingExecutor
f = popStackForce(f); f = popStackForce(f);
// step return frame // step return frame
f.execute(); //f.execute();
return f; return f;
} }