Skip to content

cranelift-wasm: Add a small optimization for dynamic memories with min_size == max_size#7374

Merged
fitzgen merged 3 commits intobytecodealliance:mainfrom
fitzgen:dynamic-memories-with-constant-size
Oct 25, 2023
Merged

cranelift-wasm: Add a small optimization for dynamic memories with min_size == max_size#7374
fitzgen merged 3 commits intobytecodealliance:mainfrom
fitzgen:dynamic-memories-with-constant-size

Conversation

@fitzgen
Copy link
Copy Markdown
Member

@fitzgen fitzgen commented Oct 25, 2023

In this case, we don't need to load the dynamic heap bound from the vmctx
because it actually has a constant size. Instead, we can use the constant
directly.

…in_size == max_size`

In this case, we don't need to load the dynamic heap bound from the vmctx
because it actually has a constant size. Instead, we can use the constant
directly.
@fitzgen fitzgen requested review from a team as code owners October 25, 2023 21:39
@fitzgen fitzgen requested review from alexcrichton and cfallin and removed request for a team October 25, 2023 21:39
@fitzgen fitzgen changed the title Dynamic memories with constant size cranelift-wasm: Add a small optimization for dynamic memories with min_size == max_size Oct 25, 2023
Copy link
Copy Markdown
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.

Mind adding a test for a (memory 1 2) as well to ensure that a constant size isn't used?

@fitzgen fitzgen enabled auto-merge October 25, 2023 21:58
@fitzgen fitzgen added this pull request to the merge queue Oct 25, 2023
Merged via the queue into bytecodealliance:main with commit 952c6a5 Oct 25, 2023
@fitzgen fitzgen deleted the dynamic-memories-with-constant-size branch October 25, 2023 23:17
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