private void AddBranch(OffsetInstruction instruction, Label label) { if (_currentStackDepth == -1) { return; // this code is unreachable } AddInstruction(instruction); label.NoteStackSize(); label.SetOffset(instruction); }
public void SetOffset(OffsetInstruction instruction) { //TODO some work here to verify expectedStackSize if (_index == -1) { this._offsetInstructions.Add(instruction); } else { int index = _compiler._instructions.IndexOf(instruction); int offset = _index - index; instruction.SetOffset(offset); } }
public void RemoveBinding(OffsetInstruction instruction) { this._offsetInstructions.Remove(instruction); }
public void AddBranch(OffsetInstruction instruction, Label label, bool hasValue) { List<OffsetInstruction> branches; if (!labels.TryGetValue(label, out branches)) { branches = new List<OffsetInstruction>(); labels[label] = branches; labelHasValue[label] = hasValue; } Debug.Assert(labelHasValue[label] == hasValue); branches.Add(instruction); }
private void EmitBranch(OffsetInstruction instruction, BranchLabel label) { Emit(instruction); label.AddBranch(this, Count - 1); }