RFR: 8278874: tighten VerifyStack constraints [v7]
Tom Rodriguez
never at openjdk.org
Thu Jul 31 21:04:56 UTC 2025
On Thu, 24 Jul 2025 20:03:33 GMT, Dean Long <dlong at openjdk.org> wrote:
>> The VerifyStack logic in Deoptimization::unpack_frames() attempts to check the expression stack size of the interpreter frame against what GenerateOopMap computes. To do this, it needs to know if the state at the current bci represents the "before" state, meaning the bytecode will be reexecuted, or the "after" state, meaning we will advance to the next bytecode. The old code didn't know how to determine exactly what state we were in, so it checked both. This PR cleans that up, so we only have to compute the oopmap once. It also removes old SPARC support.
>
> Dean Long has updated the pull request incrementally with one additional commit since the last revision:
>
> readability suggestion
src/hotspot/share/runtime/deoptimization.cpp line 971:
> 969:
> 970: cur_code = str.next();
> 971: reexecute = true;
This seems a little unsavory, particularly since there's a later step which will print that value as if it was the original one. Since there's only one later logic use of the variable maybe there's should be a new flag to mark special case? Like `rolled_forward`? It might be fine as is with comments explaining this and fixing the printing to reflect what occurred here.
src/hotspot/share/runtime/deoptimization.cpp line 995:
> 993: int map_expr_invoke_ssize = mask.expression_stack_size() + cur_invoke_parameter_size;
> 994: int expr_ssize_before = iframe_expr_ssize + (is_top_frame ? top_frame_expression_stack_adjustment : 0);
> 995: int map_expr_callee_ssize = mask.expression_stack_size() + callee_size_of_parameters;
`map` in these names might be more clearly `oopmap`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26121#discussion_r2246372241
PR Review Comment: https://git.openjdk.org/jdk/pull/26121#discussion_r2246372513
More information about the hotspot-dev
mailing list