Stream: git-wasmtime

Topic: wasmtime / Issue #2633 Cranelif: add ghost_use instruction


view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2021 at 22:07):

bjorn3 opened Issue #2633:

<!-- Please try to describe precisely what you would like to do in
Cranelift/Wasmtime and/or expect from it. You can answer the questions below if
they're relevant and delete this text before submitting. Thanks for opening an
issue! -->

Feature

Add a new ghost_use instruction that accepts a value and ensures that the value can be found somewhere at runtime. It will codegen to no instructions.
<!-- What is the feature or code improvement you would like to do in
Cranelift/Wasmtime? -->

Benefit

This allows extending the range for which variables are available in debuginfo beyond the last actual use of the variable. In addition it would for exanple allow a jit runtime to inspect the value for switching to and from speculatively optimized code.
<!-- What is the value of adding this in Cranelift/Wasmtime? -->

Implementation

The instruction will be marked as has_other_sideeffects. It will be lowered by backends to an instruction that doesn't result in any bytes being emitted. It will tell regalloc that the value needs to be available on either in a register or on the stack.
<!-- Do you have an implementation plan, and/or ideas for data structures or
algorithms to use? -->

Alternatives


Last updated: Dec 23 2024 at 12:05 UTC