Repository: bytecodealliance/wasmtime
Pull request #8805 (2024-06-14 15:05:17)

Update the spec test suite submodule
* Ignore the `memory64` tests since Wasmtime doesn't implement the table64 extension yet.
* Ignore `gc/i31.wast` as it's got new tests which Wasmtime doesn't currently pass.

<!--
Please make sure you include the following information:

- If this work has been discussed elsewhere, please include a link to that
  conversation. If it was discussed in an issue, just mention "issue #...".

- Explain why this change is needed. If the details are in an issue already,
  this can be brief.

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->



Patch:
diff --git a/crates/cranelift/src/compiler.rs b/crates/cranelift/src/compiler.rs
index a4ed9a0c4..bb44575bd 100644
--- a/crates/cranelift/src/compiler.rs
+++ b/crates/cranelift/src/compiler.rs
@@ -193,9 +193,7 @@ impl wasmtime_environ::Compiler for Compiler {
             .create_global_value(ir::GlobalValueData::VMContext);
         let interrupts_ptr = context.func.create_global_value(ir::GlobalValueData::Load {
             base: vmctx,
-            offset: i32::try_from(func_env.offsets.vmctx_runtime_limits())
-                .unwrap()
-                .into(),
+            offset: i32::from(func_env.offsets.ptr.vmctx_runtime_limits()).into(),
             global_type: isa.pointer_type(),
             flags: MemFlags::trusted().with_readonly(),
         });
@@ -282,12 +280,12 @@ impl wasmtime_environ::Compiler for Compiler {
         // what we are assuming with our offsets below.
         debug_assert_vmctx_kind(isa, &mut builder, vmctx, wasmtime_environ::VMCONTEXT_MAGIC);
         let offsets = VMOffsets::new(isa.pointer_bytes(), &translation.module);
-        let vm_runtime_limits_offset = offsets.vmctx_runtime_limits();
+        let vm_runtime_limits_offset = offsets.ptr.vmctx_runtime_limits();
         save_last_wasm_entry_sp(
             &mut builder,
             pointer_type,
             &offsets.ptr,
-            vm_runtime_limits_offset,
+            vm_runtime_limits_offset.into(),
             vmctx,
         );
 
diff --git a/crates/cranelift/src/func_environ.rs b/crates/cranelift/src/func_environ.rs
index 8adf82454..0dbffa4b4 100644
--- a/crates/cranelift/src/func_environ.rs
+++ b/crates/cranelift/src/func_environ.rs
@@ -287,7 +287,7 @@ impl<'module_environment> FuncEnvironment<'module_environment> {
         let pointer_type = self.pointer_type();
         let vmctx = self.vmctx(builder.func);
         let base = builder.ins().global_value(pointer_type, vmctx);
-        let offset = i32::try_from(self.offsets.vmctx_runtime_limits()).unwrap();
+        let offset = i32::from(self.offsets.ptr.vmctx_runtime_limits());
         debug_assert!(self.vmruntime_limits_ptr.is_reserved_value());
         self.vmruntime_limits_ptr =
             builder
@@ -580,7 +580,7 @@ impl<'module_environment> FuncEnvironment<'module_environment> {
         let vmctx = self.vmctx(builder.func);
         let pointer_type = self.pointer_type();
         let base = builder.ins().global_value(pointer_type, vmctx);
-        let offset = i32::try_from(self.offsets.vmctx_epoch_ptr()).unwrap();
+        let offset = i32::try_from(self.offsets.ptr.vmctx_epoch_ptr()).unwrap();
         let epoch_ptr = builder
             .ins()
             .load(pointer_type, ir::MemFlags::trusted(), base, offset);
@@ -1518,7 +1518,7 @@ impl<'a, 'func, 'module_env> Call<'a, 'func, 'module_env> {
             pointer_type,
             mem_flags,
             base,
-            i32::try_from(self.env.offsets.vmctx_type_ids_array()).unwrap(),
+            i32::from(self.env.offsets.ptr.vmctx_type_ids_array()),
         );
         let sig_index = self.env.module.types[ty_index];
         let offset =
diff --git a/crates/cranelift/src/gc/enabled.rs b/crates/cranelift/src/gc/enabled.rs
index 00aefbb1e..e610e57a2 100644
--- a/crates/cranelift/src/gc/enabled.rs
+++ b/crates/cranelift/src/gc/enabled.rs
@@ -5,7 +5,7 @@ use cranelift_frontend::FunctionBuilder;
 use cranelift_wasm::{
     TargetEnvironment, WasmHeapTopType, WasmHeapType, WasmRefType, WasmResult, WasmValType,
 };
-use wasmtime_environ::{I31_DISCRIMINANT, NON_NULL_NON_I31_MASK};
+use wasmtime_environ::{PtrSize, I31_DISCRIMINANT, NON_NULL_NON_I31_MASK};
 
 /// Get the default GC compiler.
 pub fn gc_compiler(_func_env: &FuncEnvironment<'_>) -> Box<dyn GcCompiler> {
@@ -97,11 +97,11 @@ impl FuncEnvironment<'_> {
         let vmctx = self.vmctx(builder.func);
         let vmctx = builder.ins().global_value(ptr_ty, vmctx);
 
-        let base_offset = self.offsets.vmctx_gc_heap_base();
-        let base_offset = i32::try_from(base_offset).unwrap();
+        let base_offset = self.offsets.ptr.vmctx_gc_heap_base();
+        let base_offset = i32::from(base_offset);
 
-        let bound_offset = self.offsets.vmctx_gc_heap_bound();
-        let bound_offset = i32::try_from(bound_offset).unwrap();
+        let bound_offset = self.offsets.ptr.vmctx_gc_heap_bound();
+        let bound_offset = i32::from(bound_offset);
 
         let base = builder.ins().load(ptr_ty, flags, vmctx, base_offset);
         let bound = builder.ins().load(ptr_ty, flags, vmctx, bound_offset);
@@ -289,7 +289,7 @@ impl DrcCompiler {
             ptr_ty,
             ir::MemFlags::trusted(),
             vmctx,
-            i32::try_from(func_env.offsets.vmctx_gc_heap_data()).unwrap(),
+            i32::from(func_env.offsets.ptr.vmctx_gc_heap_data()),
         );
         let next = builder.ins().load(
             ptr_ty,
diff --git a/crates/environ/src/vmoffsets.rs b/crates/environ/src/vmoffsets.rs
index 569e3e5ff..d913f2d62 100644
--- a/crates/environ/src/vmoffsets.rs
+++ b/crates/environ/src/vmoffsets.rs
@@ -7,8 +7,9 @@
 //      magic: u32,
 //      _padding: u32, // (On 64-bit systems)
 //      runtime_limits: *const VMRuntimeLimits,
-//      builtins: *mut VMBuiltinFunctionsArray,
+//      builtin_functions: *mut VMBuiltinFunctionsArray,
 //      callee: *mut VMFunctionBody,
+//      epoch_ptr: *mut AtomicU64,
 //      gc_heap_base: *mut u8,
 //      gc_heap_bound: *mut u8,
 //      gc_heap_data: *mut T, // Collector-specific pointer
@@ -77,16 +78,6 @@ pub struct VMOffsets<P> {
     pub num_call_indirect_caches: u32,
 
     // precalculated offsets of various member fields
-    magic: u32,
-    runtime_limits: u32,
-    builtin_functions: u32,
-    callee: u32,
-    epoch_ptr: u32,
-    gc_heap_base: u32,
-    gc_heap_bound: u32,
-    gc_heap_data: u32,
-    store: u32,
-    type_ids: u32,
     imported_functions: u32,
     imported_tables: u32,
     imported_memories: u32,
@@ -244,6 +235,81 @@ pub trait PtrSize {
     fn size_of_vmcall_indirect_cache(&self) -> u8 {
         2 * self.size()
     }
+
+    /// Return the offset to the `magic` value in this `VMContext`.
+    #[inline]
+    fn vmctx_magic(&self) -> u8 {
+        // This is required by the implementation of `VMContext::instance` and
+        // `VMContext::instance_mut`. If this value changes then those locations
+        // need to be updated.
+        0
+    }
+
+    /// Return the offset to the `VMRuntimeLimits` structure
+    #[inline]
+    fn vmctx_runtime_limits(&self) -> u8 {
+        self.vmctx_magic() + self.size()
+    }
+
+    /// Return the offset to the `VMBuiltinFunctionsArray` structure
+    #[inline]
+    fn vmctx_builtin_functions(&self) -> u8 {
+        self.vmctx_runtime_limits() + self.size()
+    }
+
+    /// Return the offset to the `callee` member in this `VMContext`.
+    #[inline]
+    fn vmctx_callee(&self) -> u8 {
+        self.vmctx_builtin_functions() + self.size()
+    }
+
+    /// Return the offset to the `*const AtomicU64` epoch-counter
+    /// pointer.
+    #[inline]
+    fn vmctx_epoch_ptr(&self) -> u8 {
+        self.vmctx_callee() + self.size()
+    }
+
+    /// Return the offset to the GC heap base in this `VMContext`.
+    #[inline]
+    fn vmctx_gc_heap_base(&self) -> u8 {
+        self.vmctx_epoch_ptr() + self.size()
+    }
+
+    /// Return the offset to the GC heap bound in this `VMContext`.
+    #[inline]
+    fn vmctx_gc_heap_bound(&self) -> u8 {
+        self.vmctx_gc_heap_base() + self.size()
+    }
+
+    /// Return the offset to the `*mut T` collector-specific data.
+    ///
+    /// This is a pointer that different collectors can use however they see
+    /// fit.
+    #[inline]
+    fn vmctx_gc_heap_data(&self) -> u8 {
+        self.vmctx_gc_heap_bound() + self.size()
+    }
+
+    /// The offset of the `*const dyn Store` member.
+    #[inline]
+    fn vmctx_store(&self) -> u8 {
+        self.vmctx_gc_heap_data() + self.size()
+    }
+
+    /// The offset of the `type_ids` array pointer.
+    #[inline]
+    fn vmctx_type_ids_array(&self) -> u8 {
+        self.vmctx_store() + 2 * self.size()
+    }
+
+    /// The end of statically known offsets in `VMContext`.
+    ///
+    /// Data after this is dynamically sized.
+    #[inline]
+    fn vmctx_dynamic_data_start(&self) -> u8 {
+        self.vmctx_type_ids_array() + self.size()
+    }
 }
 
 /// Type representing the size of a pointer for the current compilation host
@@ -366,8 +432,11 @@ impl<P: PtrSize> VMOffsets<P> {
                     let $name = last - $name;
                     last = tmp;
                 )*
-                assert_eq!(last, 0);
-                IntoIterator::into_iter([$(($desc, $name),)*])
+                assert_ne!(last, 0);
+                IntoIterator::into_iter([
+                    $(($desc, $name),)*
+                    ("static vmctx data", last),
+                ])
             }};
         }
 
@@ -382,16 +451,6 @@ impl<P: PtrSize> VMOffsets<P> {
             imported_memories: "imported memories",
             imported_tables: "imported tables",
             imported_functions: "imported functions",
-            type_ids: "module types",
-            store: "jit store state",
-            gc_heap_data: "GC implementation-specific data",
-            gc_heap_bound: "GC heap bound",
-            gc_heap_base: "GC heap base",
-            epoch_ptr: "jit current epoch state",
-            callee: "callee function pointer",
-            builtin_functions: "jit builtin functions state",
-            runtime_limits: "jit runtime limits state",
-            magic: "magic value",
         }
     }
 }
@@ -410,16 +469,6 @@ impl<P: PtrSize> From<VMOffsetsFields<P>> for VMOffsets<P> {
             num_defined_globals: fields.num_defined_globals,
             num_escaped_funcs: fields.num_escaped_funcs,
             num_call_indirect_caches: fields.num_call_indirect_caches,
-            magic: 0,
-            runtime_limits: 0,
-            builtin_functions: 0,
-            callee: 0,
-            epoch_ptr: 0,
-            gc_heap_base: 0,
-            gc_heap_bound: 0,
-            gc_heap_data: 0,
-            store: 0,
-            type_ids: 0,
             imported_functions: 0,
             imported_tables: 0,
             imported_memories: 0,
@@ -447,7 +496,7 @@ impl<P: PtrSize> From<VMOffsetsFields<P>> for VMOffsets<P> {
             count.checked_mul(u32::from(size)).unwrap()
         }
 
-        let mut next_field_offset = 0;
+        let mut next_field_offset = u32::from(ret.ptr.vmctx_dynamic_data_start());
 
         macro_rules! fields {
             (size($field:ident) = $size:expr, $($rest:tt)*) => {
@@ -463,17 +512,6 @@ impl<P: PtrSize> From<VMOffsetsFields<P>> for VMOffsets<P> {
         }
 
         fields! {
-            size(magic) = 4u32,
-            align(u32::from(ret.ptr.size())),
-            size(runtime_limits) = ret.ptr.size(),
-            size(builtin_functions) = ret.ptr.size(),
-            size(callee) = ret.ptr.size(),
-            size(epoch_ptr) = ret.ptr.size(),
-            size(gc_heap_base) = ret.ptr.size(),
-            size(gc_heap_bound) = ret.ptr.size(),
-            size(gc_heap_data) = ret.ptr.size(),
-            size(store) = ret.ptr.size() * 2,
-            size(type_ids) = ret.ptr.size(),
             size(imported_functions)
                 = cmul(ret.num_imported_functions, ret.size_of_vmfunction_import()),
             size(imported_tables)
@@ -503,11 +541,6 @@ impl<P: PtrSize> From<VMOffsetsFields<P>> for VMOffsets<P> {
 
         ret.size = next_field_offset;
 
-        // This is required by the implementation of `VMContext::instance` and
-        // `VMContext::instance_mut`. If this value changes then those locations
-        // need to be updated.
-        assert_eq!(ret.magic, 0);
-
         return ret;
     }
 }
@@ -640,63 +673,6 @@ impl<P: PtrSize> VMOffsets<P> {
 
 /// Offsets for `VMContext`.
 impl<P: PtrSize> VMOffsets<P> {
-    /// Return the offset to the `magic` value in this `VMContext`.
-    #[inline]
-    pub fn vmctx_magic(&self) -> u32 {
-        self.magic
-    }
-
-    /// Return the offset to the `VMRuntimeLimits` structure
-    #[inline]
-    pub fn vmctx_runtime_limits(&self) -> u32 {
-        self.runtime_limits
-    }
-
-    /// Return the offset to the `callee` member in this `VMContext`.
-    pub fn vmctx_callee(&self) -> u32 {
-        self.callee
-    }
-
-    /// Return the offset to the `*const AtomicU64` epoch-counter
-    /// pointer.
-    #[inline]
-    pub fn vmctx_epoch_ptr(&self) -> u32 {
-        self.epoch_ptr
-    }
-
-    /// Return the offset to the GC heap base in this `VMContext`.
-    #[inline]
-    pub fn vmctx_gc_heap_base(&self) -> u32 {
-        self.gc_heap_base
-    }
-
-    /// Return the offset to the GC heap bound in this `VMContext`.
-    #[inline]
-    pub fn vmctx_gc_heap_bound(&self) -> u32 {
-        self.gc_heap_bound
-    }
-
-    /// Return the offset to the `*mut T` collector-specific data.
-    ///
-    /// This is a pointer that different collectors can use however they see
-    /// fit.
-    #[inline]
-    pub fn vmctx_gc_heap_data(&self) -> u32 {
-        self.gc_heap_data
-    }
-
-    /// The offset of the `*const dyn Store` member.
-    #[inline]
-    pub fn vmctx_store(&self) -> u32 {
-        self.store
-    }
-
-    /// The offset of the `type_ids` array pointer.
-    #[inline]
-    pub fn vmctx_type_ids_array(&self) -> u32 {
-        self.type_ids
-    }
-
     /// The offset of the `tables` array.
     #[inline]
     pub fn vmctx_imported_functions_begin(&self) -> u32 {
@@ -751,12 +727,6 @@ impl<P: PtrSize> VMOffsets<P> {
         self.defined_func_refs
     }
 
-    /// The offset of the builtin functions array.
-    #[inline]
-    pub fn vmctx_builtin_functions(&self) -> u32 {
-        self.builtin_functions
-    }
-
     /// The offset of the `call_indirect_caches` array.
     #[inline]
     pub fn vmctx_call_indirec_caches_begin(&self) -> u32 {
diff --git a/crates/wasmtime/src/compile.rs b/crates/wasmtime/src/compile.rs
index a9811814e..5dd78cb77 100644
--- a/crates/wasmtime/src/compile.rs
+++ b/crates/wasmtime/src/compile.rs
@@ -24,7 +24,6 @@
 
 use crate::prelude::*;
 use crate::Engine;
-use anyhow::{Context, Result};
 use std::{
     any::Any,
     borrow::Cow,
diff --git a/crates/wasmtime/src/compile/code_builder.rs b/crates/wasmtime/src/compile/code_builder.rs
index c3a11e63d..3ea10c766 100644
--- a/crates/wasmtime/src/compile/code_builder.rs
+++ b/crates/wasmtime/src/compile/code_builder.rs
@@ -1,6 +1,5 @@
 use crate::prelude::*;
 use crate::Engine;
-use anyhow::{anyhow, bail, Context, Result};
 use std::borrow::Cow;
 use std::path::Path;
 
diff --git a/crates/wasmtime/src/compile/runtime.rs b/crates/wasmtime/src/compile/runtime.rs
index 0b2f3eeab..3d880c61c 100644
--- a/crates/wasmtime/src/compile/runtime.rs
+++ b/crates/wasmtime/src/compile/runtime.rs
@@ -1,9 +1,9 @@
 use crate::compile::HashedEngineCompileEnv;
 #[cfg(feature = "component-model")]
 use crate::component::Component;
+use crate::prelude::*;
 use crate::runtime::vm::MmapVec;
 use crate::{CodeBuilder, CodeMemory, Engine, Module};
-use anyhow::{Context, Error, Result};
 use object::write::WritableBuffer;
 use std::sync::Arc;
 use wasmtime_environ::{FinishedObject, ObjectBuilder, ObjectKind};
diff --git a/crates/wasmtime/src/config.rs b/crates/wasmtime/src/config.rs
index a6aac0bd3..707e6b386 100644
--- a/crates/wasmtime/src/config.rs
+++ b/crates/wasmtime/src/config.rs
@@ -1,6 +1,5 @@
 use crate::prelude::*;
 use alloc::sync::Arc;
-use anyhow::{bail, ensure, Result};
 use core::fmt;
 use core::str::FromStr;
 use hashbrown::{HashMap, HashSet};
diff --git a/crates/wasmtime/src/engine.rs b/crates/wasmtime/src/engine.rs
index 64e1a50cb..648d1c270 100644
--- a/crates/wasmtime/src/engine.rs
+++ b/crates/wasmtime/src/engine.rs
@@ -6,7 +6,6 @@ use crate::runtime::vm::GcRuntime;
 use crate::sync::OnceLock;
 use crate::Config;
 use alloc::sync::Arc;
-use anyhow::{Context, Result};
 use core::sync::atomic::{AtomicU64, Ordering};
 #[cfg(any(feature = "cranelift", feature = "winch"))]
 use object::write::{Object, StandardSegment};
diff --git a/crates/wasmtime/src/engine/serialization.rs b/crates/wasmtime/src/engine/serialization.rs
index 28e8bdb0f..5da038859 100644
--- a/crates/wasmtime/src/engine/serialization.rs
+++ b/crates/wasmtime/src/engine/serialization.rs
@@ -23,7 +23,6 @@
 
 use crate::prelude::*;
 use crate::{Engine, ModuleVersionStrategy, Precompiled};
-use anyhow::{anyhow, bail, ensure, Context, Result};
 use core::str::FromStr;
 use object::endian::NativeEndian;
 #[cfg(any(feature = "cranelift", feature = "winch"))]
diff --git a/crates/wasmtime/src/lib.rs b/crates/wasmtime/src/lib.rs
index fe32a3d6c..749447bc8 100644
--- a/crates/wasmtime/src/lib.rs
+++ b/crates/wasmtime/src/lib.rs
@@ -281,7 +281,11 @@
 extern crate std;
 extern crate alloc;
 
-use wasmtime_environ::prelude;
+pub(crate) mod prelude {
+    pub use crate::{Error, Result};
+    pub use anyhow::{anyhow, bail, ensure, format_err, Context};
+    pub use wasmtime_environ::prelude::*;
+}
 
 /// A helper macro to safely map `MaybeUninit<T>` to `MaybeUninit<U>` where `U`
 /// is a field projection within `T`.
@@ -375,6 +379,7 @@ use sync_nostd as sync;
 ///
 /// This type can be used to interact with `wasmtimes`'s extensive use
 /// of `anyhow::Error` while still not directly depending on `anyhow`.
+///
 /// This type alias is identical to `anyhow::Result`.
 #[doc(no_inline)]
 pub use anyhow::{Error, Result};
diff --git a/crates/wasmtime/src/profiling_agent.rs b/crates/wasmtime/src/profiling_agent.rs
index d431e25b8..b32b84619 100644
--- a/crates/wasmtime/src/profiling_agent.rs
+++ b/crates/wasmtime/src/profiling_agent.rs
@@ -1,6 +1,4 @@
 use crate::prelude::*;
-#[allow(unused)]
-use anyhow::{bail, Result};
 
 cfg_if::cfg_if! {
     if #[cfg(all(feature = "profiling", target_os = "linux"))] {
diff --git a/crates/wasmtime/src/profiling_agent/jitdump.rs b/crates/wasmtime/src/profiling_agent/jitdump.rs
index 3133bdc93..5de53984f 100644
--- a/crates/wasmtime/src/profiling_agent/jitdump.rs
+++ b/crates/wasmtime/src/profiling_agent/jitdump.rs
@@ -13,14 +13,12 @@
 
 use crate::prelude::*;
 use crate::profiling_agent::ProfilingAgent;
-use anyhow::Result;
+use object::elf;
 use std::process;
 use std::sync::Mutex;
 use target_lexicon::Architecture;
 use wasmtime_jit_debug::perf_jitdump::*;
 
-use object::elf;
-
 /// Interface for driving the creation of jitdump files
 struct JitDumpAgent {
     pid: u32,
diff --git a/crates/wasmtime/src/profiling_agent/perfmap.rs b/crates/wasmtime/src/profiling_agent/perfmap.rs
index 6ee1f3273..c60a28440 100644
--- a/crates/wasmtime/src/profiling_agent/perfmap.rs
+++ b/crates/wasmtime/src/profiling_agent/perfmap.rs
@@ -1,6 +1,5 @@
 use crate::prelude::*;
 use crate::profiling_agent::ProfilingAgent;
-use anyhow::Result;
 use std::io::{self, BufWriter, Write};
 use std::process;
 use std::{fs::File, sync::Mutex};
diff --git a/crates/wasmtime/src/profiling_agent/vtune.rs b/crates/wasmtime/src/profiling_agent/vtune.rs
index a2f8b6609..159792401 100644
--- a/crates/wasmtime/src/profiling_agent/vtune.rs
+++ b/crates/wasmtime/src/profiling_agent/vtune.rs
@@ -14,7 +14,6 @@
 
 use crate::prelude::*;
 use crate::profiling_agent::ProfilingAgent;
-use anyhow::Result;
 use ittapi::jit::MethodLoadBuilder;
 use std::sync::Mutex;
 
diff --git a/crates/wasmtime/src/runtime/code_memory.rs b/crates/wasmtime/src/runtime/code_memory.rs
index 07143ff98..d85e1ff79 100644
--- a/crates/wasmtime/src/runtime/code_memory.rs
+++ b/crates/wasmtime/src/runtime/code_memory.rs
@@ -2,7 +2,6 @@
 
 use crate::prelude::*;
 use crate::runtime::vm::{libcalls, MmapVec, UnwindRegistration};
-use anyhow::{anyhow, bail, Context, Result};
 use core::mem::ManuallyDrop;
 use core::ops::Range;
 use object::endian::NativeEndian;
diff --git a/crates/wasmtime/src/runtime/component/component.rs b/crates/wasmtime/src/runtime/component/component.rs
index 64c9c8c5e..6c6169078 100644
--- a/crates/wasmtime/src/runtime/component/component.rs
+++ b/crates/wasmtime/src/runtime/component/component.rs
@@ -9,7 +9,6 @@ use crate::{
 };
 use crate::{FuncType, ValType};
 use alloc::sync::Arc;
-use anyhow::Result;
 use core::any::Any;
 use core::mem;
 use core::ops::Range;
diff --git a/crates/wasmtime/src/runtime/component/func.rs b/crates/wasmtime/src/runtime/component/func.rs
index 8feb30b30..c7fda9118 100644
--- a/crates/wasmtime/src/runtime/component/func.rs
+++ b/crates/wasmtime/src/runtime/component/func.rs
@@ -8,7 +8,6 @@ use crate::runtime::vm::{Export, ExportFunction};
 use crate::store::{StoreOpaque, Stored};
 use crate::{AsContext, AsContextMut, StoreContextMut, ValRaw};
 use alloc::sync::Arc;
-use anyhow::{bail, Context, Result};
 use core::mem::{self, MaybeUninit};
 use core::ptr::NonNull;
 use wasmtime_environ::component::{
diff --git a/crates/wasmtime/src/runtime/component/func/host.rs b/crates/wasmtime/src/runtime/component/func/host.rs
index 2a700046c..ed203fdce 100644
--- a/crates/wasmtime/src/runtime/component/func/host.rs
+++ b/crates/wasmtime/src/runtime/component/func/host.rs
@@ -9,7 +9,6 @@ use crate::runtime::vm::component::{
 use crate::runtime::vm::{VMFuncRef, VMMemoryDefinition, VMOpaqueContext};
 use crate::{AsContextMut, StoreContextMut, ValRaw};
 use alloc::sync::Arc;
-use anyhow::{bail, Context, Result};
 use core::any::Any;
 use core::mem::{self, MaybeUninit};
 use core::ptr::NonNull;
diff --git a/crates/wasmtime/src/runtime/component/func/options.rs b/crates/wasmtime/src/runtime/component/func/options.rs
index b9b13ae40..83accf3de 100644
--- a/crates/wasmtime/src/runtime/component/func/options.rs
+++ b/crates/wasmtime/src/runtime/component/func/options.rs
@@ -9,7 +9,6 @@ use crate::runtime::vm::{VMFuncRef, VMMemoryDefinition};
 use crate::store::{StoreId, StoreOpaque};
 use crate::{FuncType, StoreContextMut};
 use alloc::sync::Arc;
-use anyhow::{bail, Result};
 use core::ptr::NonNull;
 use wasmtime_environ::component::{ComponentTypes, StringEncoding, TypeResourceTableIndex};
 
diff --git a/crates/wasmtime/src/runtime/component/func/typed.rs b/crates/wasmtime/src/runtime/component/func/typed.rs
index 4a6945a27..e312a986a 100644
--- a/crates/wasmtime/src/runtime/component/func/typed.rs
+++ b/crates/wasmtime/src/runtime/component/func/typed.rs
@@ -7,7 +7,6 @@ use crate::runtime::vm::SendSyncPtr;
 use crate::{AsContextMut, StoreContext, StoreContextMut, ValRaw};
 use alloc::borrow::Cow;
 use alloc::sync::Arc;
-use anyhow::{anyhow, bail, Context, Result};
 use core::fmt;
 use core::marker;
 use core::mem::{self, MaybeUninit};
diff --git a/crates/wasmtime/src/runtime/component/instance.rs b/crates/wasmtime/src/runtime/component/instance.rs
index 4c58d1fb6..28acfab9d 100644
--- a/crates/wasmtime/src/runtime/component/instance.rs
+++ b/crates/wasmtime/src/runtime/component/instance.rs
@@ -9,7 +9,6 @@ use crate::runtime::vm::VMFuncRef;
 use crate::store::{StoreOpaque, Stored};
 use crate::{AsContextMut, Module, StoreContextMut};
 use alloc::sync::Arc;
-use anyhow::{anyhow, Context, Result};
 use core::marker;
 use core::ptr::{self, NonNull};
 use wasmtime_environ::{component::*, EngineOrModuleTypeIndex};
diff --git a/crates/wasmtime/src/runtime/component/linker.rs b/crates/wasmtime/src/runtime/component/linker.rs
index b36785f35..cb7795af9 100644
--- a/crates/wasmtime/src/runtime/component/linker.rs
+++ b/crates/wasmtime/src/runtime/component/linker.rs
@@ -8,7 +8,6 @@ use crate::component::{
 use crate::prelude::*;
 use crate::{AsContextMut, Engine, Module, StoreContextMut};
 use alloc::sync::Arc;
-use anyhow::{bail, Context, Result};
 use core::future::Future;
 use core::marker;
 use core::pin::Pin;
diff --git a/crates/wasmtime/src/runtime/component/matching.rs b/crates/wasmtime/src/runtime/component/matching.rs
index 5ab8c5d00..94c24af87 100644
--- a/crates/wasmtime/src/runtime/component/matching.rs
+++ b/crates/wasmtime/src/runtime/component/matching.rs
@@ -6,7 +6,6 @@ use crate::runtime::vm::component::ComponentInstance;
 use crate::types::matching;
 use crate::Module;
 use alloc::sync::Arc;
-use anyhow::{anyhow, bail, Context, Result};
 use core::any::Any;
 use wasmtime_environ::component::{
     ComponentTypes, ResourceIndex, TypeComponentInstance, TypeDef, TypeFuncIndex, TypeModule,
diff --git a/crates/wasmtime/src/runtime/component/mod.rs b/crates/wasmtime/src/runtime/component/mod.rs
index 01ad8df32..3590542f0 100644
--- a/crates/wasmtime/src/runtime/component/mod.rs
+++ b/crates/wasmtime/src/runtime/component/mod.rs
@@ -655,3 +655,9 @@ pub use wasmtime_component_macro::flags;
 
 #[cfg(any(docsrs, test, doctest))]
 pub mod bindgen_examples;
+
+// NB: needed for the links in the docs above to work in all `cargo doc`
+// configurations and avoid errors.
+#[cfg(not(any(docsrs, test, doctest)))]
+#[doc(hidden)]
+pub mod bindgen_examples {}
diff --git a/crates/wasmtime/src/runtime/component/resources.rs b/crates/wasmtime/src/runtime/component/resources.rs
index b223a44d7..678b0f8f7 100644
--- a/crates/wasmtime/src/runtime/component/resources.rs
+++ b/crates/wasmtime/src/runtime/component/resources.rs
@@ -6,7 +6,6 @@ use crate::runtime::vm::component::{ComponentInstance, InstanceFlags, ResourceTa
 use crate::runtime::vm::{SendSyncPtr, VMFuncRef, ValRaw};
 use crate::store::{StoreId, StoreOpaque};
 use crate::{AsContextMut, StoreContextMut, Trap};
-use anyhow::{bail, ensure, Result};
 use core::any::TypeId;
 use core::fmt;
 use core::marker;
diff --git a/crates/wasmtime/src/runtime/component/values.rs b/crates/wasmtime/src/runtime/component/values.rs
index 65274eb33..0221ea50f 100644
--- a/crates/wasmtime/src/runtime/component/values.rs
+++ b/crates/wasmtime/src/runtime/component/values.rs
@@ -2,7 +2,6 @@ use crate::component::func::{desc, Lift, LiftContext, Lower, LowerContext};
 use crate::component::ResourceAny;
 use crate::prelude::*;
 use crate::ValRaw;
-use anyhow::{anyhow, bail, Result};
 use core::mem::MaybeUninit;
 use core::slice::{Iter, IterMut};
 use wasmtime_component_util::{DiscriminantSize, FlagsSize};
diff --git a/crates/wasmtime/src/runtime/debug.rs b/crates/wasmtime/src/runtime/debug.rs
index bb98b48bd..b3a5d94dd 100644
--- a/crates/wasmtime/src/runtime/debug.rs
+++ b/crates/wasmtime/src/runtime/debug.rs
@@ -1,5 +1,4 @@
 use crate::prelude::*;
-use anyhow::{anyhow, bail, ensure, Error};
 use core::mem::size_of;
 use object::elf::*;
 use object::endian::{BigEndian, Endian, Endianness, LittleEndian};
diff --git a/crates/wasmtime/src/runtime/externals/global.rs b/crates/wasmtime/src/runtime/externals/global.rs
index ae2b1e460..8ec0ccdc6 100644
--- a/crates/wasmtime/src/runtime/externals/global.rs
+++ b/crates/wasmtime/src/runtime/externals/global.rs
@@ -1,3 +1,4 @@
+use crate::prelude::*;
 use crate::runtime::vm::{GcRootsList, SendSyncPtr};
 use crate::{
     store::{AutoAssertNoGc, StoreData, StoreOpaque, Stored},
@@ -5,7 +6,6 @@ use crate::{
     AnyRef, AsContext, AsContextMut, ExternRef, Func, GlobalType, HeapType, Mutability, Ref,
     RootedGcRefImpl, Val, ValType,
 };
-use anyhow::{bail, Context, Result};
 use core::ptr;
 use core::ptr::NonNull;
 use wasmtime_environ::TypeTrace;
diff --git a/crates/wasmtime/src/runtime/externals/table.rs b/crates/wasmtime/src/runtime/externals/table.rs
index 67d1aec8c..1decf6b5c 100644
--- a/crates/wasmtime/src/runtime/externals/table.rs
+++ b/crates/wasmtime/src/runtime/externals/table.rs
@@ -3,7 +3,6 @@ use crate::runtime::vm::{self as runtime};
 use crate::store::{AutoAssertNoGc, StoreData, StoreOpaque, Stored};
 use crate::trampoline::generate_table_export;
 use crate::{AnyRef, AsContext, AsContextMut, ExternRef, Func, HeapType, Ref, TableType};
-use anyhow::{anyhow, bail, Context, Result};
 use core::iter;
 use core::ptr::NonNull;
 use runtime::{GcRootsList, SendSyncPtr};
diff --git a/crates/wasmtime/src/runtime/func.rs b/crates/wasmtime/src/runtime/func.rs
index 2b210fd4a..e4e35ebb6 100644
--- a/crates/wasmtime/src/runtime/func.rs
+++ b/crates/wasmtime/src/runtime/func.rs
@@ -11,7 +11,6 @@ use crate::{
     StoreContext, StoreContextMut, Val, ValRaw, ValType,
 };
 use alloc::sync::Arc;
-use anyhow::{bail, Context as _, Error, Result};
 use core::ffi::c_void;
 use core::future::Future;
 use core::mem::{self, MaybeUninit};
@@ -1705,6 +1704,8 @@ pub unsafe trait WasmRet {
 
     #[doc(hidden)]
     fn func_type(engine: &Engine, params: impl Iterator<Item = ValType>) -> FuncType;
+    #[doc(hidden)]
+    fn may_gc() -> bool;
 
     // Utilities used to convert an instance of this type to a `Result`
     // explicitly, used when wrapping async functions which always bottom-out
@@ -1736,6 +1737,10 @@ where
         <Self as WasmTy>::store(self, store, ptr.get_unchecked_mut(0))
     }
 
+    fn may_gc() -> bool {
+        T::may_gc()
+    }
+
     fn func_type(engine: &Engine, params: impl Iterator<Item = ValType>) -> FuncType {
         FuncType::new(engine, params, Some(<Self as WasmTy>::valtype()))
     }
@@ -1770,6 +1775,10 @@ where
         self.and_then(|val| val.store(store, ptr))
     }
 
+    fn may_gc() -> bool {
+        T::may_gc()
+    }
+
     fn func_type(engine: &Engine, params: impl Iterator<Item = ValType>) -> FuncType {
         T::func_type(engine, params)
     }
@@ -1815,6 +1824,11 @@ macro_rules! impl_wasm_host_results {
                 Ok(())
             }
 
+            #[doc(hidden)]
+            fn may_gc() -> bool {
+                $( $t::may_gc() || )* false
+            }
+
             fn func_type(engine: &Engine, params: impl Iterator<Item = ValType>) -> FuncType {
                 FuncType::new(
                     engine,
@@ -1938,6 +1952,9 @@ pub unsafe trait WasmTyList {
     // valid for this given type.
     #[doc(hidden)]
     unsafe fn load(store: &mut AutoAssertNoGc<'_>, values: &mut [MaybeUninit<ValRaw>]) -> Self;
+
+    #[doc(hidden)]
+    fn may_gc() -> bool;
 }
 
 macro_rules! impl_wasm_ty_list {
@@ -1960,6 +1977,10 @@ macro_rules! impl_wasm_ty_list {
                     $args::load(_store, ptr)
                 },)*)
             }
+
+            fn may_gc() -> bool {
+                $( $args::may_gc() || )* false
+            }
         }
     });
 }
@@ -2221,7 +2242,11 @@ impl HostContext {
                     break 'ret R::fallible_from_error(trap);
                 }
 
-                let mut store = AutoAssertNoGc::new(caller.store.0);
+                let mut store = if P::may_gc() {
+                    AutoAssertNoGc::new(caller.store.0)
+                } else {
+                    unsafe { AutoAssertNoGc::disabled(caller.store.0) }
+                };
                 let params = P::load(&mut store, args);
                 let _ = &mut store;
                 drop(store);
@@ -2236,7 +2261,11 @@ impl HostContext {
             if !ret.compatible_with_store(caller.store.0) {
                 bail!("host function attempted to return cross-`Store` value to Wasm")
             } else {
-                let mut store = AutoAssertNoGc::new(&mut **caller.store.0);
+                let mut store = if R::may_gc() {
+                    AutoAssertNoGc::new(caller.store.0)
+                } else {
+                    unsafe { AutoAssertNoGc::disabled(caller.store.0) }
+                };
                 let ret = ret.store(&mut store, args)?;
                 Ok(ret)
             }
diff --git a/crates/wasmtime/src/runtime/func/typed.rs b/crates/wasmtime/src/runtime/func/typed.rs
index c72e5414b..f021909ae 100644
--- a/crates/wasmtime/src/runtime/func/typed.rs
+++ b/crates/wasmtime/src/runtime/func/typed.rs
@@ -1,11 +1,11 @@
 use super::invoke_wasm_and_catch_traps;
+use crate::prelude::*;
 use crate::runtime::vm::{VMFuncRef, VMOpaqueContext};
 use crate::store::{AutoAssertNoGc, StoreOpaque};
 use crate::{
     AsContext, AsContextMut, Engine, Func, FuncType, HeapType, NoFunc, RefType, StoreContextMut,
     ValRaw, ValType,
 };
-use anyhow::{bail, Context, Result};
 use core::ffi::c_void;
 use core::marker;
 use core::mem::{self, MaybeUninit};
@@ -315,6 +315,14 @@ pub unsafe trait WasmTy: Send {
     #[doc(hidden)]
     fn valtype() -> ValType;
 
+    #[doc(hidden)]
+    fn may_gc() -> bool {
+        match Self::valtype() {
+            ValType::Ref(_) => true,
+            ValType::I32 | ValType::I64 | ValType::F32 | ValType::F64 | ValType::V128 => false,
+        }
+    }
+
     // Dynamic checks that this value is being used with the correct store
     // context.
     #[doc(hidden)]
diff --git a/crates/wasmtime/src/runtime/gc/enabled/externref.rs b/crates/wasmtime/src/runtime/gc/enabled/externref.rs
index 2f58beb32..4617189fc 100644
--- a/crates/wasmtime/src/runtime/gc/enabled/externref.rs
+++ b/crates/wasmtime/src/runtime/gc/enabled/externref.rs
@@ -7,7 +7,6 @@ use crate::{
     AsContextMut, GcHeapOutOfMemory, GcRefImpl, GcRootIndex, HeapType, ManuallyRooted, RefType,
     Result, RootSet, Rooted, StoreContext, StoreContextMut, ValRaw, ValType, WasmTy,
 };
-use anyhow::Context;
 use core::any::Any;
 use core::mem;
 use core::mem::MaybeUninit;
diff --git a/crates/wasmtime/src/runtime/gc/enabled/rooting.rs b/crates/wasmtime/src/runtime/gc/enabled/rooting.rs
index 0a5801ed6..74fe5be87 100644
--- a/crates/wasmtime/src/runtime/gc/enabled/rooting.rs
+++ b/crates/wasmtime/src/runtime/gc/enabled/rooting.rs
@@ -108,7 +108,6 @@ use crate::{
     store::{AutoAssertNoGc, StoreId, StoreOpaque},
     AsContext, AsContextMut, GcRef, Result, RootedGcRef,
 };
-use anyhow::anyhow;
 use core::any;
 use core::marker;
 use core::mem;
@@ -408,9 +407,7 @@ impl RootSet {
     /// Calls to `{enter,exit}_lifo_scope` must happen in a strict LIFO order.
     #[inline]
     pub(crate) fn enter_lifo_scope(&self) -> usize {
-        let len = self.lifo_roots.len();
-        log::debug!("Entering GC root set LIFO scope: {len}");
-        len
+        self.lifo_roots.len()
     }
 
     /// Exit a LIFO rooting scope.
@@ -421,7 +418,6 @@ impl RootSet {
     /// Calls to `{enter,exit}_lifo_scope` must happen in a strict LIFO order.
     #[inline]
     pub(crate) fn exit_lifo_scope(&mut self, gc_store: &mut GcStore, scope: usize) {
-        log::debug!("Exiting GC root set LIFO scope: {scope}");
         debug_assert!(self.lifo_roots.len() >= scope);
 
         // If we actually have roots to unroot, call an out-of-line slow path.
diff --git a/crates/wasmtime/src/runtime/instance.rs b/crates/wasmtime/src/runtime/instance.rs
index eb9cfe7fe..268b72f03 100644
--- a/crates/wasmtime/src/runtime/instance.rs
+++ b/crates/wasmtime/src/runtime/instance.rs
@@ -11,7 +11,6 @@ use crate::{
     StoreContext, StoreContextMut, Table, TypedFunc,
 };
 use alloc::sync::Arc;
-use anyhow::{anyhow, bail, Context, Result};
 use core::ptr::NonNull;
 use wasmparser::WasmFeatures;
 use wasmtime_environ::{
diff --git a/crates/wasmtime/src/runtime/instantiate.rs b/crates/wasmtime/src/runtime/instantiate.rs
index fd725ceee..a8abc8147 100644
--- a/crates/wasmtime/src/runtime/instantiate.rs
+++ b/crates/wasmtime/src/runtime/instantiate.rs
@@ -7,7 +7,6 @@ use crate::prelude::*;
 use crate::runtime::vm::{CompiledModuleId, MmapVec};
 use crate::{code_memory::CodeMemory, profiling_agent::ProfilingAgent};
 use alloc::sync::Arc;
-use anyhow::Result;
 use core::str;
 use wasmtime_environ::{
     CompiledFunctionInfo, CompiledModuleInfo, DefinedFuncIndex, FuncIndex, FunctionLoc,
@@ -70,8 +69,6 @@ impl CompiledModule {
     fn register_debug_and_profiling(&mut self, profiler: &dyn ProfilingAgent) -> Result<()> {
         #[cfg(feature = "debug-builtins")]
         if self.meta.native_debug_info_present {
-            use anyhow::Context;
-
             let text = self.text();
             let bytes = crate::debug::create_gdbjit_image(
                 self.mmap().to_vec(),
@@ -263,7 +260,6 @@ impl CompiledModule {
     /// what filename and line number a wasm pc comes from.
     #[cfg(feature = "addr2line")]
     pub fn symbolize_context(&self) -> Result<Option<SymbolizeContext<'_>>> {
-        use anyhow::Context;
         use gimli::EndianSlice;
         if !self.meta.has_wasm_debuginfo {
             return Ok(None);
diff --git a/crates/wasmtime/src/runtime/limits.rs b/crates/wasmtime/src/runtime/limits.rs
index e06df0b28..76faf312c 100644
--- a/crates/wasmtime/src/runtime/limits.rs
+++ b/crates/wasmtime/src/runtime/limits.rs
@@ -1,5 +1,4 @@
 use crate::prelude::*;
-use anyhow::{bail, Result};
 
 /// Value returned by [`ResourceLimiter::instances`] default method
 pub const DEFAULT_INSTANCE_LIMIT: usize = 10000;
diff --git a/crates/wasmtime/src/runtime/linker.rs b/crates/wasmtime/src/runtime/linker.rs
index ed9001d12..2b6431fdc 100644
--- a/crates/wasmtime/src/runtime/linker.rs
+++ b/crates/wasmtime/src/runtime/linker.rs
@@ -7,7 +7,6 @@ use crate::{
     Instance, Module, StoreContextMut, Val, ValRaw, ValType, WasmTyList,
 };
 use alloc::sync::Arc;
-use anyhow::{bail, Context, Result};
 use core::fmt;
 #[cfg(feature = "async")]
 use core::future::Future;
diff --git a/crates/wasmtime/src/runtime/memory.rs b/crates/wasmtime/src/runtime/memory.rs
index 437e3c775..a794e4159 100644
--- a/crates/wasmtime/src/runtime/memory.rs
+++ b/crates/wasmtime/src/runtime/memory.rs
@@ -4,7 +4,6 @@ use crate::store::{StoreData, StoreOpaque, Stored};
 use crate::trampoline::generate_memory_export;
 use crate::Trap;
 use crate::{AsContext, AsContextMut, Engine, MemoryType, StoreContext, StoreContextMut};
-use anyhow::{bail, Result};
 use core::cell::UnsafeCell;
 use core::fmt;
 use core::ops::Range;
diff --git a/crates/wasmtime/src/runtime/module.rs b/crates/wasmtime/src/runtime/module.rs
index 5a40a327b..1d778d3bb 100644
--- a/crates/wasmtime/src/runtime/module.rs
+++ b/crates/wasmtime/src/runtime/module.rs
@@ -11,7 +11,6 @@ use crate::{
     Engine,
 };
 use alloc::sync::Arc;
-use anyhow::{bail, Result};
 use core::fmt;
 use core::ops::Range;
 use core::ptr::NonNull;
diff --git a/crates/wasmtime/src/runtime/profiling.rs b/crates/wasmtime/src/runtime/profiling.rs
index f2a6258ac..df5475689 100644
--- a/crates/wasmtime/src/runtime/profiling.rs
+++ b/crates/wasmtime/src/runtime/profiling.rs
@@ -1,9 +1,6 @@
 use crate::prelude::*;
 use crate::runtime::vm::Backtrace;
 use crate::{instantiate::CompiledModule, AsContext, Module};
-#[allow(unused_imports)]
-use anyhow::bail;
-use anyhow::Result;
 use fxprof_processed_profile::{
     debugid::DebugId, CategoryHandle, Frame, FrameFlags, FrameInfo, LibraryInfo, Profile,
     ReferenceTimestamp, Symbol, SymbolTable, Timestamp,
diff --git a/crates/wasmtime/src/runtime/stack.rs b/crates/wasmtime/src/runtime/stack.rs
index c4bfb59a7..703c03691 100644
--- a/crates/wasmtime/src/runtime/stack.rs
+++ b/crates/wasmtime/src/runtime/stack.rs
@@ -1,5 +1,4 @@
 use crate::prelude::*;
-use anyhow::Error;
 use std::{ops::Range, sync::Arc};
 use wasmtime_fiber::{RuntimeFiberStack, RuntimeFiberStackCreator};
 
diff --git a/crates/wasmtime/src/runtime/store.rs b/crates/wasmtime/src/runtime/store.rs
index 4c91d58e2..16eb424d2 100644
--- a/crates/wasmtime/src/runtime/store.rs
+++ b/crates/wasmtime/src/runtime/store.rs
@@ -92,7 +92,6 @@ use crate::RootSet;
 use crate::{module::ModuleRegistry, Engine, Module, Trap, Val, ValRaw};
 use crate::{Global, Instance, Memory, RootScope, Table, Uninhabited};
 use alloc::sync::Arc;
-use anyhow::{anyhow, bail, Result};
 use core::cell::UnsafeCell;
 use core::fmt;
 use core::future::Future;
@@ -421,6 +420,29 @@ impl<'a> AutoAssertNoGc<'a> {
 
         AutoAssertNoGc { store, entered }
     }
+
+    /// Creates an `AutoAssertNoGc` value which is forcibly "not entered" and
+    /// disables checks for no GC happening for the duration of this value.
+    ///
+    /// This is used when it is statically otherwise known that a GC doesn't
+    /// happen for the various types involved.
+    ///
+    /// # Unsafety
+    ///
+    /// This method is `unsafe` as it does not provide the same safety
+    /// guarantees as `AutoAssertNoGc::new`. It must be guaranteed by the
+    /// caller that a GC doesn't happen.
+    #[inline]
+    pub unsafe fn disabled(store: &'a mut StoreOpaque) -> Self {
+        if cfg!(debug_assertions) {
+            AutoAssertNoGc::new(store)
+        } else {
+            AutoAssertNoGc {
+                store,
+                entered: false,
+            }
+        }
+    }
 }
 
 impl core::ops::Deref for AutoAssertNoGc<'_> {
diff --git a/crates/wasmtime/src/runtime/trampoline.rs b/crates/wasmtime/src/runtime/trampoline.rs
index 41dbc04ad..a060ea306 100644
--- a/crates/wasmtime/src/runtime/trampoline.rs
+++ b/crates/wasmtime/src/runtime/trampoline.rs
@@ -19,7 +19,6 @@ use crate::runtime::vm::{
 use crate::store::{InstanceId, StoreOpaque};
 use crate::{MemoryType, TableType};
 use alloc::sync::Arc;
-use anyhow::Result;
 use core::any::Any;
 use wasmtime_environ::{MemoryIndex, Module, TableIndex, VMSharedTypeIndex};
 
diff --git a/crates/wasmtime/src/runtime/trampoline/func.rs b/crates/wasmtime/src/runtime/trampoline/func.rs
index 36b305ac8..7ecf43b85 100644
--- a/crates/wasmtime/src/runtime/trampoline/func.rs
+++ b/crates/wasmtime/src/runtime/trampoline/func.rs
@@ -6,7 +6,6 @@ use crate::runtime::vm::{
 };
 use crate::type_registry::RegisteredType;
 use crate::{FuncType, ValRaw};
-use anyhow::Result;
 use core::ptr;
 
 struct TrampolineState<F> {
diff --git a/crates/wasmtime/src/runtime/trampoline/memory.rs b/crates/wasmtime/src/runtime/trampoline/memory.rs
index b0046d310..97a1cd0ff 100644
--- a/crates/wasmtime/src/runtime/trampoline/memory.rs
+++ b/crates/wasmtime/src/runtime/trampoline/memory.rs
@@ -10,7 +10,6 @@ use crate::runtime::vm::{
 use crate::store::{InstanceId, StoreOpaque};
 use crate::MemoryType;
 use alloc::sync::Arc;
-use anyhow::{anyhow, Result};
 use core::ops::Range;
 use wasmtime_environ::{
     DefinedMemoryIndex, DefinedTableIndex, EntityIndex, HostPtr, MemoryPlan, MemoryStyle, Module,
diff --git a/crates/wasmtime/src/runtime/trampoline/table.rs b/crates/wasmtime/src/runtime/trampoline/table.rs
index ba8a1566a..ce7f0bc9d 100644
--- a/crates/wasmtime/src/runtime/trampoline/table.rs
+++ b/crates/wasmtime/src/runtime/trampoline/table.rs
@@ -2,7 +2,6 @@ use crate::prelude::*;
 use crate::store::{InstanceId, StoreOpaque};
 use crate::trampoline::create_handle;
 use crate::TableType;
-use anyhow::Result;
 use wasmtime_environ::{EntityIndex, Module, TypeTrace};
 
 pub fn create_table(store: &mut StoreOpaque, table: &TableType) -> Result<InstanceId> {
diff --git a/crates/wasmtime/src/runtime/trap.rs b/crates/wasmtime/src/runtime/trap.rs
index 86bec4bfc..3cc3e29fa 100644
--- a/crates/wasmtime/src/runtime/trap.rs
+++ b/crates/wasmtime/src/runtime/trap.rs
@@ -3,7 +3,6 @@ use super::coredump::WasmCoreDump;
 use crate::prelude::*;
 use crate::store::StoreOpaque;
 use crate::{AsContext, Module};
-use anyhow::Error;
 use core::fmt;
 use wasmtime_environ::{
     demangle_function_name, demangle_function_name_or_index, EntityRef, FilePos,
@@ -20,11 +19,12 @@ use wasmtime_environ::{
 ///
 /// # Errors in Wasmtime
 ///
-/// Error-handling in Wasmtime is primarily done through the [`anyhow`] crate
-/// where most results are a [`Result<T>`](anyhow::Result) which is an alias for
-/// [`Result<T, anyhow::Error>`](std::result::Result). Errors in Wasmtime are
-/// represented with [`anyhow::Error`] which acts as a container for any type of
-/// error in addition to optional context for this error. The "base" error or
+/// Error-handling in Wasmtime is primarily done through the
+/// [`anyhow`][mod@anyhow] crate where most results are a
+/// [`Result<T>`](anyhow::Result) which is an alias for [`Result<T,
+/// anyhow::Error>`](std::result::Result). Errors in Wasmtime are represented
+/// with [`anyhow::Error`] which acts as a container for any type of error in
+/// addition to optional context for this error. The "base" error or
 /// [`anyhow::Error::root_cause`] is a [`Trap`] whenever WebAssembly hits a
 /// trap, or otherwise it's whatever the host created the error with when
 /// returning an error for a host call.
diff --git a/crates/wasmtime/src/runtime/types.rs b/crates/wasmtime/src/runtime/types.rs
index 352efbd07..029aecfc9 100644
--- a/crates/wasmtime/src/runtime/types.rs
+++ b/crates/wasmtime/src/runtime/types.rs
@@ -1,5 +1,4 @@
 use crate::prelude::*;
-use anyhow::{bail, ensure, Context, Result};
 use core::fmt::{self, Display, Write};
 use wasmtime_environ::{
     EngineOrModuleTypeIndex, EntityType, Global, Memory, ModuleTypes, Table, TypeTrace,
diff --git a/crates/wasmtime/src/runtime/types/matching.rs b/crates/wasmtime/src/runtime/types/matching.rs
index 3b123f8c1..8de3d9aed 100644
--- a/crates/wasmtime/src/runtime/types/matching.rs
+++ b/crates/wasmtime/src/runtime/types/matching.rs
@@ -1,6 +1,5 @@
 use crate::prelude::*;
 use crate::{linker::DefinitionType, Engine, FuncType};
-use anyhow::{anyhow, bail, Result};
 use wasmtime_environ::{
     EntityType, Global, Memory, ModuleTypes, Table, TypeTrace, VMSharedTypeIndex,
     WasmCompositeType, WasmFieldType, WasmHeapType, WasmRefType, WasmSubType, WasmValType,
diff --git a/crates/wasmtime/src/runtime/values.rs b/crates/wasmtime/src/runtime/values.rs
index 087a845b9..13d0693df 100644
--- a/crates/wasmtime/src/runtime/values.rs
+++ b/crates/wasmtime/src/runtime/values.rs
@@ -1,10 +1,10 @@
+use crate::prelude::*;
 use crate::runtime::vm::{TableElement, VMGcRef};
 use crate::store::{AutoAssertNoGc, StoreOpaque};
 use crate::{
     AnyRef, AsContext, AsContextMut, ExternRef, Func, HeapType, RefType, Rooted, RootedGcRefImpl,
     ValType, V128,
 };
-use anyhow::{bail, Context, Result};
 use core::ptr;
 
 pub use crate::runtime::vm::ValRaw;
diff --git a/crates/wasmtime/src/runtime/vm.rs b/crates/wasmtime/src/runtime/vm.rs
index 181de2773..03c1a7c80 100644
--- a/crates/wasmtime/src/runtime/vm.rs
+++ b/crates/wasmtime/src/runtime/vm.rs
@@ -5,7 +5,6 @@
 
 use crate::prelude::*;
 use alloc::sync::Arc;
-use anyhow::{anyhow, Error, Result};
 use core::fmt;
 use core::mem;
 use core::ptr::NonNull;
diff --git a/crates/wasmtime/src/runtime/vm/component.rs b/crates/wasmtime/src/runtime/vm/component.rs
index e00caaec0..a9847355c 100644
--- a/crates/wasmtime/src/runtime/vm/component.rs
+++ b/crates/wasmtime/src/runtime/vm/component.rs
@@ -6,13 +6,13 @@
 //! Eventually it's intended that module-to-module calls, which would be
 //! cranelift-compiled adapters, will use this `VMComponentContext` as well.
 
+use crate::prelude::*;
 use crate::runtime::vm::{
     SendSyncPtr, Store, VMArrayCallFunction, VMFuncRef, VMGlobalDefinition, VMMemoryDefinition,
     VMOpaqueContext, VMWasmCallFunction, ValRaw,
 };
 use alloc::alloc::Layout;
 use alloc::sync::Arc;
-use anyhow::Result;
 use core::any::Any;
 use core::marker;
 use core::mem;
diff --git a/crates/wasmtime/src/runtime/vm/component/libcalls.rs b/crates/wasmtime/src/runtime/vm/component/libcalls.rs
index 7b6c05d5f..34d2a0c18 100644
--- a/crates/wasmtime/src/runtime/vm/component/libcalls.rs
+++ b/crates/wasmtime/src/runtime/vm/component/libcalls.rs
@@ -1,7 +1,7 @@
 //! Implementation of string transcoding required by the component model.
 
+use crate::prelude::*;
 use crate::runtime::vm::component::{ComponentInstance, VMComponentContext};
-use anyhow::{anyhow, Result};
 use core::cell::Cell;
 use core::slice;
 use wasmtime_environ::component::TypeResourceTableIndex;
diff --git a/crates/wasmtime/src/runtime/vm/component/resources.rs b/crates/wasmtime/src/runtime/vm/component/resources.rs
index 9b1c4023c..8ea8b7f15 100644
--- a/crates/wasmtime/src/runtime/vm/component/resources.rs
+++ b/crates/wasmtime/src/runtime/vm/component/resources.rs
@@ -24,7 +24,6 @@
 //! namely in the `Resource<T>` and `ResourceAny` types.
 
 use crate::prelude::*;
-use anyhow::{bail, Result};
 use core::mem;
 use wasmtime_environ::component::TypeResourceTableIndex;
 use wasmtime_environ::PrimaryMap;
diff --git a/crates/wasmtime/src/runtime/vm/const_expr.rs b/crates/wasmtime/src/runtime/vm/const_expr.rs
index 48d809da2..55a6d0a8f 100644
--- a/crates/wasmtime/src/runtime/vm/const_expr.rs
+++ b/crates/wasmtime/src/runtime/vm/const_expr.rs
@@ -1,7 +1,7 @@
 //! Evaluating const expressions.
 
+use crate::prelude::*;
 use crate::runtime::vm::{Instance, VMGcRef, ValRaw, I31};
-use anyhow::{anyhow, bail, Result};
 use smallvec::SmallVec;
 use wasmtime_environ::{ConstExpr, FuncIndex, GlobalIndex, Module};
 
diff --git a/crates/wasmtime/src/runtime/vm/cow.rs b/crates/wasmtime/src/runtime/vm/cow.rs
index d5325ca88..5a458d7fc 100644
--- a/crates/wasmtime/src/runtime/vm/cow.rs
+++ b/crates/wasmtime/src/runtime/vm/cow.rs
@@ -5,7 +5,6 @@ use crate::prelude::*;
 use crate::runtime::vm::sys::vm::{self, MemoryImageSource};
 use crate::runtime::vm::{MmapVec, SendSyncPtr};
 use alloc::sync::Arc;
-use anyhow::Result;
 use core::ffi::c_void;
 use core::ops::Range;
 use core::ptr::{self, NonNull};
@@ -744,11 +743,10 @@ impl Drop for MemoryImageSlot {
 
 #[cfg(all(test, target_os = "linux", not(miri)))]
 mod test {
-    use super::{MemoryImage, MemoryImageSlot, MemoryImageSource, MemoryPlan, MemoryStyle};
+    use super::*;
     use crate::runtime::vm::host_page_size;
     use crate::runtime::vm::mmap::Mmap;
     use crate::runtime::vm::sys::vm::decommit_pages;
-    use anyhow::Result;
     use std::sync::Arc;
     use wasmtime_environ::Memory;
 
diff --git a/crates/wasmtime/src/runtime/vm/gc.rs b/crates/wasmtime/src/runtime/vm/gc.rs
index a208babdb..e8e6ecc09 100644
--- a/crates/wasmtime/src/runtime/vm/gc.rs
+++ b/crates/wasmtime/src/runtime/vm/gc.rs
@@ -20,7 +20,6 @@ pub use i31::*;
 
 use crate::prelude::*;
 use crate::runtime::vm::GcHeapAllocationIndex;
-use anyhow::{bail, Result};
 use core::ptr;
 use core::{any::Any, num::NonZeroUsize};
 use wasmtime_environ::StackMap;
diff --git a/crates/wasmtime/src/runtime/vm/gc/disabled.rs b/crates/wasmtime/src/runtime/vm/gc/disabled.rs
index 2a7572a0a..3c905e7b8 100644
--- a/crates/wasmtime/src/runtime/vm/gc/disabled.rs
+++ b/crates/wasmtime/src/runtime/vm/gc/disabled.rs
@@ -7,7 +7,6 @@
 
 use crate::prelude::*;
 use crate::runtime::vm::{GcHeap, GcRuntime};
-use anyhow::Result;
 
 pub fn default_gc_runtime() -> impl GcRuntime {
     DisabledCollector
diff --git a/crates/wasmtime/src/runtime/vm/gc/enabled/drc.rs b/crates/wasmtime/src/runtime/vm/gc/enabled/drc.rs
index 3ca002852..ce49c3474 100644
--- a/crates/wasmtime/src/runtime/vm/gc/enabled/drc.rs
+++ b/crates/wasmtime/src/runtime/vm/gc/enabled/drc.rs
@@ -47,7 +47,6 @@ use crate::runtime::vm::{
     ExternRefHostDataId, ExternRefHostDataTable, GarbageCollection, GcHeap, GcHeapObject,
     GcProgress, GcRootsIter, GcRuntime, Mmap, TypedGcRef, VMExternRef, VMGcHeader, VMGcRef,
 };
-use anyhow::Result;
 use core::ops::{Deref, DerefMut};
 use core::{
     alloc::Layout,
diff --git a/crates/wasmtime/src/runtime/vm/gc/enabled/free_list.rs b/crates/wasmtime/src/runtime/vm/gc/enabled/free_list.rs
index 332bd60fd..4aaf194b0 100644
--- a/crates/wasmtime/src/runtime/vm/gc/enabled/free_list.rs
+++ b/crates/wasmtime/src/runtime/vm/gc/enabled/free_list.rs
@@ -1,6 +1,5 @@
 use crate::prelude::*;
 use alloc::collections::BTreeMap;
-use anyhow::{anyhow, ensure, Context, Result};
 use core::cmp;
 use core::{alloc::Layout, num::NonZeroU32, ops::Bound};
 
diff --git a/crates/wasmtime/src/runtime/vm/gc/gc_ref.rs b/crates/wasmtime/src/runtime/vm/gc/gc_ref.rs
index de766d8d8..c624a2371 100644
--- a/crates/wasmtime/src/runtime/vm/gc/gc_ref.rs
+++ b/crates/wasmtime/src/runtime/vm/gc/gc_ref.rs
@@ -1,6 +1,5 @@
 use crate::prelude::*;
 use crate::runtime::vm::{GcHeap, GcStore, I31};
-use anyhow::{Context, Result};
 use core::fmt;
 use core::marker;
 use core::num::NonZeroU32;
diff --git a/crates/wasmtime/src/runtime/vm/gc/gc_runtime.rs b/crates/wasmtime/src/runtime/vm/gc/gc_runtime.rs
index e19c1bfaa..62f65e44e 100644
--- a/crates/wasmtime/src/runtime/vm/gc/gc_runtime.rs
+++ b/crates/wasmtime/src/runtime/vm/gc/gc_runtime.rs
@@ -4,7 +4,6 @@ use crate::prelude::*;
 use crate::runtime::vm::{
     ExternRefHostDataId, ExternRefHostDataTable, SendSyncPtr, VMExternRef, VMGcHeader, VMGcRef,
 };
-use anyhow::Result;
 use core::marker;
 use core::ptr;
 use core::{any::Any, num::NonZeroUsize};
diff --git a/crates/wasmtime/src/runtime/vm/instance.rs b/crates/wasmtime/src/runtime/vm/instance.rs
index a46ffb508..fe3fbe6a2 100644
--- a/crates/wasmtime/src/runtime/vm/instance.rs
+++ b/crates/wasmtime/src/runtime/vm/instance.rs
@@ -17,7 +17,6 @@ use crate::runtime::vm::{
     SendSyncPtr, Store, VMFunctionBody, VMGcRef, WasmFault,
 };
 use alloc::sync::Arc;
-use anyhow::{Error, Result};
 use core::alloc::Layout;
 use core::any::Any;
 use core::ops::Range;
@@ -28,9 +27,9 @@ use sptr::Strict;
 use wasmtime_environ::{
     packed_option::ReservedValue, DataIndex, DefinedGlobalIndex, DefinedMemoryIndex,
     DefinedTableIndex, ElemIndex, EntityIndex, EntityRef, EntitySet, FuncIndex, GlobalIndex,
-    HostPtr, MemoryIndex, MemoryPlan, Module, ModuleInternedTypeIndex, PrimaryMap, TableIndex,
-    TableInitialValue, TableSegmentElements, Trap, VMOffsets, VMSharedTypeIndex, WasmHeapTopType,
-    VMCONTEXT_MAGIC,
+    HostPtr, MemoryIndex, MemoryPlan, Module, ModuleInternedTypeIndex, PrimaryMap, PtrSize,
+    TableIndex, TableInitialValue, TableSegmentElements, Trap, VMOffsets, VMSharedTypeIndex,
+    WasmHeapTopType, VMCONTEXT_MAGIC,
 };
 #[cfg(feature = "wmemcheck")]
 use wasmtime_wmemcheck::Wmemcheck;
@@ -247,16 +246,16 @@ impl Instance {
     ///
     /// This method is unsafe because the `offset` must be within bounds of the
     /// `VMContext` object trailing this instance.
-    unsafe fn vmctx_plus_offset<T>(&self, offset: u32) -> *const T {
+    unsafe fn vmctx_plus_offset<T>(&self, offset: impl Into<u32>) -> *const T {
         self.vmctx()
-            .byte_add(usize::try_from(offset).unwrap())
+            .byte_add(usize::try_from(offset.into()).unwrap())
             .cast()
     }
 
     /// Dual of `vmctx_plus_offset`, but for mutability.
-    unsafe fn vmctx_plus_offset_mut<T>(&mut self, offset: u32) -> *mut T {
+    unsafe fn vmctx_plus_offset_mut<T>(&mut self, offset: impl Into<u32>) -> *mut T {
         self.vmctx()
-            .byte_add(usize::try_from(offset).unwrap())
+            .byte_add(usize::try_from(offset.into()).unwrap())
             .cast()
     }
 
@@ -421,27 +420,27 @@ impl Instance {
     /// Return a pointer to the interrupts structure
     #[inline]
     pub fn runtime_limits(&mut self) -> *mut *const VMRuntimeLimits {
-        unsafe { self.vmctx_plus_offset_mut(self.offsets().vmctx_runtime_limits()) }
+        unsafe { self.vmctx_plus_offset_mut(self.offsets().ptr.vmctx_runtime_limits()) }
     }
 
     /// Return a pointer to the global epoch counter used by this instance.
     pub fn epoch_ptr(&mut self) -> *mut *const AtomicU64 {
-        unsafe { self.vmctx_plus_offset_mut(self.offsets().vmctx_epoch_ptr()) }
+        unsafe { self.vmctx_plus_offset_mut(self.offsets().ptr.vmctx_epoch_ptr()) }
     }
 
     /// Return a pointer to the GC heap base pointer.
     pub fn gc_heap_base(&mut self) -> *mut *mut u8 {
-        unsafe { self.vmctx_plus_offset_mut(self.offsets().vmctx_gc_heap_base()) }
+        unsafe { self.vmctx_plus_offset_mut(self.offsets().ptr.vmctx_gc_heap_base()) }
     }
 
     /// Return a pointer to the GC heap bound.
     pub fn gc_heap_bound(&mut self) -> *mut usize {
-        unsafe { self.vmctx_plus_offset_mut(self.offsets().vmctx_gc_heap_bound()) }
+        unsafe { self.vmctx_plus_offset_mut(self.offsets().ptr.vmctx_gc_heap_bound()) }
     }
 
     /// Return a pointer to the collector-specific heap data.
     pub fn gc_heap_data(&mut self) -> *mut *mut u8 {
-        unsafe { self.vmctx_plus_offset_mut(self.offsets().vmctx_gc_heap_data()) }
+        unsafe { self.vmctx_plus_offset_mut(self.offsets().ptr.vmctx_gc_heap_data()) }
     }
 
     /// Gets a pointer to this instance's `Store` which was originally
@@ -457,14 +456,14 @@ impl Instance {
     #[inline]
     pub fn store(&self) -> *mut dyn Store {
         let ptr =
-            unsafe { *self.vmctx_plus_offset::<*mut dyn Store>(self.offsets().vmctx_store()) };
+            unsafe { *self.vmctx_plus_offset::<*mut dyn Store>(self.offsets().ptr.vmctx_store()) };
         debug_assert!(!ptr.is_null());
         ptr
     }
 
     pub(crate) unsafe fn set_store(&mut self, store: Option<*mut dyn Store>) {
         if let Some(store) = store {
-            *self.vmctx_plus_offset_mut(self.offsets().vmctx_store()) = store;
+            *self.vmctx_plus_offset_mut(self.offsets().ptr.vmctx_store()) = store;
             *self.runtime_limits() = (*store).vmruntime_limits();
             *self.epoch_ptr() = (*store).epoch_ptr();
             self.set_gc_heap((*store).maybe_gc_store());
@@ -473,7 +472,7 @@ impl Instance {
                 mem::size_of::<*mut dyn Store>(),
                 mem::size_of::<[*mut (); 2]>()
             );
-            *self.vmctx_plus_offset_mut::<[*mut (); 2]>(self.offsets().vmctx_store()) =
+            *self.vmctx_plus_offset_mut::<[*mut (); 2]>(self.offsets().ptr.vmctx_store()) =
                 [ptr::null_mut(), ptr::null_mut()];
             *self.runtime_limits() = ptr::null_mut();
             *self.epoch_ptr() = ptr::null_mut();
@@ -494,7 +493,7 @@ impl Instance {
     }
 
     pub(crate) unsafe fn set_callee(&mut self, callee: Option<NonNull<VMFunctionBody>>) {
-        *self.vmctx_plus_offset_mut(self.offsets().vmctx_callee()) =
+        *self.vmctx_plus_offset_mut(self.offsets().ptr.vmctx_callee()) =
             callee.map_or(ptr::null_mut(), |c| c.as_ptr());
     }
 
@@ -718,7 +717,7 @@ impl Instance {
     ) {
         let type_index = unsafe {
             let base: *const VMSharedTypeIndex =
-                *self.vmctx_plus_offset_mut(self.offsets().vmctx_type_ids_array());
+                *self.vmctx_plus_offset_mut(self.offsets().ptr.vmctx_type_ids_array());
             *base.add(sig.index())
         };
 
@@ -1181,16 +1180,16 @@ impl Instance {
     ) {
         assert!(ptr::eq(module, self.module().as_ref()));
 
-        *self.vmctx_plus_offset_mut(offsets.vmctx_magic()) = VMCONTEXT_MAGIC;
+        *self.vmctx_plus_offset_mut(offsets.ptr.vmctx_magic()) = VMCONTEXT_MAGIC;
         self.set_callee(None);
         self.set_store(store.as_raw());
 
         // Initialize shared types
         let types = self.runtime_info.type_ids();
-        *self.vmctx_plus_offset_mut(offsets.vmctx_type_ids_array()) = types.as_ptr();
+        *self.vmctx_plus_offset_mut(offsets.ptr.vmctx_type_ids_array()) = types.as_ptr();
 
         // Initialize the built-in functions
-        *self.vmctx_plus_offset_mut(offsets.vmctx_builtin_functions()) =
+        *self.vmctx_plus_offset_mut(offsets.ptr.vmctx_builtin_functions()) =
             &VMBuiltinFunctionsArray::INIT;
 
         // Initialize the imports
diff --git a/crates/wasmtime/src/runtime/vm/instance/allocator.rs b/crates/wasmtime/src/runtime/vm/instance/allocator.rs
index 9aa881972..766293eab 100644
--- a/crates/wasmtime/src/runtime/vm/instance/allocator.rs
+++ b/crates/wasmtime/src/runtime/vm/instance/allocator.rs
@@ -6,7 +6,6 @@ use crate::runtime::vm::memory::Memory;
 use crate::runtime::vm::mpk::ProtectionKey;
 use crate::runtime::vm::table::Table;
 use crate::runtime::vm::{CompiledModuleId, ModuleRuntimeInfo, Store, VMFuncRef, VMGcRef};
-use anyhow::{bail, Result};
 use core::{any::Any, mem, ptr};
 use wasmtime_environ::{
     DefinedMemoryIndex, DefinedTableIndex, HostPtr, InitMemory, MemoryInitialization,
diff --git a/crates/wasmtime/src/runtime/vm/instance/allocator/on_demand.rs b/crates/wasmtime/src/runtime/vm/instance/allocator/on_demand.rs
index c7286c867..1f2dcb292 100644
--- a/crates/wasmtime/src/runtime/vm/instance/allocator/on_demand.rs
+++ b/crates/wasmtime/src/runtime/vm/instance/allocator/on_demand.rs
@@ -8,7 +8,6 @@ use crate::runtime::vm::mpk::ProtectionKey;
 use crate::runtime::vm::table::Table;
 use crate::runtime::vm::CompiledModuleId;
 use alloc::sync::Arc;
-use anyhow::Result;
 use wasmtime_environ::{
     DefinedMemoryIndex, DefinedTableIndex, HostPtr, MemoryPlan, Module, TablePlan, VMOffsets,
 };
diff --git a/crates/wasmtime/src/runtime/vm/instance/allocator/pooling.rs b/crates/wasmtime/src/runtime/vm/instance/allocator/pooling.rs
index 833e2e12c..b38c05e1e 100644
--- a/crates/wasmtime/src/runtime/vm/instance/allocator/pooling.rs
+++ b/crates/wasmtime/src/runtime/vm/instance/allocator/pooling.rs
@@ -52,7 +52,6 @@ use crate::runtime::vm::{
     mpk::{self, MpkEnabled, ProtectionKey, ProtectionMask},
     CompiledModuleId, Memory, Table,
 };
-use anyhow::{bail, Result};
 use std::borrow::Cow;
 use std::fmt::Display;
 use std::sync::{Mutex, MutexGuard};
diff --git a/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/gc_heap_pool.rs b/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/gc_heap_pool.rs
index 133e3ae3d..6cd793306 100644
--- a/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/gc_heap_pool.rs
+++ b/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/gc_heap_pool.rs
@@ -2,7 +2,6 @@ use super::index_allocator::{SimpleIndexAllocator, SlotId};
 use super::GcHeapAllocationIndex;
 use crate::prelude::*;
 use crate::runtime::vm::{GcHeap, GcRuntime, PoolingInstanceAllocatorConfig, Result};
-use anyhow::anyhow;
 use std::sync::Mutex;
 
 /// A pool of reusable GC heaps.
diff --git a/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/generic_stack_pool.rs b/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/generic_stack_pool.rs
index 659d06345..0c2a4f1ec 100644
--- a/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/generic_stack_pool.rs
+++ b/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/generic_stack_pool.rs
@@ -1,7 +1,7 @@
 #![cfg_attr(not(asan), allow(dead_code))]
 
+use crate::prelude::*;
 use crate::{runtime::vm::PoolingInstanceAllocatorConfig, PoolConcurrencyLimitError};
-use anyhow::{bail, Result};
 use std::sync::atomic::{AtomicU64, Ordering};
 
 /// A generic implementation of a stack pool.
diff --git a/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/memory_pool.rs b/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/memory_pool.rs
index ce7b68814..0abcfa79c 100644
--- a/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/memory_pool.rs
+++ b/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/memory_pool.rs
@@ -60,7 +60,6 @@ use crate::runtime::vm::{
     MpkEnabled, PoolingInstanceAllocatorConfig,
 };
 use crate::{prelude::*, vm::round_usize_up_to_host_pages};
-use anyhow::{anyhow, bail, Context, Result};
 use std::ffi::c_void;
 use std::sync::atomic::{AtomicUsize, Ordering};
 use std::sync::Mutex;
diff --git a/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/table_pool.rs b/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/table_pool.rs
index 1bbeafc1d..c67d43214 100644
--- a/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/table_pool.rs
+++ b/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/table_pool.rs
@@ -2,11 +2,11 @@ use super::{
     index_allocator::{SimpleIndexAllocator, SlotId},
     round_up_to_pow2, TableAllocationIndex,
 };
+use crate::prelude::*;
 use crate::runtime::vm::{
     InstanceAllocationRequest, Mmap, PoolingInstanceAllocatorConfig, SendSyncPtr, Table,
 };
 use crate::{runtime::vm::sys::vm::commit_pages, vm::round_usize_up_to_host_pages};
-use anyhow::{anyhow, bail, Context, Result};
 use std::mem;
 use std::ptr::NonNull;
 use wasmtime_environ::{Module, TablePlan};
diff --git a/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/unix_stack_pool.rs b/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/unix_stack_pool.rs
index ce6bebf13..2bfe64612 100644
--- a/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/unix_stack_pool.rs
+++ b/crates/wasmtime/src/runtime/vm/instance/allocator/pooling/unix_stack_pool.rs
@@ -4,9 +4,9 @@ use super::{
     index_allocator::{SimpleIndexAllocator, SlotId},
     round_up_to_pow2,
 };
+use crate::prelude::*;
 use crate::runtime::vm::sys::vm::commit_pages;
 use crate::runtime::vm::{round_usize_up_to_host_pages, Mmap, PoolingInstanceAllocatorConfig};
-use anyhow::{anyhow, bail, Context, Result};
 
 /// Represents a pool of execution stacks (used for the async fiber implementation).
 ///
@@ -213,7 +213,6 @@ impl StackPool {
 #[cfg(test)]
 mod tests {
     use super::*;
-    use crate::prelude::*;
     use crate::runtime::vm::InstanceLimits;
 
     #[cfg(all(unix, target_pointer_width = "64", feature = "async", not(miri)))]
diff --git a/crates/wasmtime/src/runtime/vm/libcalls.rs b/crates/wasmtime/src/runtime/vm/libcalls.rs
index e8ee64dcf..a514e9381 100644
--- a/crates/wasmtime/src/runtime/vm/libcalls.rs
+++ b/crates/wasmtime/src/runtime/vm/libcalls.rs
@@ -54,12 +54,10 @@
 //! }
 //! ```
 
+use crate::prelude::*;
 use crate::runtime::vm::table::{Table, TableElementType};
 use crate::runtime::vm::vmcontext::VMFuncRef;
 use crate::runtime::vm::{Instance, TrapReason, VMGcRef};
-#[cfg(feature = "wmemcheck")]
-use anyhow::bail;
-use anyhow::Result;
 #[cfg(feature = "threads")]
 use core::time::Duration;
 use wasmtime_environ::{DataIndex, ElemIndex, FuncIndex, MemoryIndex, TableIndex, Trap, Unsigned};
diff --git a/crates/wasmtime/src/runtime/vm/memory.rs b/crates/wasmtime/src/runtime/vm/memory.rs
index 6425593b7..d36ea1dc6 100644
--- a/crates/wasmtime/src/runtime/vm/memory.rs
+++ b/crates/wasmtime/src/runtime/vm/memory.rs
@@ -10,8 +10,6 @@ use crate::runtime::vm::{
     MemoryImageSlot, SendSyncPtr, SharedMemory, Store, WaitResult,
 };
 use alloc::sync::Arc;
-use anyhow::Error;
-use anyhow::{bail, format_err, Result};
 use core::ops::Range;
 use core::ptr::NonNull;
 use core::time::Duration;
diff --git a/crates/wasmtime/src/runtime/vm/mmap.rs b/crates/wasmtime/src/runtime/vm/mmap.rs
index 1135733bd..2d955d5eb 100644
--- a/crates/wasmtime/src/runtime/vm/mmap.rs
+++ b/crates/wasmtime/src/runtime/vm/mmap.rs
@@ -3,7 +3,6 @@
 
 use crate::runtime::vm::sys::mmap;
 use crate::{prelude::*, vm::usize_is_multiple_of_host_page_size};
-use anyhow::{Context, Result};
 use core::ops::Range;
 #[cfg(feature = "std")]
 use std::{fs::File, path::Path, sync::Arc};
diff --git a/crates/wasmtime/src/runtime/vm/mmap_vec.rs b/crates/wasmtime/src/runtime/vm/mmap_vec.rs
index 05e412ab9..6c67eadc1 100644
--- a/crates/wasmtime/src/runtime/vm/mmap_vec.rs
+++ b/crates/wasmtime/src/runtime/vm/mmap_vec.rs
@@ -1,7 +1,6 @@
 use crate::prelude::*;
 use crate::runtime::vm::Mmap;
 use alloc::sync::Arc;
-use anyhow::Result;
 use core::ops::{Deref, DerefMut, Range};
 #[cfg(feature = "std")]
 use std::{fs::File, path::Path};
@@ -64,8 +63,6 @@ impl MmapVec {
     /// it's too large to be fully mapped into memory.
     #[cfg(feature = "std")]
     pub fn from_file(path: &Path) -> Result<MmapVec> {
-        use anyhow::Context;
-
         let mmap = Mmap::from_file(path)
             .with_context(|| format!("failed to create mmap for file: {}", path.display()))?;
         let len = mmap.len();
diff --git a/crates/wasmtime/src/runtime/vm/mpk/disabled.rs b/crates/wasmtime/src/runtime/vm/mpk/disabled.rs
index fbfd95e08..52370215f 100644
--- a/crates/wasmtime/src/runtime/vm/mpk/disabled.rs
+++ b/crates/wasmtime/src/runtime/vm/mpk/disabled.rs
@@ -3,7 +3,7 @@
 
 #![allow(missing_docs)]
 
-use anyhow::Result;
+use crate::prelude::*;
 
 pub fn is_supported() -> bool {
     false
diff --git a/crates/wasmtime/src/runtime/vm/mpk/enabled.rs b/crates/wasmtime/src/runtime/vm/mpk/enabled.rs
index 504d2d385..21fc058b6 100644
--- a/crates/wasmtime/src/runtime/vm/mpk/enabled.rs
+++ b/crates/wasmtime/src/runtime/vm/mpk/enabled.rs
@@ -2,7 +2,6 @@
 
 use super::{pkru, sys};
 use crate::prelude::*;
-use anyhow::{Context, Result};
 use std::sync::OnceLock;
 
 /// Check if the MPK feature is supported.
diff --git a/crates/wasmtime/src/runtime/vm/mpk/sys.rs b/crates/wasmtime/src/runtime/vm/mpk/sys.rs
index c3799b07b..002163c47 100644
--- a/crates/wasmtime/src/runtime/vm/mpk/sys.rs
+++ b/crates/wasmtime/src/runtime/vm/mpk/sys.rs
@@ -9,8 +9,8 @@
 //! [`pkey_mprotect`]: https://man7.org/linux/man-pages/man2/pkey_mprotect.2.html
 //! [`pkeys`]: https://man7.org/linux/man-pages/man7/pkeys.7.html
 
+use crate::prelude::*;
 use crate::runtime::vm::host_page_size;
-use anyhow::Result;
 use std::io::Error;
 
 /// Protection mask disallowing reads and writes of pkey-protected memory (see
@@ -74,7 +74,6 @@ pub fn pkey_mprotect(addr: usize, len: usize, prot: u32, key: u32) -> Result<()>
 #[cfg(test)]
 mod tests {
     use super::*;
-    use crate::prelude::*;
 
     #[ignore = "cannot be run when keys() has already allocated all keys"]
     #[test]
diff --git a/crates/wasmtime/src/runtime/vm/sys/custom/mmap.rs b/crates/wasmtime/src/runtime/vm/sys/custom/mmap.rs
index de3f6bf66..171cf010a 100644
--- a/crates/wasmtime/src/runtime/vm/sys/custom/mmap.rs
+++ b/crates/wasmtime/src/runtime/vm/sys/custom/mmap.rs
@@ -1,7 +1,7 @@
 use super::cvt;
+use crate::prelude::*;
 use crate::runtime::vm::sys::capi;
 use crate::runtime::vm::SendSyncPtr;
-use anyhow::Result;
 use core::ops::Range;
 use core::ptr::{self, NonNull};
 #[cfg(feature = "std")]
diff --git a/crates/wasmtime/src/runtime/vm/sys/custom/mod.rs b/crates/wasmtime/src/runtime/vm/sys/custom/mod.rs
index d60c86e06..271479165 100644
--- a/crates/wasmtime/src/runtime/vm/sys/custom/mod.rs
+++ b/crates/wasmtime/src/runtime/vm/sys/custom/mod.rs
@@ -8,7 +8,7 @@
 //! For more information about this see `./examples/min-platform` as well as
 //! `./docs/examples-minimal.md`.
 
-use anyhow::{bail, Result};
+use crate::prelude::*;
 
 pub mod capi;
 pub mod mmap;
diff --git a/crates/wasmtime/src/runtime/vm/sys/custom/unwind.rs b/crates/wasmtime/src/runtime/vm/sys/custom/unwind.rs
index d6181940c..0387893b7 100644
--- a/crates/wasmtime/src/runtime/vm/sys/custom/unwind.rs
+++ b/crates/wasmtime/src/runtime/vm/sys/custom/unwind.rs
@@ -1,6 +1,6 @@
 #![allow(missing_docs)]
 
-use anyhow::Result;
+use crate::prelude::*;
 
 pub struct UnwindRegistration {}
 
diff --git a/crates/wasmtime/src/runtime/vm/sys/custom/vm.rs b/crates/wasmtime/src/runtime/vm/sys/custom/vm.rs
index 4a90406ad..e7f79e41c 100644
--- a/crates/wasmtime/src/runtime/vm/sys/custom/vm.rs
+++ b/crates/wasmtime/src/runtime/vm/sys/custom/vm.rs
@@ -1,8 +1,8 @@
 use super::cvt;
+use crate::prelude::*;
 use crate::runtime::vm::sys::capi;
 use crate::runtime::vm::SendSyncPtr;
 use crate::vm::sys::DecommitBehavior;
-use anyhow::Result;
 use core::ptr::{self, NonNull};
 #[cfg(feature = "std")]
 use std::{fs::File, sync::Arc};
diff --git a/crates/wasmtime/src/runtime/vm/sys/miri/mmap.rs b/crates/wasmtime/src/runtime/vm/sys/miri/mmap.rs
index 1a4d33079..de2a6aa3f 100644
--- a/crates/wasmtime/src/runtime/vm/sys/miri/mmap.rs
+++ b/crates/wasmtime/src/runtime/vm/sys/miri/mmap.rs
@@ -5,8 +5,8 @@
 //! like becoming executable or becoming readonly or being created from files,
 //! but it's enough to get various tests running relying on memories and such.
 
+use crate::prelude::*;
 use crate::runtime::vm::SendSyncPtr;
-use anyhow::{bail, Result};
 use std::alloc::{self, Layout};
 use std::fs::File;
 use std::ops::Range;
diff --git a/crates/wasmtime/src/runtime/vm/sys/miri/unwind.rs b/crates/wasmtime/src/runtime/vm/sys/miri/unwind.rs
index d6181940c..0387893b7 100644
--- a/crates/wasmtime/src/runtime/vm/sys/miri/unwind.rs
+++ b/crates/wasmtime/src/runtime/vm/sys/miri/unwind.rs
@@ -1,6 +1,6 @@
 #![allow(missing_docs)]
 
-use anyhow::Result;
+use crate::prelude::*;
 
 pub struct UnwindRegistration {}
 
diff --git a/crates/wasmtime/src/runtime/vm/sys/unix/mmap.rs b/crates/wasmtime/src/runtime/vm/sys/unix/mmap.rs
index 65c5df386..9048e2216 100644
--- a/crates/wasmtime/src/runtime/vm/sys/unix/mmap.rs
+++ b/crates/wasmtime/src/runtime/vm/sys/unix/mmap.rs
@@ -1,6 +1,5 @@
 use crate::prelude::*;
 use crate::runtime::vm::SendSyncPtr;
-use anyhow::Result;
 use rustix::mm::{mprotect, MprotectFlags};
 use std::ops::Range;
 use std::ptr::{self, NonNull};
@@ -52,8 +51,6 @@ impl Mmap {
 
     #[cfg(feature = "std")]
     pub fn from_file(path: &Path) -> Result<(Self, File)> {
-        use anyhow::Context;
-
         let file = File::open(path)
             .err2anyhow()
             .context("failed to open file")?;
diff --git a/crates/wasmtime/src/runtime/vm/sys/unix/unwind.rs b/crates/wasmtime/src/runtime/vm/sys/unix/unwind.rs
index 9b8137118..7ab9a7360 100644
--- a/crates/wasmtime/src/runtime/vm/sys/unix/unwind.rs
+++ b/crates/wasmtime/src/runtime/vm/sys/unix/unwind.rs
@@ -2,7 +2,6 @@
 
 use crate::prelude::*;
 use crate::runtime::vm::SendSyncPtr;
-use anyhow::Result;
 use core::ptr::{self, NonNull};
 use core::sync::atomic::{AtomicUsize, Ordering::Relaxed};
 
diff --git a/crates/wasmtime/src/runtime/vm/sys/windows/mmap.rs b/crates/wasmtime/src/runtime/vm/sys/windows/mmap.rs
index e9d156b48..d4d62061e 100644
--- a/crates/wasmtime/src/runtime/vm/sys/windows/mmap.rs
+++ b/crates/wasmtime/src/runtime/vm/sys/windows/mmap.rs
@@ -1,6 +1,5 @@
 use crate::prelude::*;
 use crate::runtime::vm::SendSyncPtr;
-use anyhow::{anyhow, bail, Context, Result};
 use std::fs::{File, OpenOptions};
 use std::io;
 use std::ops::Range;
diff --git a/crates/wasmtime/src/runtime/vm/sys/windows/unwind.rs b/crates/wasmtime/src/runtime/vm/sys/windows/unwind.rs
index 30f136180..eb559302b 100644
--- a/crates/wasmtime/src/runtime/vm/sys/windows/unwind.rs
+++ b/crates/wasmtime/src/runtime/vm/sys/windows/unwind.rs
@@ -1,6 +1,6 @@
 //! Module for Windows x64 ABI unwind registry.
 
-use anyhow::{bail, Result};
+use crate::prelude::*;
 use std::mem;
 use windows_sys::Win32::System::Diagnostics::Debug::*;
 
diff --git a/crates/wasmtime/src/runtime/vm/table.rs b/crates/wasmtime/src/runtime/vm/table.rs
index f8e9b4124..0e3b56632 100644
--- a/crates/wasmtime/src/runtime/vm/table.rs
+++ b/crates/wasmtime/src/runtime/vm/table.rs
@@ -7,7 +7,6 @@
 use crate::prelude::*;
 use crate::runtime::vm::vmcontext::{VMFuncRef, VMTableDefinition};
 use crate::runtime::vm::{GcStore, SendSyncPtr, Store, VMGcRef};
-use anyhow::{bail, ensure, format_err, Error, Result};
 use core::cmp;
 use core::ops::Range;
 use core::ptr::{self, NonNull};
diff --git a/crates/wasmtime/src/runtime/vm/threads/shared_memory.rs b/crates/wasmtime/src/runtime/vm/threads/shared_memory.rs
index 7e5eb906c..b62ce1f54 100644
--- a/crates/wasmtime/src/runtime/vm/threads/shared_memory.rs
+++ b/crates/wasmtime/src/runtime/vm/threads/shared_memory.rs
@@ -3,8 +3,6 @@ use crate::runtime::vm::memory::{validate_atomic_addr, MmapMemory};
 use crate::runtime::vm::threads::parking_spot::{ParkingSpot, Waiter};
 use crate::runtime::vm::vmcontext::VMMemoryDefinition;
 use crate::runtime::vm::{Memory, RuntimeLinearMemory, Store, WaitResult};
-use anyhow::Error;
-use anyhow::{bail, Result};
 use std::cell::RefCell;
 use std::ops::Range;
 use std::sync::atomic::{AtomicU32, AtomicU64, Ordering};
diff --git a/crates/wasmtime/src/runtime/vm/threads/shared_memory_disabled.rs b/crates/wasmtime/src/runtime/vm/threads/shared_memory_disabled.rs
index 0ce4cf33a..4927918ce 100644
--- a/crates/wasmtime/src/runtime/vm/threads/shared_memory_disabled.rs
+++ b/crates/wasmtime/src/runtime/vm/threads/shared_memory_disabled.rs
@@ -2,7 +2,6 @@
 
 use crate::prelude::*;
 use crate::runtime::vm::{RuntimeLinearMemory, Store, VMMemoryDefinition, WaitResult};
-use anyhow::{bail, Result};
 use core::ops::Range;
 use core::time::Duration;
 use wasmtime_environ::{MemoryPlan, Trap};
diff --git a/crates/wasmtime/src/runtime/vm/traphandlers.rs b/crates/wasmtime/src/runtime/vm/traphandlers.rs
index e68ff075f..1c0d8186d 100644
--- a/crates/wasmtime/src/runtime/vm/traphandlers.rs
+++ b/crates/wasmtime/src/runtime/vm/traphandlers.rs
@@ -14,7 +14,6 @@ use crate::prelude::*;
 use crate::runtime::vm::sys::traphandlers;
 use crate::runtime::vm::{Instance, VMContext, VMRuntimeLimits};
 use crate::sync::OnceLock;
-use anyhow::Error;
 use core::cell::{Cell, UnsafeCell};
 use core::mem::MaybeUninit;
 use core::ptr;
diff --git a/crates/wasmtime/src/runtime/vm/vmcontext.rs b/crates/wasmtime/src/runtime/vm/vmcontext.rs
index 6530399ae..d9da984eb 100644
--- a/crates/wasmtime/src/runtime/vm/vmcontext.rs
+++ b/crates/wasmtime/src/runtime/vm/vmcontext.rs
@@ -840,16 +840,6 @@ mod test_vmruntime_limits {
     use std::mem::size_of;
     use wasmtime_environ::{Module, PtrSize, VMOffsets};
 
-    #[test]
-    fn vmctx_runtime_limits_offset() {
-        let module = Module::new();
-        let offsets = VMOffsets::new(size_of::<*mut u8>() as u8, &module);
-        assert_eq!(
-            offsets.vmctx_runtime_limits(),
-            u32::from(offsets.ptr.vmcontext_runtime_limits())
-        );
-    }
-
     #[test]
     fn field_offsets() {
         let module = Module::new();
diff --git a/winch/codegen/src/codegen/mod.rs b/winch/codegen/src/codegen/mod.rs
index 07d60ed69..4752bdddc 100644
--- a/winch/codegen/src/codegen/mod.rs
+++ b/winch/codegen/src/codegen/mod.rs
@@ -328,13 +328,13 @@ where
             .as_u32()
             .checked_mul(sig_index_bytes.into())
             .unwrap();
-        let signatures_base_offset = self.env.vmoffsets.vmctx_type_ids_array();
+        let signatures_base_offset = self.env.vmoffsets.ptr.vmctx_type_ids_array();
         let scratch = <M::ABI as ABI>::scratch_reg();
         let funcref_sig_offset = self.env.vmoffsets.ptr.vm_func_ref_type_index();
 
         // Load the signatures address into the scratch register.
         self.masm.load(
-            self.masm.address_at_vmctx(signatures_base_offset),
+            self.masm.address_at_vmctx(signatures_base_offset.into()),
             scratch,
             ptr_size,
         );


Test patch:
diff --git a/tests/all/pooling_allocator.rs b/tests/all/pooling_allocator.rs
index e6f51e5ac..d3d4424d7 100644
--- a/tests/all/pooling_allocator.rs
+++ b/tests/all/pooling_allocator.rs
@@ -648,6 +648,7 @@ fn instance_too_large() -> Result<()> {
 configured maximum of 16 bytes; breakdown of allocation requirement:
 
  * 72.73% - 256 bytes - instance state management
+ * 25.00% - 88 bytes - static vmctx data
 "
     } else {
         "\
@@ -655,7 +656,7 @@ instance allocation for this module requires 256 bytes which exceeds the \
 configured maximum of 16 bytes; breakdown of allocation requirement:
 
  * 62.50% - 160 bytes - instance state management
- * 6.25% - 16 bytes - jit store state
+ * 34.38% - 88 bytes - static vmctx data
 "
     };
     match Module::new(&engine, "(module)") {
diff --git a/tests/spec_testsuite b/tests/spec_testsuite
index 16a839d56..e05365077 160000
--- a/tests/spec_testsuite
+++ b/tests/spec_testsuite
@@ -1,1 +1,1 @@
-Subproject commit 16a839d5601c283541a84572b47637f035b51437
+Subproject commit e05365077e13a1d86ffe77acfb1a835b7aa78422
diff --git a/tests/wast.rs b/tests/wast.rs
index 8e5b38c85..076a6ccb3 100644
--- a/tests/wast.rs
+++ b/tests/wast.rs
@@ -78,6 +78,26 @@ fn ignore(test: &Path, strategy: Strategy) -> bool {
         if part == "extended-const" {
             return true;
         }
+        // Wasmtime doesn't implement the table64 extension yet.
+        if part == "memory64" {
+            if [
+                "call_indirect.wast",
+                "table_copy.wast",
+                "table_get.wast",
+                "table_set.wast",
+                "table_fill.wast",
+                "table.wast",
+                "table_init.wast",
+                "table_copy_mixed.wast",
+                "table_grow.wast",
+                "table_size.wast",
+            ]
+            .iter()
+            .any(|i| test.ends_with(i))
+            {
+                return true;
+            }
+        }
 
         // TODO(#6530): These tests require tail calls, but s390x doesn't
         // support them yet.
@@ -175,6 +195,7 @@ fn ignore(test: &Path, strategy: Strategy) -> bool {
                 "type-subtyping.wast",
                 "unreached-invalid.wast",
                 "unreached_valid.wast",
+                "i31.wast",
             ]
             .iter()
             .any(|i| test.ends_with(i));