<div dir="ltr"><div>Thanks Albert, I totally missed that. Makes sense.</div><div><br></div><div>Cheers, Thomas<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 9, 2024 at 1:10 PM Albert Yang <<a href="mailto:albert.m.yang@oracle.com">albert.m.yang@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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.)<br>
<br>
> Was it faster than adding a conditional branch to avoid the jump altogether if kind==TAK ?<br>
<br>
If all callers pre-skip that case, such never-taken-branch can even have negative impact, I surmise.<br>
<br>
/Albert<br>
<br>
________________________________________<br>
From: hotspot-gc-dev <<a href="mailto:hotspot-gc-dev-retn@openjdk.org" target="_blank">hotspot-gc-dev-retn@openjdk.org</a>> on behalf of Thomas Stüfe <<a href="mailto:thomas.stuefe@gmail.com" target="_blank">thomas.stuefe@gmail.com</a>><br>
Sent: Tuesday, July 9, 2024 10:11<br>
To: <a href="mailto:hotspot-gc-dev@openjdk.java.net" target="_blank">hotspot-gc-dev@openjdk.java.net</a><br>
Subject: Question about OopOopIterateDispatch and TypeArrayKlass<br>
<br>
Hi,<br>
<br>
I have a small question about OopOopIterateDispatch and TypeArrayKlass.<br>
<br>
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.<br>
<br>
However, TAK needs neither oop- nor metadata iteration.<br>
<br>
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 ?<br>
<br>
Thanks, Thomas<br>
</blockquote></div>