Exemplo n.º 1
0
 internal void FixupBranch(InstructionList instructions, int branchIndex)
 {
     Debug.Assert(_targetIndex != UnknownIndex);
     instructions.FixupBranch(branchIndex, _targetIndex - branchIndex);
 }
Exemplo n.º 2
0
 public DebugView(InstructionList list)
 {
     _list = list;
 }
Exemplo n.º 3
0
 public void EmitLoadLocalBoxed(int index)
 {
     this.Emit(InstructionList.LoadLocalBoxed(index));
 }
Exemplo n.º 4
0
 public void EmitStoreLocalBoxed(int index)
 {
     this.Emit(InstructionList.StoreLocalBoxed(index));
 }
Exemplo n.º 5
0
 internal void EmitInitializeParameter(int index)
 {
     this.Emit(InstructionList.Parameter(index));
 }
Exemplo n.º 6
0
 public void EmitLoad(object value, Type type)
 {
     unsafe
     {
         if (value != null)
         {
             if (type == null || type.IsValueType)
             {
                 if (!(value is bool))
                 {
                     if (value is int)
                     {
                         int num = (int)value;
                         if (num >= -100 && num <= 100)
                         {
                             if (InstructionList._ints == null)
                             {
                                 InstructionList._ints = new Instruction[201];
                             }
                             num = num - -100;
                             InstructionList instructionList = this;
                             Instruction     instruction     = InstructionList._ints[num];
                             Instruction     instruction1    = instruction;
                             if (instruction == null)
                             {
                                 LoadObjectInstruction loadObjectInstruction = new LoadObjectInstruction(value);
                                 Instruction           instruction2          = loadObjectInstruction;
                                 InstructionList._ints[num] = loadObjectInstruction;
                                 instruction1 = instruction2;
                             }
                             instructionList.Emit(instruction1);
                             return;
                         }
                     }
                 }
                 else
                 {
                     this.EmitLoad((bool)value);
                     return;
                 }
             }
             if (this._objects == null)
             {
                 this._objects = new List <object>();
                 if (InstructionList._loadObjectCached == null)
                 {
                     InstructionList._loadObjectCached = new Instruction[0x100];
                 }
             }
             if (this._objects.Count >= (int)InstructionList._loadObjectCached.Length)
             {
                 this.Emit(new LoadObjectInstruction(value));
                 return;
             }
             else
             {
                 int count = (int)this._objects.Count;
                 this._objects.Add(value);
                 InstructionList instructionList1 = this;
                 Instruction     instruction3     = InstructionList._loadObjectCached[count];
                 Instruction     instruction4     = instruction3;
                 if (instruction3 == null)
                 {
                     LoadCachedObjectInstruction loadCachedObjectInstruction = new LoadCachedObjectInstruction(count);
                     Instruction instruction5 = loadCachedObjectInstruction;
                     InstructionList._loadObjectCached[count] = loadCachedObjectInstruction;
                     instruction4 = instruction5;
                 }
                 instructionList1.Emit(instruction4);
                 return;
             }
         }
         else
         {
             InstructionList instructionList2 = this;
             Instruction     instruction6     = InstructionList._null;
             Instruction     instruction7     = instruction6;
             if (instruction6 == null)
             {
                 LoadObjectInstruction loadObjectInstruction1 = new LoadObjectInstruction(null);
                 instruction7          = loadObjectInstruction1;
                 InstructionList._null = loadObjectInstruction1;
             }
             instructionList2.Emit(instruction7);
             return;
         }
     }
 }
Exemplo n.º 7
0
 public void EmitDynamic(Type type, CallSiteBinder binder)
 {
     this.Emit(InstructionList.CreateDynamicInstruction(type, binder));
 }
Exemplo n.º 8
0
 public void EmitAssignLocalBoxed(int index)
 {
     this.Emit(InstructionList.AssignLocalBoxed(index));
 }
Exemplo n.º 9
0
 public Instruction BoxIfIndexMatches(int index)
 {
     return((index == _index) ? InstructionList.LoadLocalBoxed(index) : null);
 }
Exemplo n.º 10
0
 public Instruction BoxIfIndexMatches(int index)
 {
     return((index == _index) ? InstructionList.InitImmutableRefBox(index) : null);
 }
Exemplo n.º 11
0
 internal void FixupBranch(InstructionList instructions, int branchIndex)
 {
     instructions.FixupBranch(branchIndex, this._targetIndex - branchIndex);
 }