]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/plan/IterateConstraintOp.java
SCL compiler generates line numbers to bytecode
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / chr / plan / IterateConstraintOp.java
index 035ccd624a134f8942e3d19a8908fca2ddda75a5..ddaaebd68d3906313e3e12b81f3d2012f52a771a 100644 (file)
@@ -59,19 +59,19 @@ public class IterateConstraintOp extends PlanOp {
         for(int i=0;i<expressions.length;++i)
             if(((boundMask>>i)&1)==1)
                 parameters.add(expressions[i].toVal(context, w));
-        w.jump(bodyContinuation, w.apply(location,
+        w.jump(location, bodyContinuation, w.apply(location,
                 constraint.fetchFromIndex(context, boundMask), parameters.toArray(new IVal[parameters.size()])));
 
-        body.branchAwayIf(body.apply(location, NullCheck.INSTANCE.createSpecialization(constraint.factType), fact),
+        body.branchAwayIf(location, body.apply(location, NullCheck.INSTANCE.createSpecialization(constraint.factType), fact),
                 end.getContinuation());
         IVal id = body.apply(location, constraint.accessId, fact);
         for(PartnerFact partnerFact : planContext.partnerFacts)
             if(partnerFact.active && !passive) {
-                body.branchAwayUnless(body.apply(location, JavaComparisonOperation.ILESS, id, partnerFact.id),
+                body.branchAwayUnless(location, body.apply(location, JavaComparisonOperation.ILESS, id, partnerFact.id),
                         nextFact.getContinuation());
             }
             else if(partnerFact.constraint == constraint) {
-                body.branchAwayIf(body.apply(location, JavaComparisonOperation.IEQUAL, id, partnerFact.id),
+                body.branchAwayIf(location, body.apply(location, JavaComparisonOperation.IEQUAL, id, partnerFact.id),
                         nextFact.getContinuation());
             }
 
@@ -82,8 +82,8 @@ public class IterateConstraintOp extends PlanOp {
         planContext.partnerFacts.add(new PartnerFact(false, id, constraint, fact, constraint.mayBeRemoved(), killAfterMatch, nextElement, bodyContinuation, end.getContinuation()));
         planContext.nextOp(body);
         if(body.isUnfinished()) 
-            body.jump(nextFact.getContinuation());
-        nextFact.jump(bodyContinuation, nextFact.apply(location, nextElement, fact));
+            body.jump(location, nextFact.getContinuation());
+        nextFact.jump(location, bodyContinuation, nextFact.apply(location, nextElement, fact));
 
         w.continueAs(end);
     }