示例#1
0
        private int AddCondition(Instruction jumpInstruction, int currentIndex, Context.StackFrame frame)
        {
            int jumpIndex = Array.BinarySearch(offsets, jumpInstruction.Offset);

            Debug.Assert(jumpIndex >= 0);

            var instructionFrame = frames[jumpIndex];

            if (instructionFrame != null)
            {
                frames[jumpIndex] = StackFrame.Merge(instructionFrame, frame);
            }
            else
            {
                frames[jumpIndex] = frame;
            }

            if (jumpIndex < currentIndex && !backwardInterpretedJumps[currentIndex])
            {
                backwardInterpretedJumps[currentIndex] = true;
                return(jumpIndex);
            }

            return(0);
        }
示例#2
0
        private void UpdateContext(int index)
        {
            var frame = frames[index];

            if (frame == null)
            {
                return;
            }

            Debug.Assert(frame != null);
            context.Frame = context.Frame != null
                ? StackFrame.Merge(context.Frame, frame)
                : frame;

            context.SkipMode = false;
            frames[index]    = null;
        }