@@ -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,10 @@ 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 exceptions proposal.
372+ pub exceptions: Option <bool >,
373+ /// Configure support for the stack-switching proposal.
374+ pub stack_switching: Option <bool >,
369375 /// Configure support for the GC proposal.
370376 pub gc: Option <bool >,
371377 /// Configure support for the custom-page-sizes proposal.
@@ -801,6 +807,12 @@ impl CommonOptions {
801807 config. native_unwind_info ( enable) ;
802808 }
803809
810+ match_feature ! {
811+ [ "stack-switching" : self . wasm. stack_switching_stack_size]
812+ size => config. stack_switching_stack_size( size) ,
813+ _ => err,
814+ }
815+
804816 match_feature ! {
805817 [ "pooling-allocator" : self . opts. pooling_allocator. or( pooling_allocator_default) ]
806818 enable => {
@@ -962,6 +974,12 @@ impl CommonOptions {
962974 if let Some ( enable) = self . wasm . memory64 . or ( all) {
963975 config. wasm_memory64 ( enable) ;
964976 }
977+ if let Some ( enable) = self . wasm . exceptions {
978+ config. wasm_exceptions ( enable) ;
979+ }
980+ if let Some ( enable) = self . wasm . stack_switching {
981+ config. wasm_stack_switching ( enable) ;
982+ }
965983 if let Some ( enable) = self . wasm . custom_page_sizes . or ( all) {
966984 config. wasm_custom_page_sizes ( enable) ;
967985 }
@@ -992,6 +1010,10 @@ impl CommonOptions {
9921010 ( "gc" , gc, wasm_gc)
9931011 ( "gc" , reference_types, wasm_reference_types)
9941012 ( "gc" , function_references, wasm_function_references)
1013+ // FIXME(frank-emrich): If function-references depends on the gc
1014+ // feature, and stack-switching requires function-references, that
1015+ // probably means that stack-switching should depend on gc.
1016+ ( "stack-switching" , stack_switching, wasm_stack_switching)
9951017 }
9961018 Ok ( ( ) )
9971019 }
0 commit comments