alexcrichton opened PR #3265 from no-copy-code-memory
to main
:
This commit moves a copy from compiled artifacts into a
CodeMemory
. In
general this commit drastically changes the meaning of aCodeMemory
.
Previously it was an iteratively-pushed-on structure that would
accumulate executable code over time. Afterwards, however, it's a
manager for anMmapVec
which updates the permissions on text section
to ensure that the pages are executable.By taking ownership of an
MmapVec
within aCodeMemory
there's no
need to copy any data around, which means that the.text
section in
the ELF image produced by Wasmtime is usable as-is after placement in
memory and relocations have been resolved. This moves Wasmtime one step
closer to being able to directly use a module after it'smmap
'd into
memory, optimizing when a module is loaded.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
alexcrichton edited PR #3265 from no-copy-code-memory
to main
:
This commit moves a copy from compiled artifacts into a
CodeMemory
. In
general this commit drastically changes the meaning of aCodeMemory
.
Previously it was an iteratively-pushed-on structure that would
accumulate executable code over time. Afterwards, however, it's a
manager for anMmapVec
which updates the permissions on text section
to ensure that the pages are executable.By taking ownership of an
MmapVec
within aCodeMemory
there's no
need to copy any data around, which means that the.text
section in
the ELF image produced by Wasmtime is usable as-is after placement in
memory and relocations have been resolved. This moves Wasmtime one step
closer to being able to directly use a module after it'smmap
'd into
memory, optimizing when a module is loaded.cc #3230
alexcrichton requested peterhuene for a review on PR #3265.
alexcrichton updated PR #3265 from no-copy-code-memory
to main
.
alexcrichton updated PR #3265 from no-copy-code-memory
to main
.
alexcrichton updated PR #3265 from no-copy-code-memory
to main
.
peterhuene submitted PR review.
peterhuene submitted PR review.
peterhuene created PR review comment:
.with_context(|| "failed to parse internal compilation artifact")?,
peterhuene created PR review comment:
/// `publish` method is used to actually make the memory executable.
alexcrichton updated PR #3265 from no-copy-code-memory
to main
.
alexcrichton merged PR #3265.
Last updated: Nov 22 2024 at 17:03 UTC