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

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