Inheritance: Microsoft.Scripting.Interpreter.Instruction
Example #1
0
        private void AddBranch(OffsetInstruction instruction, Label label) {
            if (_currentStackDepth == -1) {
                return; // this code is unreachable
            }

            AddInstruction(instruction);
            label.NoteStackSize();
            label.SetOffset(instruction);
        }
Example #2
0
 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);
     }
 }
Example #3
0
 public void RemoveBinding(OffsetInstruction instruction) {
     this._offsetInstructions.Remove(instruction);
 }
Example #4
0
 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);
 }
Example #5
0
 private void EmitBranch(OffsetInstruction instruction, BranchLabel label)
 {
     Emit(instruction);
     label.AddBranch(this, Count - 1);
 }
Example #6
0
 private void EmitBranch(OffsetInstruction instruction, BranchLabel label) {
     Emit(instruction);
     label.AddBranch(this, Count - 1);
 }