@@ -331,6 +331,8 @@ wasmtime_option_group! {
331
331
pub trap_on_grow_failure: Option <bool >,
332
332
/// Maximum execution time of wasm code before timing out (1, 2s, 100ms, etc)
333
333
pub timeout: Option <Duration >,
334
+ /// Size of stacks created with cont.new instructions
335
+ pub stack_switching_stack_size: Option <usize >,
334
336
/// Configures support for all WebAssembly proposals implemented.
335
337
pub all_proposals: Option <bool >,
336
338
/// Configure support for the bulk memory proposal.
@@ -366,6 +368,8 @@ wasmtime_option_group! {
366
368
pub component_model_async: Option <bool >,
367
369
/// Configure support for the function-references proposal.
368
370
pub function_references: Option <bool >,
371
+ /// Configure support for the stack-switching proposal.
372
+ pub stack_switching: Option <bool >,
369
373
/// Configure support for the GC proposal.
370
374
pub gc: Option <bool >,
371
375
/// Configure support for the custom-page-sizes proposal.
@@ -801,6 +805,12 @@ impl CommonOptions {
801
805
config. native_unwind_info ( enable) ;
802
806
}
803
807
808
+ match_feature ! {
809
+ [ "stack-switching" : self . wasm. stack_switching_stack_size]
810
+ size => config. stack_switching_stack_size( size) ,
811
+ _ => err,
812
+ }
813
+
804
814
match_feature ! {
805
815
[ "pooling-allocator" : self . opts. pooling_allocator. or( pooling_allocator_default) ]
806
816
enable => {
@@ -962,6 +972,9 @@ impl CommonOptions {
962
972
if let Some ( enable) = self . wasm . memory64 . or ( all) {
963
973
config. wasm_memory64 ( enable) ;
964
974
}
975
+ if let Some ( enable) = self . wasm . stack_switching {
976
+ config. wasm_stack_switching ( enable) ;
977
+ }
965
978
if let Some ( enable) = self . wasm . custom_page_sizes . or ( all) {
966
979
config. wasm_custom_page_sizes ( enable) ;
967
980
}
@@ -992,6 +1005,10 @@ impl CommonOptions {
992
1005
( "gc" , gc, wasm_gc)
993
1006
( "gc" , reference_types, wasm_reference_types)
994
1007
( "gc" , function_references, wasm_function_references)
1008
+ // FIXME(frank-emrich): If function-references depends on the gc
1009
+ // feature, and stack-switching requires function-references, that
1010
+ // probably means that stack-switching should depend on gc.
1011
+ ( "stack-switching" , stack_switching, wasm_stack_switching)
995
1012
}
996
1013
Ok ( ( ) )
997
1014
}
0 commit comments