示例#1
0
        private void Init(
            StackValue thisPtr,
            int classIndex,
            int functionIndex,
            int returnAddress,
            int functionBlockIndex,
            int callerBlockIndex,
            StackFrameType callerStackFrameType,
            StackFrameType stackFrameType,
            int depth,
            int framePointer,
            int blockIndex,
            List <StackValue> registers,
            int execStateSize)
        {
            Frame = new StackValue[StackFrameSize];

            Frame[AbsoluteIndex.ThisPtr]              = thisPtr;
            Frame[AbsoluteIndex.ClassIndex]           = StackValue.BuildClassIndex(classIndex);
            Frame[AbsoluteIndex.FunctionIndex]        = StackValue.BuildFunctionIndex(functionIndex);
            Frame[AbsoluteIndex.ReturnAddress]        = StackValue.BuildInt(returnAddress);
            Frame[AbsoluteIndex.FunctionBlockIndex]   = StackValue.BuildBlockIndex(functionBlockIndex);
            Frame[AbsoluteIndex.CallerBlockIndex]     = StackValue.BuildBlockIndex(callerBlockIndex);
            Frame[AbsoluteIndex.CallerStackFrameType] = StackValue.BuildFrameType((int)callerStackFrameType);
            Frame[AbsoluteIndex.StackFrameType]       = StackValue.BuildFrameType((int)stackFrameType);
            Frame[AbsoluteIndex.StackFrameDepth]      = StackValue.BuildInt(depth);
            Frame[AbsoluteIndex.LocalVariableCount]   = StackValue.BuildInt(0);
            Frame[AbsoluteIndex.ExecutionStates]      = StackValue.BuildInt(execStateSize);
            Frame[AbsoluteIndex.BlockIndex]           = StackValue.BuildBlockIndex(blockIndex);
            Frame[AbsoluteIndex.RX]           = registers[0];
            Frame[AbsoluteIndex.TX]           = registers[1];
            Frame[AbsoluteIndex.FramePointer] = StackValue.BuildInt(framePointer);
        }