RFR: 8253920: Share method trampolines in CDS dynamic archive

Yumin Qi minqi at openjdk.java.net
Mon Oct 26 18:55:18 UTC 2020


On Mon, 26 Oct 2020 18:12:16 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

> This patch is to allow sharing of the same method trampoline for archived Methods with the same AdapterHandleEntry when using CDS dynamic archive. 
> 
> Running javac on HelloWorld with CDS dynamic archive, the number of calls to SharedRuntime::generate_trampoline() is reduced to 406 times vs 12601 times without the patch.
> 
> In terms of saving on instructions and time (on linux-x64):
> instr delta =     -2807662    -0.1369%
> time  delta =       -6.860 ms -1.8798%
> 
> It passed tiers 1,2,3,4 testing.

Looks good. Minor suggestions.

src/hotspot/share/memory/archiveBuilder.cpp line 896:

> 894:   for (int i = 0; i < klasses()->length(); i++) {
> 895:     Klass* k = klasses()->at(i);
> 896:     if (!k->is_instance_klass()) {

Could you use
if (k->is_instance_klass()) {
  ...
}
as same style of line 869

src/hotspot/share/oops/method.cpp line 1111:

> 1109: 
> 1110:   assert(_from_compiled_entry != NULL, "sanity");
> 1111:   if (DumpSharedSpaces) {

I think you can remove this if check.

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

Marked as reviewed by minqi (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/868


More information about the hotspot-runtime-dev mailing list