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%2Finternal%2Fcodegen%2Fcontinuations%2FContRef.java;h=4ba0d79eebdca50dc448992eb10c0edcef1bab28;hp=898ead272aaba9bdd233900f513a090a6f5a3ff7;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/continuations/ContRef.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/continuations/ContRef.java index 898ead272..4ba0d79ee 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/continuations/ContRef.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/continuations/ContRef.java @@ -1,54 +1,54 @@ -package org.simantics.scl.compiler.internal.codegen.continuations; - -import org.simantics.scl.compiler.internal.codegen.references.Val; -import org.simantics.scl.compiler.internal.codegen.references.ValRef; -import org.simantics.scl.compiler.internal.codegen.ssa.SSAExit; - - -public final class ContRef { - public static final ValRef[] EMPTY_ARRAY = new ValRef[0]; - - Cont binding; - ContRef prev; // FreeVars with the same binding form a linked list - ContRef next; - SSAExit parent; - - ContRef(Cont binding) { - this.binding = binding; - - ContRef head = binding.occurrence; - binding.occurrence = this; - this.next = head; - if(head != null) - head.prev = this; - } - - public void remove() { - if(prev == null) - binding.occurrence = next; - else - prev.next = next; - if(next != null) - next.prev = prev; - } - - public Cont getBinding() { - return binding; - } - - public ContRef getNext() { - return next; - } - - public void setParent(SSAExit parent) { - this.parent = parent; - } - - public Cont addParametersInFront(Val[] newParameters, Val[] oldParameters, Cont proxy) { - return parent.addParametersInFrontOf(this, newParameters, oldParameters, proxy); - } - - public SSAExit getParent() { - return parent; - } -} +package org.simantics.scl.compiler.internal.codegen.continuations; + +import org.simantics.scl.compiler.internal.codegen.references.Val; +import org.simantics.scl.compiler.internal.codegen.references.ValRef; +import org.simantics.scl.compiler.internal.codegen.ssa.SSAExit; + + +public final class ContRef { + public static final ValRef[] EMPTY_ARRAY = new ValRef[0]; + + Cont binding; + ContRef prev; // FreeVars with the same binding form a linked list + ContRef next; + SSAExit parent; + + ContRef(Cont binding) { + this.binding = binding; + + ContRef head = binding.occurrence; + binding.occurrence = this; + this.next = head; + if(head != null) + head.prev = this; + } + + public void remove() { + if(prev == null) + binding.occurrence = next; + else + prev.next = next; + if(next != null) + next.prev = prev; + } + + public Cont getBinding() { + return binding; + } + + public ContRef getNext() { + return next; + } + + public void setParent(SSAExit parent) { + this.parent = parent; + } + + public Cont addParametersInFront(Val[] newParameters, Val[] oldParameters, Cont proxy) { + return parent.addParametersInFrontOf(this, newParameters, oldParameters, proxy); + } + + public SSAExit getParent() { + return parent; + } +}