public static VMInstance Instance(Module module)
        {
            VMInstance inst;

            if (instances == null)
            {
                instances = new Dictionary <Module, VMInstance>();
            }
            if (!instances.TryGetValue(module, out inst))
            {
                inst = new VMInstance(VMData.Instance(module));
                instances[module] = inst;
                lock (initLock) {
                    if (!initialized.ContainsKey(module))
                    {
                        inst.Initialize();
                        initialized.Add(module, initialized.Count);
                    }
                }
            }
            return(inst);
        }
Ejemplo n.º 2
0
 internal static unsafe void RunInternal(int moduleId, ulong codeAddr, uint key, uint sigId, void *[] typedRefs,
                                         void *retTypedRef)
 {
     VMInstance.Instance(moduleId).Run(codeAddr, key, sigId, typedRefs, retTypedRef);
 }
Ejemplo n.º 3
0
 internal static object RunInternal(int moduleId, ulong codeAddr, uint key, uint sigId, object[] args)
 {
     return(VMInstance.Instance(moduleId).Run(codeAddr, key, sigId, args));
 }
Ejemplo n.º 4
0
        public static unsafe void Run(RuntimeTypeHandle type, uint id, void *[] typedRefs, void *retTypedRef)
        {
            var module = Type.GetTypeFromHandle(type).Module;

            VMInstance.Instance(module).Run(id, typedRefs, retTypedRef);
        }
Ejemplo n.º 5
0
        public static object Run(RuntimeTypeHandle type, uint id, object[] args)
        {
            var module = Type.GetTypeFromHandle(type).Module;

            return(VMInstance.Instance(module).Run(id, args));
        }