JDK-8278874 : tighten VerifyStack constraints
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-12-16
  • Updated: 2025-08-26
  • Resolved: 2025-08-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26 b12Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
842              /* SPARC */
843              (iframe->interpreter_frame_expression_stack_size() == mask.expression_stack_size() + callee_size_of_parameters) ||
844              /* x86 */
845              (iframe->interpreter_frame_expression_stack_size() == mask.expression_stack_size() + callee_max_locals) ||
846              (try_next_mask &&
847               (iframe->interpreter_frame_expression_stack_size() == (next_mask_expression_stack_size -
848                                                                      top_frame_expression_stack_adjustment))) ||
849              (is_top_frame && (exec_mode == Unpack_exception) && iframe->interpreter_frame_expression_stack_size() == 0) ||
850              (is_top_frame && (exec_mode == Unpack_uncommon_trap || exec_mode == Unpack_reexecute || el->should_reexecute()) &&
851               (iframe->interpreter_frame_expression_stack_size() == mask.expression_stack_size() + cur_invoke_parameter_size))

This is extra conservative.  It applies both x86 and SPARC (obsolete) logic to all platforms.  The special case for Unpack_exception may not be needed.

I found a problem with arraylength (see JDK-8278384), but it goes unnoticed because the VerifyStack logic is too permissive.
Comments
Changeset: 39a36529 Branch: master Author: Dean Long <dlong@openjdk.org> Date: 2025-08-15 18:52:45 +0000 URL: https://git.openjdk.org/jdk/commit/39a365296882b0df49398cd7ac36e801a9aa1c35
15-08-2025

Thanks [~dcubed]. The PR removes the /* SPARC */ comment but actually retains the associated logic, while removing the logic associated with the /* x86 */ comment, which based on my archeology has been wrong from the beginning (JDK-4870697).
31-07-2025

Since the PR for this fix discusses removing Solaris SPARC code, I've added a link to this issue: JDK-8244224 Implementation of JEP 381: Remove the Solaris and SPARC Ports
28-07-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26121 Date: 2025-07-03 20:28:34 +0000
03-07-2025