alexcrichton opened PR #11124 from alexcrichton:x64-cleanup-load-ext-name to bytecodealliance:main:
Don't use raw bytes when emitting this instruction but instead use
symbolic assembler directives to avoid needing to hardcode bytes. This
additionally fixes an issue where withcolocatedsymbols the offset of
the symbol was not taken into account (but for Wasmtime it's always been
0 so this otherwise hasn't come up so far)
alexcrichton requested cfallin for a review on PR #11124.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #11124.
cfallin submitted PR review:
Looks reasonable; thanks! Good catch handling the offsets.
cfallin commented on PR #11124:
(The
Reg->Gprrefactoring tripped up in thecranelift-codegentests, it seems)
alexcrichton updated PR #11124.
alexcrichton has enabled auto merge for PR #11124.
alexcrichton updated PR #11124.
alexcrichton updated PR #11124.
alexcrichton commented on PR #11124:
Ok to resolve the test failure I had to push up a semi-substantial change as the final commit here. cc @abrown on the assembler change, and mind taking another look @cfallin?
cfallin submitted PR review:
New approach looks reasonable, but deferring to @abrown for final opinions on the
CodeSinkrefactor...
cfallin created PR review comment:
Maybe a panic here with a panic message including
offset? Technically it's unreachable but the unreachability invariant is "remote" (part of another crate) so I'd rather make this easier debug / more verbose if we do miss something later...
cfallin created PR review comment:
grammar fix -- "inform ... of a use ... is about to happen" -> "inform ... that a use ... is about to happen"
cfallin created PR review comment:
s/the bytes are then placed/the bytes are then expected to be placed/
(it's part of the contract for what the caller must do, rather than a result of this method call, right?)
cfallin commented on PR #11124:
(Was this auto-added to merge queue? I gave r+ but Andrew should still weigh in and there were a few comment nits)
alexcrichton commented on PR #11124:
Oops I forgot to disable that and pushes from maintainers doesn't auto-disable it, thanks for catching!
alexcrichton updated PR #11124.
abrown created PR review comment:
Yup, this is better! Thanks for this refactor; I had been worrying a bit about how to get rid of the offset table.
abrown submitted PR review.
abrown created PR review comment:
I guess the decision here is to keep
asm::KnownOffsetas an index instead of converting it into anenum... I suppose there might be some generic way to pass around acranelift-codegen-specificKnownOffsettype to be a bit safer. But, honestly, that could come much later. This is better already.
abrown merged PR #11124.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Yeah I was brainstorming how to get a type in there (also for things like
ExternalNameor relocations) and my conclusion was that we'd have to changeenum Amode<R: AsReg>toenum Amode<R: Registers>and then also have:trait Registers { type CodeSink: CodeSink; // ... }and then store
<R::CodeSink as CodeSink>::KnownOffsetwithin anAmode.That all gets pretty hairy and relatively complicated so I decided to not go down that route quite yet...
Last updated: Dec 06 2025 at 07:03 UTC