@@ -331,6 +331,8 @@ wasmtime_option_group! {
331331 pub trap_on_grow_failure: Option <bool >,
332332 /// Maximum execution time of wasm code before timing out (1, 2s, 100ms, etc)
333333 pub timeout: Option <Duration >,
334+ /// Size of stacks created with cont.new instructions
335+ pub stack_switching_stack_size: Option <usize >,
334336 /// Configures support for all WebAssembly proposals implemented.
335337 pub all_proposals: Option <bool >,
336338 /// Configure support for the bulk memory proposal.
@@ -366,6 +368,8 @@ wasmtime_option_group! {
366368 pub component_model_async: Option <bool >,
367369 /// Configure support for the function-references proposal.
368370 pub function_references: Option <bool >,
371+ /// Configure support for the stack-switching proposal.
372+ pub stack_switching: Option <bool >,
369373 /// Configure support for the GC proposal.
370374 pub gc: Option <bool >,
371375 /// Configure support for the custom-page-sizes proposal.
@@ -801,6 +805,12 @@ impl CommonOptions {
801805 config. native_unwind_info ( enable) ;
802806 }
803807
808+ match_feature ! {
809+ [ "stack-switching" : self . wasm. stack_switching_stack_size]
810+ size => config. stack_switching_stack_size( size) ,
811+ _ => err,
812+ }
813+
804814 match_feature ! {
805815 [ "pooling-allocator" : self . opts. pooling_allocator. or( pooling_allocator_default) ]
806816 enable => {
@@ -962,6 +972,9 @@ impl CommonOptions {
962972 if let Some ( enable) = self . wasm . memory64 . or ( all) {
963973 config. wasm_memory64 ( enable) ;
964974 }
975+ if let Some ( enable) = self . wasm . stack_switching {
976+ config. wasm_stack_switching ( enable) ;
977+ }
965978 if let Some ( enable) = self . wasm . custom_page_sizes . or ( all) {
966979 config. wasm_custom_page_sizes ( enable) ;
967980 }
@@ -992,6 +1005,10 @@ impl CommonOptions {
9921005 ( "gc" , gc, wasm_gc)
9931006 ( "gc" , reference_types, wasm_reference_types)
9941007 ( "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)
9951012 }
9961013 Ok ( ( ) )
9971014 }
0 commit comments