RFR: 8199739: Use HeapAccess when loading oops from static fields in javaClasses.cpp

Kim Barrett kim.barrett at oracle.com
Sat Mar 17 04:11:42 UTC 2018

> On Mar 16, 2018, at 10:39 AM, Stefan Karlsson <stefan.karlsson at oracle.com> wrote:
> Hi all,
> Please review this patch to use HeapAccess<>::oop_load instead of oopDesc::load_decode_heap_oop when loading oops from static fields in javaClasses.cpp:
> http://cr.openjdk.java.net/~stefank/8199739/webrev.01/
> https://bugs.openjdk.java.net/browse/JDK-8199739
> It's necessary to use HeapAccess<>::oop_load to inject load barriers for GCs that need them.
> Thanks,
> StefanK


1870   address addr = ik->static_field_addr(static_unassigned_stacktrace_offset);
1871   return HeapAccess<>::oop_load((HeapWord*)addr);

I'm not sure this is sufficient.  Isn't static_field_addr just
fundamentally broken for Shenandoah?

*(mirror + offset)

Proposed change:
HeapAccess<>::oop_load(mirror + offset)

but I think such an access needs to be 
HeapAccess<>::load_at(mirror, offset)

(I have an email thread about this with me, Coleen, and ErikO from
mid-December. I don't have anything in that thread from Erik though.
I think we discussed it on slack, but that's been deleted.)


More information about the hotspot-dev mailing list