Question about OopOopIterateDispatch and TypeArrayKlass

Thomas Stüfe thomas.stuefe at gmail.com
Tue Jul 9 11:13:38 UTC 2024


Thanks Albert, I totally missed that. Makes sense.

Cheers, Thomas

On Tue, Jul 9, 2024 at 1:10 PM Albert Yang <albert.m.yang at oracle.com> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20240709/0abe5323/attachment.htm>


More information about the hotspot-gc-dev mailing list