RFR: 8305959: x86: Improve itable_stub [v3]

Tobias Hartmann thartmann at openjdk.org
Fri Jun 2 05:53:08 UTC 2023


On Thu, 1 Jun 2023 14:51:42 GMT, Boris Ulasevich <bulasevich at openjdk.org> wrote:

>> Async profiler shows that applications spend up to 10% in itable_stubs.
>> 
>> The current inefficiency of itable stubs is as follows. The generated itable_stub scans itable twice: first it checks if the object class is a subtype of the resolved_class, and then it finds the holder_class that implements the method. I suggest doing this in one pass: with a first loop over itable, check pointer equality to both holder_class and resolved_class. Once we have finished searching for resolved_class, continue searching for holder_class in a separate loop if it has not yet been found.
>> 
>> This approach gives 1-10% improvement on the synthetic benchmarks and 3% improvement on Naive Bayes benchmark from the Renaissance Benchmark Suite (Intel Xeon X5675).
>
> Boris Ulasevich has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Apply suggestions from code review
>   
>   Co-authored-by: Aleksey Shipilëv <shipilev at amazon.de>

I'm seeing build failures:


[2023-06-02T05:46:54,104Z] /opt/mach5/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S20155/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/c5ef4fb5-87e1-424f-aecb-edeeb47e527a/runs/036a923e-0df3-49ab-81a9-2ab6e104728d/workspace/open/src/hotspot/cpu/x86/macroAssembler_x86.cpp: In member function 'void MacroAssembler::lookup_interface_method_stub(Register, Register, Register, Register, Register, Register, Register, int, Label&)':
[2023-06-02T05:46:54,104Z] /opt/mach5/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S20155/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/c5ef4fb5-87e1-424f-aecb-edeeb47e527a/runs/036a923e-0df3-49ab-81a9-2ab6e104728d/workspace/open/src/hotspot/cpu/x86/macroAssembler_x86.cpp:4324:40: error: 'method_offset_in_bytes' is not a member of 'itableMethodEntry'
[2023-06-02T05:46:54,104Z]  4324 |   int itentry_off = itableMethodEntry::method_offset_in_bytes();
[2023-06-02T05:46:54,104Z]       |                                        ^~~~~~~~~~~~~~~~~~~~~~
[2023-06-02T05:46:54,104Z] /opt/mach5/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S20155/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/c5ef4fb5-87e1-424f-aecb-edeeb47e527a/runs/036a923e-0df3-49ab-81a9-2ab6e104728d/workspace/open/src/hotspot/cpu/x86/macroAssembler_x86.cpp:4327:36: error: 'interface_offset_in_bytes' is not a member of 'itableOffsetEntry'
[2023-06-02T05:46:54,105Z]  4327 |   int ioffset = itableOffsetEntry::interface_offset_in_bytes();
[2023-06-02T05:46:54,105Z]       |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
[2023-06-02T05:46:54,105Z] /opt/mach5/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S20155/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/c5ef4fb5-87e1-424f-aecb-edeeb47e527a/runs/036a923e-0df3-49ab-81a9-2ab6e104728d/workspace/open/src/hotspot/cpu/x86/macroAssembler_x86.cpp:4328:36: error: 'offset_offset_in_bytes' is not a member of 'itableOffsetEntry'
[2023-06-02T05:46:54,105Z]  4328 |   int ooffset = itableOffsetEntry::offset_offset_in_bytes();
[2023-06-02T05:46:54,105Z]       |                                    ^~~~~~~~~~~~~~~~~~~~~~

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

PR Comment: https://git.openjdk.org/jdk/pull/13460#issuecomment-1573189154


More information about the hotspot-dev mailing list