Skip to content

Conversation

@posborne
Copy link
Owner

prtest

frank-emrich and others added 30 commits June 10, 2025 16:17
This initial commit represents the "pr2" base commit with
minimal merge conflicts resolved.  Due to OOB conflicts, this
commit is not functional as-is, but using it as a base in
order to allow for easier reviewing of the delta from
this commit to what will be used for the PR against upstream.

Co-authored-by: Daniel Hillerström <[email protected]>
Co-authored-by: Paul Osborne <[email protected]>
This first set of changes updates the base pr in order to
compiled and pass basic checks (compile, clippy, fmt) with
the biggest part of the change being to eliminate injection
of tracing/assertions in JIT'ed code.
At this point, the only bit we really branch on is what we
do in order to avoid problems tying into wasmtime_environ.
This is basd on the approach and macro used by the gc code for
converting presence/absence of the cranelift feature flag to
cranelift compile time.  This is a bit of a half-measure for now
as we still compile most stack-switching code in cranelift, but
this does enough to avoid causing problems with missing definitions
in wasmtime_environ.
Replace either with infallible From or fallible, panicing
TryFrom alternatives where required.
After removing emission of runtime trace logging and assertions,
there were several unused parameters.  Remove those from the
ControlEffect signatures completely.
This matches a change to the mirrored runtime type in
the upstream changes.
Co-authored-by: Daniel Hillerström <[email protected]>
The extra parameters here used to be used for emitting runtime
assertions, but with those gone we just had unused params
and lifetimes, clean those out.
There's already a stub elsewhere and this is not called, when
exceptions are added and it is time to revisit, this method
can be restored.
Rename VMHostArray -> VMHostArrayRef
Change impl to compute address with offset upfront rather than
on each load.
This matches the directory structure for gc and aids in visibility
for a few members required by stack-switching code in cranelift.
…nelift

As part of this, updated translate_ref_is_null to
use the wasm type rather than brancing on the ir type
being an i128.
In the course of the various runtime updates, the layout of the
runtime VMContObj got switched around.  This resulted in failures
when doing certain table operations on continuations.

This change fixes that layout problem and adds some tests with
offsets to avoid the problem.  Due to the way that we interact
with the VMContObj in cranelift, we don't use these offsets outside
of the tests.
This method isn't required as sized_stack_slots is already pub.
…nelift

Resolved a few conflicts manually, blessed disas tests,
and made a few non-conflicting updates to func_environ.rs
and code_translator.rs (but pretty trivial).
This change migrates VMContObj and its usages in cranelift and runtime
to work with the VMContObj fat pointer as two words in order to better
target different architectures (still gated to x86_64 for now).

To support this, a size type was plumbed into the builtins function
signature types (as is done for component types) that maps to
usize.
This type is not fully complete until continuation/gc integration
is revisited (bytecodealliance#10248) but without these changes, test cases are
now failing on panics as we need some representation of
continuation references in the runtime Val enumeration.

Runtime errors with TODO notes are added for the stubbed
code paths to revisit later.
Disas tests were failing on i686 targeting x86_64 as the size of the
host pointer was leaking into what we were using to do codegen
in a few paths.  This patch is a bit of a hack as it seems like
using a generic <T> for T: *mut u8 (as an example) is a bit
questionable.  To keep things small, I do a hacky typecheck to map
pointers to the target pointer size here.
@posborne posborne force-pushed the stack-switching-cranelift branch from 7a29573 to ed4b010 Compare August 29, 2025 18:22
Revisiting the previous commit with an approach that should be
less brittle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants