[lworld] RFR: 8377714: [lworld] Re-enable virtual thread tests [v2]
Marc Chevalier
mchevalier at openjdk.org
Fri Feb 20 08:56:44 UTC 2026
On Fri, 20 Feb 2026 00:37:50 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:
>> src/hotspot/share/runtime/continuationFreezeThaw.cpp line 2893:
>>
>>> 2891: // As a result, f.is_deoptimized_frame() is always false and we must test hf to know if the frame is deoptimized.
>>> 2892: frame f = new_stack_frame<ContinuationHelper::CompiledFrame>(hf, caller, is_bottom_frame, augmented ? fsize - hf.cb()->frame_size() : 0);
>>> 2893: assert((int)(caller.sp() - f.sp()) == (augmented ? fsize : f.cb()->frame_size()), "");
>>
>> The expression `f.cb()->frame_size()` is not crashing only if `f` is compiled otherwise `f.cb() == nullptr`. But `f` seems to be a compiled frame (since `new_stack_frame<ContinuationHelper::CompiledFrame>`), so why `f.cb()->frame_size()` isn't always what we want?
>
> Right, `f` is a compiled frame. So before this change, `caller.sp()` was always set to `f.sp() + f.cb()->frame_size()`, even when `f` was an extended frame. The reason for this is that we needed to keep a reference to the saved `rbp/rfp` in `f`, because we might needed to patch it later (we need to thaw the callee first before patching the caller's saved `rbp/rfp`). But now, the saved `rbp/rfp` is stored together with the saved return pc. So `caller.sp()` is set to point to `f`'s actual caller `sp`. The difference between `caller.sp()` and `f.sp()` should then be the real size of `f` (stored in `fsize` for extended frames).
Riiiight, the `frame_size` is just the part with the locals (and sp_inc...), it doesn't include the extension space? Is it a method we could add to `frame`, to return frame_size, plus possibly, the extension space? Just a random idea, feel free to ignore.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/2085#discussion_r2832114787
More information about the valhalla-dev
mailing list