Stream: git-wasmtime

Topic: wasmtime / PR #2202 wasi common: move fs and path into En...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 15 2020 at 00:12):

pchickey opened PR #2202 from pch/wasi_common_move_entry_methods to main:

based on #2201

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Sep 15 2020 at 17:11):

pchickey updated PR #2202 from pch/wasi_common_move_entry_methods to main:

based on #2201

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Sep 15 2020 at 17:22):

pchickey updated PR #2202 from pch/wasi_common_move_entry_methods to main:

based on #2201

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Sep 15 2020 at 17:34):

pchickey updated PR #2202 from pch/wasi_common_move_entry_methods to main:

based on #2201

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Sep 15 2020 at 17:37):

pchickey edited PR #2202 from pch/wasi_common_move_entry_methods to main:

based on #2201

This PR refactors the bodies of all fs and path functions in snapshot 1 into Entry methods.

Anything that just requires an entry be in scope is moved to entry/fd.rs
and entry/path.rs, which just contain impl Entry blocks.

Additionally, the bodies of these functions were transformed so that as
much GuestPtr dereference as possible happens out in
wasi_snapshot_preview1. Entry methods just get a & T or &mut T
passed in.

However, there are a few functions where multiple GuestPtrs are passed
into a wasi_snapshot_preview1 function. We cannot safely dereference
both at once, because it is semantically valid for these memory
regions to overlap, but the wiggle borrow checker will refuse to
borrow overlapping regions. In these cases, we have to pass the GuestPtr
into the Entity method to be dereferenced in a smaller scope where
exclusive access is possible.

Additionally, we make the minor transformation so that crate::path::get becomes
Entry::path_get. This moves from src/path.rs to src/entry/path.rs. This is just code
motion and doesn't make a difference.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Sep 15 2020 at 17:46):

pchickey updated PR #2202 from pch/wasi_common_move_entry_methods to main:

based on #2201

This PR refactors the bodies of all fs and path functions in snapshot 1 into Entry methods.

Anything that just requires an entry be in scope is moved to entry/fd.rs
and entry/path.rs, which just contain impl Entry blocks.

Additionally, the bodies of these functions were transformed so that as
much GuestPtr dereference as possible happens out in
wasi_snapshot_preview1. Entry methods just get a & T or &mut T
passed in.

However, there are a few functions where multiple GuestPtrs are passed
into a wasi_snapshot_preview1 function. We cannot safely dereference
both at once, because it is semantically valid for these memory
regions to overlap, but the wiggle borrow checker will refuse to
borrow overlapping regions. In these cases, we have to pass the GuestPtr
into the Entity method to be dereferenced in a smaller scope where
exclusive access is possible.

Additionally, we make the minor transformation so that crate::path::get becomes
Entry::path_get. This moves from src/path.rs to src/entry/path.rs. This is just code
motion and doesn't make a difference.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2020 at 21:54):

pchickey updated PR #2202 from pch/wasi_common_move_entry_methods to main:

based on #2201

This PR refactors the bodies of all fs and path functions in snapshot 1 into Entry methods.

Anything that just requires an entry be in scope is moved to entry/fd.rs
and entry/path.rs, which just contain impl Entry blocks.

Additionally, the bodies of these functions were transformed so that as
much GuestPtr dereference as possible happens out in
wasi_snapshot_preview1. Entry methods just get a & T or &mut T
passed in.

However, there are a few functions where multiple GuestPtrs are passed
into a wasi_snapshot_preview1 function. We cannot safely dereference
both at once, because it is semantically valid for these memory
regions to overlap, but the wiggle borrow checker will refuse to
borrow overlapping regions. In these cases, we have to pass the GuestPtr
into the Entity method to be dereferenced in a smaller scope where
exclusive access is possible.

Additionally, we make the minor transformation so that crate::path::get becomes
Entry::path_get. This moves from src/path.rs to src/entry/path.rs. This is just code
motion and doesn't make a difference.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Sep 22 2020 at 20:42):

pchickey requested iximeow for a review on PR #2202.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 23 2020 at 21:44):

sunfishcode submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 10 2020 at 19:15):

pchickey updated PR #2202 from pch/wasi_common_move_entry_methods to main:

based on #2201

This PR refactors the bodies of all fs and path functions in snapshot 1 into Entry methods.

Anything that just requires an entry be in scope is moved to entry/fd.rs
and entry/path.rs, which just contain impl Entry blocks.

Additionally, the bodies of these functions were transformed so that as
much GuestPtr dereference as possible happens out in
wasi_snapshot_preview1. Entry methods just get a & T or &mut T
passed in.

However, there are a few functions where multiple GuestPtrs are passed
into a wasi_snapshot_preview1 function. We cannot safely dereference
both at once, because it is semantically valid for these memory
regions to overlap, but the wiggle borrow checker will refuse to
borrow overlapping regions. In these cases, we have to pass the GuestPtr
into the Entity method to be dereferenced in a smaller scope where
exclusive access is possible.

Additionally, we make the minor transformation so that crate::path::get becomes
Entry::path_get. This moves from src/path.rs to src/entry/path.rs. This is just code
motion and doesn't make a difference.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Dec 02 2020 at 21:23):

pchickey closed without merge PR #2202.


Last updated: Dec 23 2024 at 13:07 UTC