RFR: 8280152: AArch64: Reuse runtime call trampolines [v3]
Evgeny Astigeevich
duke at openjdk.org
Tue Jul 19 17:30:42 UTC 2022
On Sat, 9 Jul 2022 03:06:30 GMT, Yi-Fan Tsai <duke at openjdk.org> wrote:
>> A trampoline stub could be generated for each runtime call. These trampolines could be duplication if the callees are the same. This change delays the stub generation and generates one stub for a distinct callee.
>>
>> Benchmark als, chi-square, dec-tree, gauss-mix, log-regression, movie-lens, naive-bayes, page-rank, fj-means, reactors, future-genetic, mnemonics, dotty, scala-kmeans, and finagle-http in Renaissance (0.14.1) are tested. The sum of the used size of CodeHeap 'non-profiled nmethods' and CodeHeap 'profiled nmethods' shows ~4.7% reduction on average.
>
> Yi-Fan Tsai has updated the pull request incrementally with one additional commit since the last revision:
>
> Use a hash table to deduplicate
Changes requested by eastig at github.com (no known OpenJDK username).
src/hotspot/cpu/aarch64/codeBuffer_aarch64.cpp line 29:
> 27: #include "asm/macroAssembler.hpp"
> 28:
> 29: void CodeBuffer::share_trampoline_for(address dest, int caller_offset) {
Shouldn't it be `shared_trampoline_for` to be consistent with `shared_stub_to_interp_for`?
src/hotspot/cpu/aarch64/codeBuffer_aarch64.cpp line 38:
> 36: }
> 37:
> 38: static bool emit_shared_stubs_to_runtime_call(CodeBuffer* cb, CodeBuffer::SharedTrampolineRequests* requests) {
emit_shared_trampoline
src/hotspot/cpu/aarch64/codeBuffer_aarch64.cpp line 56:
> 54: prev.at(i) = last.at(j);
> 55: last.at(j) = i;
> 56: }
Why not to implement `SharedTrampolineRequests` as a simple hash table?
It can be based on: `GrowableArray<Pair<address, LinkedListImpl<int>>>`
Is it writing simple hash table code better than using sorting? If a number of trampolines is small there should not be much performance difference. IMHO, less code is better. How many trampolines per method are created?
test/hotspot/jtreg/compiler/sharedstubs/SharedStubToRuntimeTest.java line 46:
> 44: import jdk.test.lib.process.ProcessTools;
> 45:
> 46: public class SharedStubToRuntimeTest {
SharedTrampolineTest
-------------
PR: https://git.openjdk.org/jdk/pull/9405
More information about the hotspot-dev
mailing list