Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Wasmtime(gc): Support (ref.i31 (global.get $g)) const expressions #8450

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Apr 23, 2024

We had something hacked together to support (ref.i31 (i32.const N)). It wasn't a long-term solution. This is the first time that we have to really deal with multi-instruction const expressions.

This commit introduces a tiny interpreter to evaluate const expressions.

@fitzgen fitzgen requested review from a team as code owners April 23, 2024 21:29
@fitzgen fitzgen requested review from abrown and alexcrichton and removed request for a team April 23, 2024 21:29
@fitzgen fitzgen force-pushed the i31-global-initializers branch from 01dabb7 to 574f70a Compare April 23, 2024 21:30
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:wasm labels Apr 23, 2024
@fitzgen fitzgen force-pushed the i31-global-initializers branch from 574f70a to 53d8268 Compare April 23, 2024 22:05
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

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

Looks good to me, I think the organization worked out well here.

My main comment is that the unsafe methods feel a little too unsafe and while I don't think there's a whole lot that can be done about that I still think it would be good to at least assert that Concrete heap types are functions for now to avoid accidental confusion in the future.

We had something hacked together to support `(ref.i31 (i32.const N))`. It wasn't
a long-term solution. This is the first time that we have to really deal with
multi-instruction const expressions.

This commit introduces a tiny interpreter to evaluate const expressions.
@fitzgen fitzgen force-pushed the i31-global-initializers branch from 53d8268 to 19c2b23 Compare April 24, 2024 19:37
@fitzgen fitzgen enabled auto-merge April 24, 2024 19:40
@fitzgen fitzgen added this pull request to the merge queue Apr 24, 2024
Merged via the queue into bytecodealliance:main with commit 318eb36 Apr 24, 2024
21 checks passed
@fitzgen fitzgen deleted the i31-global-initializers branch April 24, 2024 20:23
alexcrichton added a commit to alexcrichton/wasmtime that referenced this pull request Aug 19, 2024
This commit builds on the support added in bytecodealliance#8450 to extend our simple
interpreter with support for the `extended-const` proposal to
WebAssembly. This is required when updating the spec-test-submodule
since `extended-const` was merged into the mainline specification and
some proposals are starting to rebase on that.
github-merge-queue bot pushed a commit that referenced this pull request Aug 19, 2024
This commit builds on the support added in #8450 to extend our simple
interpreter with support for the `extended-const` proposal to
WebAssembly. This is required when updating the spec-test-submodule
since `extended-const` was merged into the mainline specification and
some proposals are starting to rebase on that.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
cranelift:wasm cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants