forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use 128 bit fat pointers for continuation objects (bytecodealliance#186)
This PR changes the representation introduced in bytecodealliance#182 , where continuation objects were turned into tagged pointers, containing a pointer to a `VMContRef` as well as a 16bit sequence counter to perform linearity checks. In this PR, the representation is changed from 64bit tagged pointers to 128bit fat pointers, where 64bit are used for the pointer and the sequence counter. Some implementation details: - The design introduced in bytecodealliance#182, where we use `disassemble_contobj` and `assemble_contobj` to go from effectively `Optional<VMContObj>` to `Optional<VMContRef>` is preserved. - The feature `unsafe_disable_continuation_linearity_check` is preserved: If it is enabled, we do not use fat (or tagged) pointers at all, and all revision checks are disabled. - Overflow checks for the revision counter are no longer necessary and have been removed. - In wasm, we now use the SIMD type `I8X16` for any value of type `(ref $continuation)` and `(ref null $continuation)`. See the comment on `vm_contobj_type` in shared.rs for why we cannot use `I128` or `I64X2` instead. - Some `translate_*` functions in the `FuncEnvironment` trait now need to take a `FunctionBuilder` parameter, instead of `FuncCursor`, which slightly increases the footprint of this PR. - The implementation of `table.fill` for continuation tables was missing. I've added this and in the process extended `cont_table.wast` to be generally more exhaustive. - For those libcalls that take a parameter that is a variant type including `VMContObj`, I've introduced dedicated versions for the `VMContObj` case, namely `table_fill_cont_obj` and `table_grow_cont_obj` in libcalls.rs. These manually split the `VMContObj` into two parts.
- Loading branch information
1 parent
55c802e
commit 78b813d
Showing
16 changed files
with
417 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.