[lworld] RFR: 8359377: [lworld] Fix cp indexes in larval stackmaps in redefinition

Coleen Phillimore coleenp at openjdk.org
Fri Jun 13 20:34:35 UTC 2025


On Thu, 12 Jun 2025 17:42:57 GMT, Dan Heidinga <heidinga at openjdk.org> wrote:

>> Need to write a test.
>
> src/hotspot/share/prims/jvmtiRedefineClasses.cpp line 3295:
> 
>> 3293:    if (frame_type == 246) {  // EARLY_LARVAL
>> 3294:      // rewrite_cp_refs in  unset fields and fall through.
>> 3295:      rewrite_cp_refs_in_unset_fields(stackmap_p, stackmap_end, calc_number_of_entries, frame_type);
> 
> larval_frames contain an embedded frame - one of the other frames listed in the `stack_map_frame` union.  This fixes the field NameAndTypes but doesn't update the embedded frame.
> 
> The `stackmap_p` ptr is updated in the `rewrite_cp_refs_in_unset_fields` but haven't yet updated the `frame_type`.  I think we need to redo this code before exiting this block:
> 
>     frame_type = *stackmap_p;
>     stackmap_p++;

I think it falls through to the embedded frame because it's next in the stream (?)
Oh yes, you're right.  I still haven't written the test.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1487#discussion_r2143370793


More information about the valhalla-dev mailing list