RFR: 8278874: tighten VerifyStack constraints [v7]

Tom Rodriguez never at openjdk.org
Thu Jul 31 20:51:59 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 940:

> 938:     int callee_size_of_parameters = 0;
> 939:     for (int frame_idx = 0; frame_idx < cur_array->frames(); frame_idx++) {
> 940:       assert(is_top_frame == (frame_idx == 0), "must be");

Why not replace this with direct computation of the value:

bool is_top_frame = (frame_idx == 0);

then you don't even need the final reset of the value either.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/26121#discussion_r2246351521


More information about the hotspot-dev mailing list