/// <summary> /// Advances the current integrated instruction to the next. EndOfIIStream is the IROP flag for end of instructions for this prototype. /// </summary> public void NextII() { prevII = curII; bIndex++; if (bIndex >= curBlock.iis.Count) //advance to next block if necessary. { if (curBlock.GetNameIndex() + 1 >= blocks.Count) //no more instructions. { //IntegratedInstruction end = new IntegratedInstruction(IRMap.EndOfIIStream, OpCodes.RET0, -1, 0, 0, 0); //basically a flag instruction IntegratedInstruction end = new IntegratedInstruction(IRMap.EndOfIIStream, new BytecodeInstruction(OpCodes.RET0, -2)); //basically a flag instruction curII = end; } else { curBlock = blocks[curBlock.GetNameIndex() + 1]; bIndex = 0; curII = curBlock.iis[bIndex]; } } if (curII != null && curII.iROp == IRMap.EndOfIIStream) { return; } curII = curBlock.iis[bIndex]; regs = curII.bci.regs; }
/// <summary> /// Contains an IRMap translated opcode and the registers at execution time for a particular bytecode instruction. /// </summary> /// <param name="iROp"></param> /// <param name="originalOp"></param> /// <param name="originalIndex">Index of original instruction.</param> /// <param name="regA"></param> /// <param name="regB"></param> /// <param name="regC"></param> public IntegratedInstruction(IRMap iROp, BytecodeInstruction bci) { this.bci = bci; this.iROp = iROp; registers = bci.regs; originalOp = bci.opcode; originalIndex = bci.index; }