[lworld] RFR: 8343554: [lworld] VM crashes when running runtime/valhalla/inlinetypes/InlineOops.java with ZGC in interpreted mode [v2]

David Simms dsimms at openjdk.org
Thu Dec 5 11:22:37 UTC 2024


On Thu, 5 Dec 2024 06:39:10 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

>> David Simms has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Clean up add_oop calls
>
> src/hotspot/share/prims/whitebox.cpp line 1988:
> 
>> 1986: 
>> 1987:   void do_oop(oop* o) { add_oop(*o); }
>> 1988:   void do_oop(narrowOop* v) { add_oop(CompressedOops::decode(*v)); }
> 
> I think we rarely do this directly but let RawAccess handle the load and decode. 
> Suggestion:
> 
>   void do_oop(oop* o) { add_oop(RawAccess<>::oop_load(o)); }
>   void do_oop(narrowOop* v) { add_oop(RawAccess<>::oop_load(v)); }
> 
> 
> and the most common way to write oop closures which are used in both oop and narrowOop contexts:
> ```c++
>   template <class T>
>   void do_oop_work(T* p) {
>     oop o =  RawAccess<>::oop_load(p); 
>     // Do the work
>   }
>   void do_oop(oop* o) { do_oop_work(o); }
>   void do_oop(narrowOop* v) { do_oop_work(v); }

You are correct, I want to thank @fisk for leading me astray on this one :-) Fixed it up.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1313#discussion_r1871189212


More information about the valhalla-dev mailing list