Skip to content

Const-propagate some offsets in VMOffsets - #8806

Merged
alexcrichton merged 2 commits into
bytecodealliance:mainfrom
alexcrichton:more-const-propagate
Jun 14, 2024
Merged

alexcrichton merged 2 commits into
bytecodealliance:mainfrom
alexcrichton:more-const-propagate

Conversation

@alexcrichton

Copy link
Copy Markdown
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 enabled auto-merge June 14, 2024 18:12
@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
@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.

2 participants