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(); }
public MethodStateMachineFactory(IGCHeap gcHeap, ITypesHeap typesHeap, ITypeLoader typeLoader, IILOperationSet ilOperationSet) { _ilOperationSet = ilOperationSet; _gcHeap = gcHeap; _typeLoader = typeLoader; _typesHeap = typesHeap; }
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); }
public DomainModel(IGCHeapFactory gcHeapFactory, ITypesHeapFactory typesHeapFactory) { _gcHeap = gcHeapFactory.Create(); _typesHeap = typesHeapFactory.Create(); _typeLoader = new TypeLoader(_typesHeap); }
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); }