Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Const-propagate some offsets in VMOffsets #8806

Merged
merged 2 commits into from
Jun 14, 2024

Conversation

alexcrichton
Copy link
Member

Before this commit all offsets to all fields in VMOffsets were stored as fields within VMOffset itself. All of the fields at the start of VMOffsets, however, are statically known given the pointer size. Notably this means that the use of HostPtr in the runtime still was forcing a dynamic lookup of these static offsets.

This commit refactors this to reflect all static offsets based solely on the pointer size in the PtrSize trait, removing all the fields from VMOffsets. All the dynamically sized fields, however, remain in VMOffsets.

Before this commit all offsets to all fields in `VMOffsets` were stored
as fields within `VMOffset` itself. All of the fields at the start of
`VMOffsets`, however, are statically known given the pointer size.
Notably this means that the use of `HostPtr` in the runtime still was
forcing a dynamic lookup of these static offsets.

This commit refactors this to reflect all static offsets based solely on
the pointer size in the `PtrSize` trait, removing all the fields from
`VMOffsets`. All the dynamically sized fields, however, remain in
`VMOffsets`.
@alexcrichton alexcrichton requested review from a team as code owners June 14, 2024 17:35
@alexcrichton alexcrichton requested review from elliottt and removed request for a team June 14, 2024 17:35
@alexcrichton alexcrichton added this pull request to the merge queue Jun 14, 2024
Merged via the queue into bytecodealliance:main with commit eb85407 Jun 14, 2024
36 checks passed
@alexcrichton alexcrichton deleted the more-const-propagate branch June 14, 2024 18:35
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.

None yet

2 participants