@@ -107,7 +107,6 @@ use crate::{Engine, Module, Val, ValRaw, module::ModuleRegistry};
107107#[ cfg( feature = "gc" ) ]
108108use crate :: { ExnRef , Rooted } ;
109109use crate :: { Global , Instance , Table } ;
110- use alloc:: sync:: Arc ;
111110use core:: convert:: Infallible ;
112111use core:: fmt;
113112use core:: marker;
@@ -116,7 +115,6 @@ use core::num::NonZeroU64;
116115use core:: ops:: { Deref , DerefMut } ;
117116use core:: pin:: Pin ;
118117use core:: ptr:: NonNull ;
119- use wasmtime_environ:: StaticModuleIndex ;
120118use wasmtime_environ:: { DefinedGlobalIndex , DefinedTableIndex , EntityRef , PrimaryMap , TripleExt } ;
121119
122120mod context;
@@ -809,14 +807,10 @@ impl<T> Store<T> {
809807 // single "default callee" for the entire `Store`. This is then used as
810808 // part of `Func::call` to guarantee that the `callee: *mut VMContext`
811809 // is never null.
812- let module = Arc :: new ( wasmtime_environ:: Module :: new ( StaticModuleIndex :: from_u32 (
813- 0 ,
814- ) ) ) ;
815- let shim = ModuleRuntimeInfo :: bare ( module) ;
816810 let allocator = OnDemandInstanceAllocator :: default ( ) ;
817-
811+ let info = engine . empty_module_runtime_info ( ) ;
818812 allocator
819- . validate_module ( shim . env_module ( ) , shim . offsets ( ) )
813+ . validate_module ( info . env_module ( ) , info . offsets ( ) )
820814 . unwrap ( ) ;
821815
822816 unsafe {
@@ -829,7 +823,7 @@ impl<T> Store<T> {
829823 AllocateInstanceKind :: Dummy {
830824 allocator : & allocator,
831825 } ,
832- & shim ,
826+ info ,
833827 Default :: default ( ) ,
834828 ) )
835829 . expect ( "failed to allocate default callee" ) ;
@@ -1934,7 +1928,7 @@ impl StoreOpaque {
19341928 store : & mut StoreOpaque ,
19351929 limiter : Option < & mut StoreResourceLimiter < ' _ > > ,
19361930 ) -> Result < GcStore > {
1937- use wasmtime_environ:: { StaticModuleIndex , packed_option:: ReservedValue } ;
1931+ use wasmtime_environ:: packed_option:: ReservedValue ;
19381932
19391933 let engine = store. engine ( ) ;
19401934 let mem_ty = engine. tunables ( ) . gc_heap_memory_type ( ) ;
@@ -1946,9 +1940,7 @@ impl StoreOpaque {
19461940 // First, allocate the memory that will be our GC heap's storage.
19471941 let mut request = InstanceAllocationRequest {
19481942 id : InstanceId :: reserved_value ( ) ,
1949- runtime_info : & ModuleRuntimeInfo :: bare ( Arc :: new ( wasmtime_environ:: Module :: new (
1950- StaticModuleIndex :: from_u32 ( 0 ) ,
1951- ) ) ) ,
1943+ runtime_info : engine. empty_module_runtime_info ( ) ,
19521944 imports : vm:: Imports :: default ( ) ,
19531945 store,
19541946 limiter,
0 commit comments