@@ -35,10 +35,10 @@ use std::collections::{BTreeMap, BTreeSet, HashMap};
35
35
use std:: fmt:: Write ;
36
36
use std:: mem;
37
37
use 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 ,
42
42
} ;
43
43
use wasmtime_environ:: prelude:: * ;
44
44
use wasmtime_environ:: { EntityIndex , ModuleTranslation , PrimaryMap , ScopeVec , Tunables } ;
@@ -75,7 +75,7 @@ pub struct WasmtimePy {
75
75
imported_interfaces : HashMap < InterfaceId , String > ,
76
76
exported_interfaces : HashMap < InterfaceId , String > ,
77
77
78
- lowerings : PrimaryMap < LoweredIndex , ( TrampolineIndex , TypeFuncIndex , CanonicalOptions ) > ,
78
+ lowerings : PrimaryMap < LoweredIndex , ( TrampolineIndex , TypeFuncIndex , OptionsIndex ) > ,
79
79
resource_trampolines : Vec < ( TrampolineIndex , Trampoline ) > ,
80
80
}
81
81
@@ -551,7 +551,7 @@ struct Instantiator<'a> {
551
551
552
552
struct Lift < ' a > {
553
553
callee : String ,
554
- opts : & ' a CanonicalOptions ,
554
+ opts : OptionsIndex ,
555
555
func : & ' a Function ,
556
556
interface : Option < InterfaceId > ,
557
557
}
@@ -845,7 +845,7 @@ impl<'a> Instantiator<'a> {
845
845
self . bindgen (
846
846
params,
847
847
callee,
848
- & options,
848
+ options,
849
849
func,
850
850
AbiVariant :: GuestImport ,
851
851
"self" ,
@@ -880,14 +880,15 @@ impl<'a> Instantiator<'a> {
880
880
& mut self ,
881
881
params : Vec < String > ,
882
882
callee : String ,
883
- opts : & CanonicalOptions ,
883
+ opts : OptionsIndex ,
884
884
func : & Function ,
885
885
abi : AbiVariant ,
886
886
this : & str ,
887
887
interface : Option < InterfaceId > ,
888
888
at_root : bool ,
889
889
resource_map : Option < & ResourceMap > ,
890
890
) {
891
+ let opts = & self . component . options [ opts] ;
891
892
// Technically it wouldn't be the hardest thing in the world to support
892
893
// other string encodings, but for now the code generator was originally
893
894
// written to support utf-8 so let's just leave it at that for now. In
@@ -1020,7 +1021,7 @@ impl<'a> Instantiator<'a> {
1020
1021
} ;
1021
1022
toplevel. push ( Lift {
1022
1023
callee,
1023
- opts : options,
1024
+ opts : * options,
1024
1025
func,
1025
1026
interface : None ,
1026
1027
} ) ;
@@ -1046,7 +1047,7 @@ impl<'a> Instantiator<'a> {
1046
1047
self . create_resource_fn_map ( func, func_ty, & mut resource_map) ;
1047
1048
lifts. push ( Lift {
1048
1049
callee,
1049
- opts : options,
1050
+ opts : * options,
1050
1051
func,
1051
1052
interface : Some ( id) ,
1052
1053
} ) ;
0 commit comments