[lworld] RFR: 8354694: [lworld] Refactor AssertUnsetFields to Early Larval Frame

Matias Saavedra Silva matsaave at openjdk.org
Thu Apr 17 20:25:19 UTC 2025


On Thu, 17 Apr 2025 05:41:02 GMT, Chen Liang <liach at openjdk.org> wrote:

>> This patch adds refactors so the runtime aligns with the new strict field initialization spec (https://cr.openjdk.org/~dlsmith/jep401/jep401-20250409/specs/strict-fields-jvms.html). The stackmap table entry `AssertUnsetFields` is now referred to as `Early_Larval` and it follows a new format where it is a frame that encompasses a base frame.
>
> src/hotspot/share/classfile/stackMapTable.cpp line 358:
> 
>> 356:   u2 offset_delta = _stream->get_u2(CHECK_NULL);
>> 357: 
>> 358:   if (frame_type < EARLY_LARVAL) {
> 
> Here this can just be
> Suggestion:
> 
>   if (frame_type < SAME_LOCALS_1_STACK_ITEM_EXTENDED) {
> 
> the case where it is `== EARLY_LARVAL` is already handled earlier, and you don't want this to accidentally handle newer frame types that nest other frames.

I think you have it backwards, `EARLY_LARVAL` is less than `SAME_LOCALS_1_STACK_ITEM_EXTENDED`. Your suggestion would include `frame == EARLY_LARVAL` but either way this case is caught and throws an error before this.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1435#discussion_r2049537491


More information about the valhalla-dev mailing list