RFR: 8280152: AArch64: Reuse runtime call trampolines [v4]

Evgeny Astigeevich duke at openjdk.org
Thu Jul 21 21:01:21 UTC 2022


On Thu, 21 Jul 2022 09:49:57 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 ResizeableResourceHashtable

Changes requested by eastig at github.com (no known OpenJDK username).

src/hotspot/cpu/aarch64/codeBuffer_aarch64.cpp line 31:

> 29: void CodeBuffer::share_trampoline_for(address dest, int caller_offset) {
> 30:   if (_shared_trampoline_requests == nullptr) {
> 31:     _shared_trampoline_requests = new SharedTrampolineRequests(4, 1024);

The meaning of `4` and `1024` is not clear. It requires to go to `ResizeableResourceHashtable` definition. Comments or named constants would be useful.
`ResizeableResourceHashtable` uses open hashing. The first parameter is a number of buckets. The second parameter is the maximum number of buckets. `maybe_grow` is to rebalance a hash table to reduce lengths of linked lists.
I think you don't need `1024` at all. A reasonable number of buckets should be enough.

src/hotspot/cpu/aarch64/codeBuffer_aarch64.cpp line 36:

> 34: 
> 35:   bool p_created;
> 36:   LinkedListImpl<int>* offsets = _shared_trampoline_requests->put_if_absent(dest, &p_created);

`typedef LinkedListImpl<int> Offsets`

test/hotspot/jtreg/compiler/sharedstubs/SharedTrampolineTest.java line 27:

> 25: /**
> 26:  * @test SharedTrampolineTest
> 27:  * @summary Checks that stubs to the interpreter can be shared for static or final method.

Please correct summary.

test/hotspot/jtreg/compiler/sharedstubs/SharedTrampolineTest.java line 74:

> 72: 
> 73:     public static void main(String[] args) throws Exception {
> 74:         List<String> compilers = java.util.Arrays.asList("-XX:-TieredCompilation" /* C2 */);

You have `import java.util.ArrayList`, you can use a short name.

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

PR: https://git.openjdk.org/jdk/pull/9405


More information about the hotspot-dev mailing list