X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fchr%2Fplan%2FPostCommitOp.java;h=5902f958879e30613410c873a301ba3381aeed2b;hp=a43e97d4cfcc1094933e56f93511c1016552c299;hb=91682baa9a8252390f09b80fd724f47e5957b234;hpb=3826e289058a51d09310b7ba1251e959dc0ed3d0 diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/plan/PostCommitOp.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/plan/PostCommitOp.java index a43e97d4c..5902f9588 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/plan/PostCommitOp.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/plan/PostCommitOp.java @@ -32,23 +32,23 @@ public class PostCommitOp extends PlanOp { for(PartnerFact activeFact : planContext.partnerFacts) { if(activeFact.killAfterMatch) { if(activeFact.nextFact == null) - w.jump(activeFact.finishCont); + w.jump(location, activeFact.finishCont); else { CodeWriter iterateAlive = w.createBlock(activeFact.constraint.factType); - w.jump(iterateAlive.getContinuation(), w.apply(location, activeFact.nextFact, activeFact.factVar)); + w.jump(location, iterateAlive.getContinuation(), w.apply(location, activeFact.nextFact, activeFact.factVar)); iterateUntilLiveFactFound(iterateAlive, activeFact); } break; } else if(activeFact.mayBeRemoved) { if(activeFact.nextFact == null) { - w.branchAwayUnless(activeFact.isAlive(location, w), activeFact.finishCont); + w.branchAwayUnless(location, activeFact.isAlive(location, w), activeFact.finishCont); } else { CodeWriter failure = w.createBlock(); CodeWriter iterateAlive = w.createBlock(activeFact.constraint.factType); - w.branchAwayUnless(activeFact.isAlive(location, w), failure.getContinuation()); - failure.jump(iterateAlive.getContinuation(), failure.apply(location, activeFact.nextFact, activeFact.factVar)); + w.branchAwayUnless(location, activeFact.isAlive(location, w), failure.getContinuation()); + failure.jump(location, iterateAlive.getContinuation(), failure.apply(location, activeFact.nextFact, activeFact.factVar)); iterateUntilLiveFactFound(iterateAlive, activeFact); } } @@ -61,10 +61,10 @@ public class PostCommitOp extends PlanOp { CHRConstraint constraint = activeFact.constraint; IVal fact = w.getParameters()[0]; CodeWriter dead = w.createBlock(); - w.branchAwayIf(w.apply(location, NullCheck.INSTANCE.createSpecialization(constraint.factType), fact), activeFact.finishCont); - w.branchAwayUnless(activeFact.isAlive(location, w, fact), dead.getContinuation()); - w.jump(activeFact.continueCont, fact); - dead.jump(initialContinuation, dead.apply(location, activeFact.nextFact, fact)); + w.branchAwayIf(location, w.apply(location, NullCheck.INSTANCE.createSpecialization(constraint.factType), fact), activeFact.finishCont); + w.branchAwayUnless(location, activeFact.isAlive(location, w, fact), dead.getContinuation()); + w.jump(location, activeFact.continueCont, fact); + dead.jump(location, initialContinuation, dead.apply(location, activeFact.nextFact, fact)); } }