jeffcharles requested elliottt for a review on PR #7993.
jeffcharles requested wasmtime-compiler-reviewers for a review on PR #7993.
jeffcharles opened PR #7993 from jeffcharles:fix-400-params-test
to bytecodealliance:main
:
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
Using 16 bits instead of 8 bits to track the register index allows us to support parameter lists that are longer than 400. It looks like v8 supports 1000 params.
jeffcharles requested wasmtime-default-reviewers for a review on PR #7993.
saulecabrera submitted PR review.
saulecabrera submitted PR review.
saulecabrera created PR review comment:
Could we also update the
aarch64
abi given that we're here? It still usesu8
.
jeffcharles submitted PR review.
jeffcharles created PR review comment:
I noticed the
RegIndexEnv
implementation inaarch64
returnsOption<u8>
with a value ofNone
if the index is incremented past thelimit
field and thelimit
field defaults to8
. There is one place where we callset_limit
with a value of1
. So as far as I can tell, if we had over 8 parameters, the increment function would no longer be called so, with more than 255 parameters, an overflow would not happen like was the case with the x86 implementation.Does it still make sense to use a
u16
instead of au8
?
jeffcharles updated PR #7993.
github-actions[bot] commented on PR #7993:
Subscribe to Label Action
cc @saulecabrera
<details>
This issue or pull request has been labeled: "winch"Thus the following users have been cc'd because of the following labels:
- saulecabrera: winch
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
saulecabrera submitted PR review.
saulecabrera created PR review comment:
Yeah good point -- thinking a bit more about this, I think that the root of the issue is the lack of limits for each register class. Perhaps instead of widening the type to
u16
we should add an upper-bound and makeincrement
returnNone
. The upper-bound could be either:
- A
limit
like in the case ofaarch64
, which could be derived from the calling convention.- Using a checked add in
increment
(u8::MAX
is good enough to represent the register arguments)
fitzgen commented on PR #7993:
Note that we follow the JS embedding limits in Wasmtime for maximum compatibility with Web engines: https://webassembly.github.io/spec/js-api/index.html#limits
jeffcharles updated PR #7993.
Last updated: Dec 23 2024 at 13:07 UTC