X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fchr%2Fplan%2FPlanContext.java;h=62bcfc9581fd9650c4d869c4c0a7b759e423de2a;hb=refs%2Fchanges%2F34%2F1534%2F3;hp=bc6b7da580e3b43a5e43bbf3b646fb1902ee01e7;hpb=78f577368ba4c71ad6fb3d9f16c03c634585cf7b;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/plan/PlanContext.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/plan/PlanContext.java index bc6b7da58..62bcfc958 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/plan/PlanContext.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/plan/PlanContext.java @@ -40,7 +40,7 @@ public abstract class PlanContext { public IVal generateNewId(long location, CodeWriter w) { if(currentId == null) - currentId = w.apply(location, ruleset.readCurrentId, contextVar); + currentId = w.apply(location, CHRRuleset.READ_CURRENT_ID, contextVar); IVal result = currentId; currentId = w.apply(location, IncreaseByOne.INSTANCE, currentId); return result; @@ -54,15 +54,15 @@ public abstract class PlanContext { ICont bodyContinuation = body.getContinuation(); CodeWriter end = w.createBlock(); - w.jump(body.getContinuation(), IntegerConstant.ZERO); + w.jump(location, body.getContinuation(), IntegerConstant.ZERO); IVal index = body.getParameters()[0]; - body.branchAwayIf(body.apply(location, JavaComparisonOperation.IEQUAL, index, listLength), + body.branchAwayIf(location, body.apply(location, JavaComparisonOperation.IEQUAL, index, listLength), end.getContinuation()); variable.setVal(body.apply(location, ListElement.INSTANCE.createSpecialization(componentType), listValue, index)); nextOp(body); if(body.isUnfinished()) - body.jump(bodyContinuation, body.apply(location, IncreaseByOne.INSTANCE, index)); + body.jump(location, bodyContinuation, body.apply(location, IncreaseByOne.INSTANCE, index)); w.continueAs(end); } @@ -72,7 +72,7 @@ public abstract class PlanContext { CodeWriter end = w.createBlock(); CodeWriter body = w.createBlock(componentType); - w.switch_(maybeValue, new Branch[] { + w.switch_(location, maybeValue, new Branch[] { new Branch(JustConstant.INSTANCE, body.getContinuation()), new Branch(null, end.getContinuation()) }); @@ -80,17 +80,17 @@ public abstract class PlanContext { variable.setVal(body.getParameters()[0]); nextOp(body); if(body.isUnfinished()) - body.jump(end.getContinuation()); + body.jump(location, end.getContinuation()); w.continueAs(end); } public void check(long location, CodeWriter w, IVal booleanValue) { CodeWriter end = w.createBlock(); - w.branchAwayUnless(booleanValue, end.getContinuation()); + w.branchAwayUnless(location, booleanValue, end.getContinuation()); nextOp(w); if(w.isUnfinished()) - w.jump(end.getContinuation()); + w.jump(location, end.getContinuation()); w.continueAs(end); } @@ -105,16 +105,16 @@ public abstract class PlanContext { CodeWriter end = w.createBlock(); CodeWriter body = w.createBlock(componentType); - w.switch_(maybeValue, new Branch[] { + w.switch_(location, maybeValue, new Branch[] { new Branch(JustConstant.INSTANCE, body.getContinuation()), new Branch(null, end.getContinuation()) }); - body.branchAwayUnless(body.apply(location, + body.branchAwayUnless(location, body.apply(location, EqualsFunction.INSTANCE.createSpecialization(componentType), value, body.getParameters()[0]), end.getContinuation()); nextOp(body); if(body.isUnfinished()) - body.jump(end.getContinuation()); + body.jump(location, end.getContinuation()); w.continueAs(end); }