On Tue, 4 Aug 2026 15:03:27 GMT, Alan Bateman <[email protected]> wrote:

> Update JVMTI ForceEarlyReturnVoid, and the equivalent JDWP command and JDI 
> method, to specify that the operation fails if the target thread's top frame 
> is a constructor or the class initializer of a class with 
> strictly-initialized fields.
> 
> Several options have been explored for both constructors and class 
> initializers,  the details are attached to the JBS issue.
> 
> The changes are very simple.  ClassFileParser::parse_fields records if the 
> class has class has strict instance fields, as it does already for strict 
> static fields. JvmtiEnvBase::check_top_frame is changed to check if the top 
> frame is a constructor of a class with strict instance fields in the class 
> hierarchy or the initializer of a class with strict static fields. This 
> replaces the check if the top frame is a value class constructor, the interim 
> solution for the initial JEP 539 integration.
> 
> In jvmti.xml, the custom XML element `externallink` is updated to support the 
> `sup` element so a "PREVIEW" superscript can decorate links to preview APIs.
> 
> Test ForceEarlyReturnStrictInitFields is added to test ForceEarlyReturnVoid 
> when the target thread's top frame is the constructor, method, or class 
> initializer of a a class with strictly-initialized fields.
> 
> Testing: tier 1-5
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: 6df6fee7
Author:    Alan Bateman <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/6df6fee7f16f7ffc79f04b6e56da1dc126fe8992
Stats:     1151 lines in 14 files changed: 804 ins; 316 del; 31 mod

8387648: Return the OPAQUE_FRAME from JVMTI ForceEarlyReturn from class init or 
constructor of a class with strictly-initialized static or instance fields

Reviewed-by: cjplummer, sspitsyn

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

PR: https://git.openjdk.org/jdk/pull/32198

Reply via email to