private int EnsureLabelIndex(BranchLabel label) { if (label.HasRuntimeLabel) { return label.LabelIndex; } label.LabelIndex = _runtimeLabelCount; _runtimeLabelCount++; return label.LabelIndex; }
public void MarkLabel(BranchLabel label) { label.Mark(this); }
public void EmitGoto(BranchLabel label, bool hasResult, bool hasValue) { Emit(GotoInstruction.Create(EnsureLabelIndex(label), hasResult, hasValue)); }
public BranchLabel MakeLabel() { if (_labels == null) { _labels = new List<BranchLabel>(); } var label = new BranchLabel(); _labels.Add(label); return label; }
public void EmitCoalescingBranch(BranchLabel leftNotNull) { EmitBranch(new CoalescingBranchInstruction(), leftNotNull); }
public void EmitEnterTryFinally(BranchLabel finallyStartLabel) { Emit(EnterTryFinallyInstruction.Create(EnsureLabelIndex(finallyStartLabel))); }
public void EmitBranch(BranchLabel label) { EmitBranch(new BranchInstruction(), label); }
public void EmitBranchFalse(BranchLabel elseLabel) { EmitBranch(new BranchFalseInstruction(), elseLabel); }
public void EmitBranch(BranchLabel label, bool hasResult, bool hasValue) { EmitBranch(new BranchInstruction(hasResult, hasValue), label); }
private void EmitBranch(OffsetInstruction instruction, BranchLabel label) { Emit(instruction); label.AddBranch(this, Count - 1); }
public void EmitLeaveExceptionHandler(bool hasValue, BranchLabel tryExpressionEndLabel) { Emit(LeaveExceptionHandlerInstruction.Create(EnsureLabelIndex(tryExpressionEndLabel), hasValue)); }
public void EmitGoto(BranchLabel label, bool hasResult, bool hasValue) { Emit(new GotoInstruction(Count, hasResult, hasValue)); label.AddBranch(Count - 1); }
public void EmitLeaveExceptionHandler(bool hasValue, BranchLabel startOfFinally) { EmitBranch(new LeaveExceptionHandlerInstruction(hasValue), startOfFinally); }
public void EmitBranchNull(BranchLabel elseLabel) { EmitBranch(new BranchNullInstruction(), elseLabel); }