RFR: 8302369: Reduce the stack size of the C1 compiler [v3]
SUN Guoyun
duke at openjdk.org
Sat Feb 18 01:24:20 UTC 2023
> The current fact is that C1 uses more stack space than the C2 compiler, taking method `java.lang.Object::<init>`as an example on the x86_64 platform , the stack size used is 48 bytes for C1 compiler, while only 16 bytes is used for C2 compiler.
>
> ========== C1-compiled nmethod =====
> 0x00007f93311cc747: push %rbp
> 0x00007f93311cc748: sub $0x30,%rsp // stack sizes is 48 bytes
>
>
> ========== C2-compiled nmethod =======
> pushq rbp # Save rbp
> subq rsp, #16 # Create frame //stack sizes is 16 bytes
>
> After this patch, the C1 compiler will use less stack space. also taking method `java.lang.Object::<init>`as an example on the x86_64 platform , the stack size used is 16 bytes on L1 and 32 bytes on L3.
>
> ========== C1-compiled nmethod =====
> Compiled method (c1) 264 24 1 java.lang.Object::<init> (1 bytes)
> 0x00007f80491ce647: push %rbp
> 0x00007f80491ce648: sub $0x10,%rsp //stack sizes is 16 bytes
>
> ========== C1-compiled nmethod =====
> Compiled method (c1) 283 24 3 java.lang.Object::<init> (1 bytes)
> 0x00007f93711d01c7: push %rbp
> 0x00007f93711d01c8: sub $0x20,%rsp // stack sizes is 32 bytes
SUN Guoyun has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:
- Merge remote-tracking branch 'upstream/master' into 8302369
- 8302369: Reduce the stack size of the C1 compiler
- 8302369: Reduce the stack size of the C1 compiler
-------------
Changes: https://git.openjdk.org/jdk/pull/12548/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12548&range=02
Stats: 190 lines in 13 files changed: 52 ins; 128 del; 10 mod
Patch: https://git.openjdk.org/jdk/pull/12548.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/12548/head:pull/12548
PR: https://git.openjdk.org/jdk/pull/12548
More information about the hotspot-compiler-dev
mailing list