You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of reserving the arg buffer in the source frame when resuming a
continuation, reserve it in the suspended frame when the stack is
suspended. This way, the buffer already exists when the continuation is
created, and it stays valid until it is resumed, which is just what we
need for cont.bind.
The cont.bind instruction will fill some slots of this buffer with its
arguments, and the resume instruction will fill the remaining slots (if
any) and switch to the target stack. Then, the target stack can just
unpack the buffer as usual.
Instead of allocating a separate buffer in the suspending frame, we
reuse the existing argument buffer used to pass the tag parameters. We
simply need to ensure that it is big enough to store either the
arguments or the return values of the tag.
A special case is needed for new continuations since they don't have a
frame yet. Instead, the argument buffer is simply reserved below the
initial SP.
The address of the argument buffer is stored in the StackMemory object
so that it can be picked up by the resume instruction. In the future, it
will also be used by the cont.bind instruction, and by the GC to visit
any potential references.
R=clemensb@chromium.org
Bug: 388533754
Change-Id: Iabe7ce865a59904160387c517006140e1ff31ded
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7526772
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#104983}
0 commit comments