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);
        }
 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);
 }
 internal static object RunInternal(int moduleId, ulong codeAddr, uint key, uint sigId, object[] args)
 {
     return(VMInstance.Instance(moduleId).Run(codeAddr, key, sigId, args));
 }
        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);
        }
        public static object Run(RuntimeTypeHandle type, uint id, object[] args)
        {
            var module = Type.GetTypeFromHandle(type).Module;

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