コード例 #1
0
 public ExecutionEngine(CompiledModel compiledModel, IGCHeap gcHeap, ITypesHeap typesHeap, ITypeLoader typeLoader, ICallStack callStack, IILOperationSet ilOperationSet)
 {
     _compiledModel             = compiledModel;
     _callStack                 = callStack;
     _methodStateMachineFactory = new MethodStateMachineFactory(gcHeap, typesHeap, typeLoader, ilOperationSet);
     FillInterruptionResolvers();
 }
コード例 #2
0
 public MethodStateMachineFactory(IGCHeap gcHeap, ITypesHeap typesHeap, ITypeLoader typeLoader, IILOperationSet ilOperationSet)
 {
     _ilOperationSet = ilOperationSet;
     _gcHeap         = gcHeap;
     _typeLoader     = typeLoader;
     _typesHeap      = typesHeap;
 }
コード例 #3
0
        public static MethodContext CreateForMethod(MethodDesc method, IGCHeap gcHeap, ITypesHeap typesHeap, ITypeLoader typeLoader)
        {
            MethodContext context = new MethodContext();

            context.ReturnsValue = method.ReturnType != null;

            //GC heap
            context.GCHeap = gcHeap;

            //Type loader
            context.TypeLoader = typeLoader;

            //Types heap
            context.TypesHeap = typesHeap;

            //Evaluation stack
            context.EvalStack = new EvalStack(method.MaxStackSize);

            //Prepare local variables
            if (method.LocalVars != null && method.LocalVars.Length != 0)
            {
                context.Locals = new Local[method.LocalVars.Length];
                for (int i = 0; i < method.LocalVars.Length; i++)
                {
                    context.Locals[i] = new Local()
                    {
                        Description = method.LocalVars[i],
                        Val         = null
                    };
                }
            }

            //Prepare arguments
            if (method.Arguments != null && method.Arguments.Length != 0)
            {
                context.Args = new MtdArg[method.Arguments.Length];
                for (int i = 0; i < method.Arguments.Length; i++)
                {
                    context.Args[i] = new MtdArg()
                    {
                        Description = method.Arguments[i],
                        Val         = null
                    };
                }
            }

            return(context);
        }
コード例 #4
0
 public DomainModel(IGCHeapFactory gcHeapFactory, ITypesHeapFactory typesHeapFactory)
 {
     _gcHeap     = gcHeapFactory.Create();
     _typesHeap  = typesHeapFactory.Create();
     _typeLoader = new TypeLoader(_typesHeap);
 }
コード例 #5
0
        public static MethodStateMachine CreateForMethod(MethodDesc methodDescription, IGCHeap gcHeap, ITypesHeap typesHeap, ITypeLoader typeLoader, IILOperationSet operationSet)
        {
            MethodStateMachine execModel = new MethodStateMachine()
            {
                _operationSet = operationSet,
                MethodDesc    = methodDescription,
                Context       = ILTool.Kernel.MethodContext.CreateForMethod(methodDescription, gcHeap, typesHeap, typeLoader),
                State         = new MethodState()
            };

            return(execModel);
        }