RFR(M): 8212243: More gc interface tweaks for arraycopy and some other smaller changes in preparation for Shenandoah
Vladimir Kozlov
vladimir.kozlov at oracle.com
Tue Oct 16 22:19:25 UTC 2018
Hi Roland,
Please, split these in 3 RFEs to review and test them separately: arraycopy, predicated, small changes.
I looked on arraycopy changes.
Why you are not using InstanceKlass::_nonstatic_oop_map_size to find if class has non-static object
fields?
PhaseMacroExpand::clone_needs_postbarrier() should have GC interface call to return false
immediately if post barrier is not needed for current GC.
Aggressive dead nodes elimination seems fine but I want to look on separate webrev to make sure I
did not miss something.
Thanks,
Vladimir
On 10/16/18 9:06 AM, Roland Westrelin wrote:
>
> http://cr.openjdk.java.net/~roland/8212243/webrev.00/
>
> This change adds 2 more entry point for arraycopy to the gc interface:
>
> - one, when an arraycopy is turned into loads/stores and the field or
> element being copied is a reference. In that case, barriers may have
> to be applied.
>
> - another, when a clone is expanded into a stub call. In that case a
> postbarrier may be required. That one is only required when a
> reference field or element may be encountered. That's where the
> ciInstanceKlass changes come in.
>
> The other complicated change is in loopPredicate.cpp. We have:
>
> Predicate 1
> ..
> Predicate n
>
> profile predicate 1
> ..
> profile predicate n
>
> loop head
>
> Shenandoah write barriers produce memory, can be hoisted out of loop but
> can also depend on some predicate so may end up with:
>
> Predicate 1
> ..
> Predicate n
>
> profile predicate 1
> ..
> write barrier
> ...
> profile predicate n
>
> loop head
>
>
> In that case, all predicates branch to a region that dominates the
> uncommon trap call. Same is true for profile predicates. Because of the
> write barrier, the region for profile predicates has a memory phi to
> merge memory state before the barrier and after the barrier. Now when
> clone_loop_predicates() is called:
>
> Predicate 1
> ..
> Predicate n
>
> profile predicate 1
> ..
> write barrier
> ...
> profile predicate n
>
> cloned predicate
>
> cloned profile predicate
>
> loop head
>
>
> the cloned predicate branches to the region shared by all
> predicates. Same goes for the cloned profile predicate and the profile
> predicates. The memory state for the cloned predicate should be the one
> following the barrier but after cloning it's the one from the predicate
> n, before the barrier. That memory state needs to be adjusted.
>
> Other changes tweak the gc interface and make sure that when nodes are
> disconnected, nodes that need special treatment are processed.
>
> Roland.
>
More information about the hotspot-compiler-dev
mailing list