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%2FIterateConstraintOp.java;h=ddaaebd68d3906313e3e12b81f3d2012f52a771a;hb=refs%2Fchanges%2F34%2F1534%2F3;hp=9a4e6475ec374ad95e1f59735ac0455533f1aceb;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/plan/IterateConstraintOp.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/plan/IterateConstraintOp.java index 9a4e6475e..ddaaebd68 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/plan/IterateConstraintOp.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/plan/IterateConstraintOp.java @@ -12,7 +12,6 @@ import org.simantics.scl.compiler.elaboration.expressions.Variable; import org.simantics.scl.compiler.internal.codegen.continuations.ICont; import org.simantics.scl.compiler.internal.codegen.references.IVal; import org.simantics.scl.compiler.internal.codegen.writer.CodeWriter; -import org.simantics.scl.compiler.types.Types; public class IterateConstraintOp extends PlanOp { @@ -56,35 +55,35 @@ public class IterateConstraintOp extends PlanOp { IVal fact = body.getParameters()[0]; ArrayList parameters = new ArrayList(expressions.length+1); - parameters.add(planContext.storeVar); + parameters.add(planContext.getStoreVar(constraint)); for(int i=0;i>i)&1)==1) - parameters.add(expressions[i].toVal(context.environment, w)); - w.jump(bodyContinuation, w.apply(location, + parameters.add(expressions[i].toVal(context, w)); + 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()); } for(int i=0;i>i)&1)==0) - variables[i].setVal(body.apply(location, constraint.accessComponent(i), fact)); + variables[i].setVal(constraint.accessComponent(location, body, fact, i)); Constant nextElement = constraint.nextElement(context, boundMask); 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); }