@@ -35,10 +35,10 @@ use std::collections::{BTreeMap, BTreeSet, HashMap};
3535use std:: fmt:: Write ;
3636use std:: mem;
3737use wasmtime_environ:: component:: {
38- CanonicalOptions , CanonicalOptionsDataModel , Component , ComponentTypes , ComponentTypesBuilder ,
39- CoreDef , CoreExport , Export , ExportItem , GlobalInitializer , InstantiateModule , InterfaceType ,
40- LoweredIndex , RuntimeImportIndex , RuntimeInstanceIndex , StaticModuleIndex , StringEncoding ,
41- Trampoline , TrampolineIndex , Translator , TypeFuncIndex , TypeResourceTableIndex ,
38+ CanonicalOptionsDataModel , Component , ComponentTypes , ComponentTypesBuilder , CoreDef ,
39+ CoreExport , Export , ExportItem , GlobalInitializer , InstantiateModule , InterfaceType ,
40+ LoweredIndex , OptionsIndex , RuntimeImportIndex , RuntimeInstanceIndex , StaticModuleIndex ,
41+ StringEncoding , Trampoline , TrampolineIndex , Translator , TypeFuncIndex , TypeResourceTableIndex ,
4242} ;
4343use wasmtime_environ:: prelude:: * ;
4444use wasmtime_environ:: { EntityIndex , ModuleTranslation , PrimaryMap , ScopeVec , Tunables } ;
@@ -75,7 +75,7 @@ pub struct WasmtimePy {
7575 imported_interfaces : HashMap < InterfaceId , String > ,
7676 exported_interfaces : HashMap < InterfaceId , String > ,
7777
78- lowerings : PrimaryMap < LoweredIndex , ( TrampolineIndex , TypeFuncIndex , CanonicalOptions ) > ,
78+ lowerings : PrimaryMap < LoweredIndex , ( TrampolineIndex , TypeFuncIndex , OptionsIndex ) > ,
7979 resource_trampolines : Vec < ( TrampolineIndex , Trampoline ) > ,
8080}
8181
@@ -551,7 +551,7 @@ struct Instantiator<'a> {
551551
552552struct Lift < ' a > {
553553 callee : String ,
554- opts : & ' a CanonicalOptions ,
554+ opts : OptionsIndex ,
555555 func : & ' a Function ,
556556 interface : Option < InterfaceId > ,
557557}
@@ -845,7 +845,7 @@ impl<'a> Instantiator<'a> {
845845 self . bindgen (
846846 params,
847847 callee,
848- & options,
848+ options,
849849 func,
850850 AbiVariant :: GuestImport ,
851851 "self" ,
@@ -880,14 +880,15 @@ impl<'a> Instantiator<'a> {
880880 & mut self ,
881881 params : Vec < String > ,
882882 callee : String ,
883- opts : & CanonicalOptions ,
883+ opts : OptionsIndex ,
884884 func : & Function ,
885885 abi : AbiVariant ,
886886 this : & str ,
887887 interface : Option < InterfaceId > ,
888888 at_root : bool ,
889889 resource_map : Option < & ResourceMap > ,
890890 ) {
891+ let opts = & self . component . options [ opts] ;
891892 // Technically it wouldn't be the hardest thing in the world to support
892893 // other string encodings, but for now the code generator was originally
893894 // written to support utf-8 so let's just leave it at that for now. In
@@ -1020,7 +1021,7 @@ impl<'a> Instantiator<'a> {
10201021 } ;
10211022 toplevel. push ( Lift {
10221023 callee,
1023- opts : options,
1024+ opts : * options,
10241025 func,
10251026 interface : None ,
10261027 } ) ;
@@ -1046,7 +1047,7 @@ impl<'a> Instantiator<'a> {
10461047 self . create_resource_fn_map ( func, func_ty, & mut resource_map) ;
10471048 lifts. push ( Lift {
10481049 callee,
1049- opts : options,
1050+ opts : * options,
10501051 func,
10511052 interface : Some ( id) ,
10521053 } ) ;
0 commit comments