Question about OopOopIterateDispatch and TypeArrayKlass
Albert Yang
albert.m.yang at oracle.com
Tue Jul 9 11:10:32 UTC 2024
Just fyi, callers of those iterate APIs often skip type-array-klass, e.g. G1ParScanThreadState::do_copy_to_survivor_space. I suspect other GCs do the same. (If they don't, they probably should.)
> Was it faster than adding a conditional branch to avoid the jump altogether if kind==TAK ?
If all callers pre-skip that case, such never-taken-branch can even have negative impact, I surmise.
/Albert
________________________________________
From: hotspot-gc-dev <hotspot-gc-dev-retn at openjdk.org> on behalf of Thomas Stüfe <thomas.stuefe at gmail.com>
Sent: Tuesday, July 9, 2024 10:11
To: hotspot-gc-dev at openjdk.java.net
Subject: Question about OopOopIterateDispatch and TypeArrayKlass
Hi,
I have a small question about OopOopIterateDispatch and TypeArrayKlass.
In OopOopIterateXXXDispatch, we branch off, using a precalculated jump table, to the correct oop iteration method for the object Klass. We do this for all Klass-kind variants, including TypeArrayKlassKind.
However, TAK needs neither oop- nor metadata iteration.
Was the inclusion of TAK into these arrays a deliberate choice? Was it faster than adding a conditional branch to avoid the jump altogether if kind==TAK ?
Thanks, Thomas
More information about the hotspot-gc-dev
mailing list