Skip to content

[Stack Switching] wasm-ctor-eval: stop on serializing continuations to globals#8585

Merged
kripken merged 1 commit intoWebAssembly:mainfrom
kripken:ctor.cont.noglob
Apr 9, 2026
Merged

[Stack Switching] wasm-ctor-eval: stop on serializing continuations to globals#8585
kripken merged 1 commit intoWebAssembly:mainfrom
kripken:ctor.cont.noglob

Conversation

@kripken
Copy link
Copy Markdown
Member

@kripken kripken commented Apr 8, 2026

Continuations cannot be serialized.

@kripken kripken requested a review from a team as a code owner April 8, 2026 23:47
@kripken kripken requested review from stevenfontanella and removed request for a team April 8, 2026 23:47
Comment on lines +416 to +425
;; CHECK: (func $read (type $2) (result (ref null $cont))
;; CHECK-NEXT: (global.get $global)
;; CHECK-NEXT: )
;; NOKEEP: (func $read (type $2) (result (ref null $cont))
;; NOKEEP-NEXT: (global.get $global)
;; NOKEEP-NEXT: )
(func $read (export "read") (result (ref null $cont))
(global.get $global)
)
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I guess this isn't needed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above testcases use this pattern, because without it, the global is only written to and never read, so it can be trivially optimized out. I suspect this case might not need it as it can't optimize, but I think it's better to follow the shape of the above testcases so the diff compared to them is small and clear.

(Note that even if we don't need this now, we might need it later - ctor-eval runs a few opt passes after its work, and while simplify-globals, the pass that would remove the write-only global, is not yet run, we might add it later. Similar passes are already there.)

@kripken kripken merged commit d918f9c into WebAssembly:main Apr 9, 2026
16 checks passed
@kripken kripken deleted the ctor.cont.noglob branch April 9, 2026 16:03
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.

2 participants