Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Wasmtime: enable exception-handling by default. (#13603)

Chris Fallin252d836e7b26
diff --git a/crates/wasmtime/src/config.rs b/crates/wasmtime/src/config.rs
index d345637a28..2e95e2d808 100644
--- a/crates/wasmtime/src/config.rs
+++ b/crates/wasmtime/src/config.rs
@@ -1336,6 +1336,8 @@ impl Config {
/// Configures whether the [Exception-handling proposal][proposal] is enabled or not.
///
+ /// This is `true` by default.
+ ///
/// [proposal]: https://github.com/WebAssembly/exception-handling
#[cfg(feature = "gc")]
pub fn wasm_exceptions(&mut self, enable: bool) -> &mut Self {
@@ -2443,6 +2445,9 @@ impl Config {
// Set some features to their conditionally-enabled defaults depending
// on crate compile-time features.
features.set(WasmFeatures::GC_TYPES, cfg!(feature = "gc"));
+ // Exception handling requires the `gc` build-time feature for runtime
+ // support.
+ features.set(WasmFeatures::EXCEPTIONS, cfg!(feature = "gc"));
features.set(WasmFeatures::THREADS, cfg!(feature = "threads"));
features.set(
WasmFeatures::COMPONENT_MODEL,
diff --git a/docs/stability-tiers.md b/docs/stability-tiers.md
index b64c2a220f..660cdbb590 100644
--- a/docs/stability-tiers.md
+++ b/docs/stability-tiers.md
@@ -42,6 +42,7 @@ For explanations of what each tier means see below.
| WebAssembly Proposal | [`memory64`] |
| WebAssembly Proposal | [`function-references`] |
| WebAssembly Proposal | [`gc`] |
+| WebAssembly Proposal | [`exception-handling`] |
| WASI Proposal | [`wasi-io`] |
| WASI Proposal | [`wasi-clocks`] |
| WASI Proposal | [`wasi-filesystem`] |
@@ -71,6 +72,7 @@ For explanations of what each tier means see below.
[`wasi-sockets`]: https://github.com/WebAssembly/wasi-sockets
[`wasi-http`]: https://github.com/WebAssembly/wasi-http
[`tail-call`]: https://github.com/WebAssembly/tail-call/blob/main/proposals/tail-call/Overview.md
+[`exception-handling`]: https://github.com/WebAssembly/exception-handling
[^support]: Compiler support is further broken down [below](#compiler-support)
into finer-grained target/wasm proposal combinations. Compilers are not
@@ -86,7 +88,6 @@ For explanations of what each tier means see below.
| Target | `x86_64-pc-windows-gnu` | Clear owner of the target |
| Target | Support for `#![no_std]` | Support beyond CI checks |
| WebAssembly Proposal | [`custom-page-sizes`] | Unstable wasm proposal |
-| WebAssembly Proposal | [`exception-handling`] | fuzzing, dependence on GC |
| WebAssembly Proposal | [`threads`] | fuzzing, API quality |
| WebAssembly Proposal | [`wide-arithmetic`] | Unstable wasm proposal |
| Execution Backend | Pulley | More time fuzzing/baking |
@@ -98,7 +99,6 @@ For explanations of what each tier means see below.
[`component-model`]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/Explainer.md
[`relaxed-simd`]: https://github.com/WebAssembly/relaxed-simd/blob/main/proposals/relaxed-simd/Overview.md
[`wide-arithmetic`]: https://github.com/WebAssembly/wide-arithmetic/blob/main/proposals/wide-arithmetic/Overview.md
-[`exception-handling`]: https://github.com/WebAssembly/exception-handling
[`stack-switching`]: https://github.com/WebAssembly/stack-switching
#### Tier 3
diff --git a/docs/stability-wasm-proposals.md b/docs/stability-wasm-proposals.md
index 17c46bb5fe..0707708dcb 100644
--- a/docs/stability-wasm-proposals.md
+++ b/docs/stability-wasm-proposals.md
@@ -34,6 +34,7 @@ The emoji legend is:
| [`memory64`] | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [`function-references`] | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [`gc`] | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
+| [`exception-handling`] | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
[^1]: The `component-model` proposal is not at phase 4 in the standardization
process but it is still enabled-by-default in Wasmtime.
@@ -49,7 +50,6 @@ The emoji legend is:
| Proposal | Phase 4 | Tests | Finished | Fuzzed | API | C API |
|--------------------------|---------|-------|----------|--------|-----|--------|
| [`custom-page-sizes`] | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
-| [`exception-handling`] | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [`threads`] | ✅ | ✅ | 🚧[^8] | ❌[^4] | ✅ | ✅ |
| [`wide-arithmetic`] | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |