Closed frank-emrich closed 2 months ago
This ended up requiring a bit more back-and-forth with the test suite. The culprit is the test where we enable the unsafe_disable_continuation_linearity_check
feature and then run cont_twice.wast
.
The exact behavior of this test under the hood changed a bit: In the past, it was a mechanism inside the Fiber
that detects if a Fiber
has run to completion, and panics if you try to run it again afterwards. Since Fiber
is gone now, this check does not exist any more. However, this was always somewhat superfluous, because we are already doing the same kind of checking using the VMContRef
's state
field. But I've had to make sure that we check the state
field earlier on in the translation of resume
instructions.
Given these headaches, I'm inclined to just remove unsafe_disable_continuation_linearity_check
in a follow-up PR. The performance of the linearity check should be good enough so that we don't need to be able to disable it anymore.
This PR performs a refactoring required by a follow-up PR that will implement actual pooling of
VMContRef
s.This PR removes the types
Fiber
andSuspend
from thefibre
create (i.e., our version ofwasmtime-fiber
). These two types are effectively leftovers fromwasmtime-fiber
, but only add a layer of unnecessary indirection at this point.Note that the
fibre::FiberStack
type remains. Some functions originally implemented onFiber
are moved toFiberStack
now. Further, theVMContRef
definition used in the optimized implementation now owns afibre::FiberStack
directly, rather than storing aFiber
as a wrapper around theFiberStack
.This PR does not affect the baseline implementation since it doesn't use the
fibre
crate at all.