Esempio n. 1
0
 internal InstructionList ParseInstructions(){
   this.ParseHeader();
   if (this.size == 0) return new InstructionList(0);
   InstructionList result = new InstructionList();
   result.Add(new Instruction(OpCode._Locals, 0, this.locals));
   while (this.counter <= size){
     SortedDictionary<int,InstructionList> instructionPriority = (SortedDictionary<int,InstructionList>)this.ehMap[this.counter+1];
     if (instructionPriority != null) {
       foreach(InstructionList instructions in instructionPriority.Values)
         for (int i = 0; i < instructions.Count; i++)
           result.Add(instructions[i]);
     }
     if (this.counter < size)
       result.Add(this.ParseInstruction());
     else 
       break;
   }
   return result;    
 }
Esempio n. 2
0
 internal InstructionList ParseInstructions(){
   this.ParseHeader();
   if (this.size == 0) return new InstructionList(0);
   InstructionList result = new InstructionList();
   result.Add(new Instruction(OpCode._Locals, 0, this.locals));
   while (this.counter <= size){
     InstructionList instructions = (InstructionList)this.ehMap[this.counter+1];
     if (instructions != null){
       for (int i = 0; i < instructions.Count; i++)
         result.Add(instructions[i]);
     }
     if (this.counter < size)
       result.Add(this.ParseInstruction());
     else 
       break;
   }
   return result;    
 }
Esempio n. 3
0
    private Instruction AddInstruction(OpCode opCode, int offset, object value, int priority){
      Instruction instruction = new Instruction(opCode, offset, value);
      SortedDictionary<int,InstructionList> instructionPriority = (SortedDictionary<int,InstructionList>)this.ehMap[offset+1];
      if (instructionPriority == null) this.ehMap[offset+1] = instructionPriority = new SortedDictionary<int,InstructionList>();
      InstructionList instructions;
      if (!instructionPriority.TryGetValue(priority, out instructions)) {
         instructions = new InstructionList(2);
         instructionPriority.Add(priority, instructions);
      }
      instructions.Add(instruction);
#if !ROTOR
      if (this.method.contextForOffset != null){
        object sctx = this.method.contextForOffset[offset + 1];
        if (sctx != null) instruction.SourceContext = (SourceContext)sctx;
      }
#endif
      return instruction;
    }
Esempio n. 4
0
    private Instruction AddInstruction(OpCode opCode, int offset, object value){
      Instruction instruction = new Instruction(opCode, offset, value);
      InstructionList instructions = (InstructionList)this.ehMap[offset+1];
      if (instructions == null) this.ehMap[offset+1] = instructions = new InstructionList(2);
      instructions.Add(instruction);
#if !ROTOR
      if (this.method.contextForOffset != null){
        object sctx = this.method.contextForOffset[offset + 1];
        if (sctx != null) instruction.SourceContext = (SourceContext)sctx;
      }
#endif
      return instruction;
    }