RFR: 8254015: copy_to_survivor_space should use in-hand klass for scanning

Albert Mingkun Yang ayang at openjdk.java.net
Mon Oct 5 13:33:42 UTC 2020


On Mon, 5 Oct 2020 13:21:50 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> Please review this small change to G1 evacuation.  When scanning the oops
>> in an instance, the existing code calls obj->oop_iterate_backward(closure).
>> That function gets the klass of obj and forwards to another function with
>> the obj, closure, and the just obtained klass.  But the caller of
>> oop_iterate_backward has already obtained the klass for other reasons.
>> Rather than refetching it (including dealing with
>> UseCompressedClassPointers), change to use a new oop_iterate_backward
>> overload taking the klass.  This saves a small amount of work for non-array
>> objects being evacuated.
>> 
>> Testing:
>> tier1
>> Generic performance testing didn't find any significant difference.
>> Looking at just GCBasher evacuation rate, there may to be a small
>> improvement, though it's hard to measure.
>
> Looks good.

Does it make sense to drop `oop_iterate_backwards(OopClosureType* cl)` and only have the method with two args so that
klass will never be re-fetched?

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

PR: https://git.openjdk.java.net/jdk/pull/504



More information about the hotspot-gc-dev mailing list