]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/plan/PostCommitOp.java
SCL compiler generates line numbers to bytecode
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / chr / plan / PostCommitOp.java
index a43e97d4cfcc1094933e56f93511c1016552c299..5902f958879e30613410c873a301ba3381aeed2b 100644 (file)
@@ -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));
     }
 
 }