Пример #1
0
        public VMLocalVariableBlock Duplicate(ThreadState oldState, ThreadState newState)
        {
            VMLocalVariableBlock ret = new VMLocalVariableBlock();
            ret.threadState = newState;

            for(int i = 0; i < variables.Count; i++)
                ret.variables.Add(variables[i]);

            for(int i = 0; i < arguments.Count; i++)
                ret.arguments.Add(arguments[i]);

            return ret;
        }
Пример #2
0
        public CILInstruction CallFunction(CILMethod theMethod)
        {
            ReturnAddress ra = new ReturnAddress(currentMethod, pc);
            returnAddresses.Push(ra);

            VMLocalVariableBlock vBlock = new VMLocalVariableBlock(this, theMethod);
            localVariableBlocks.Push(vBlock);
            // The first argument is the object itself
            for(int i = -1; i < theMethod.ParameterCount; i++)
                vBlock.AddArgumentFront(GetValue(threadStack.Pop()));
            currentMethod = theMethod;

            return theMethod.GetFirstInstruction();
        }