[lworld] RFR: 8343554: [lworld] VM crashes when running runtime/valhalla/inlinetypes/InlineOops.java with ZGC in interpreted mode
Axel Boldt-Christmas
aboldtch at openjdk.org
Thu Dec 5 06:41:56 UTC 2024
On Wed, 4 Dec 2024 16:52:33 GMT, David Simms <dsimms at openjdk.org> wrote:
> Don't use HeapAccess for frame roots
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); }
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1313#discussion_r1870726909
More information about the valhalla-dev
mailing list