RFR: 8292647: javac/lambda/T8031967.java fails with StackOverflowError when use -XX:TieredStopAtLevel=3 on aarch64 and LoongArch
SUN Guoyun
duke at openjdk.org
Wed Feb 8 07:54:54 UTC 2023
On Mon, 22 Aug 2022 03:21:46 GMT, SUN Guoyun <duke at openjdk.org> wrote:
> I'm not at all sure about this one. It may be a bug. Before committing this patch we should find out why AArch64 and LoongArch are consuming more stack than others. 10M of stack is huge.
@theRealAph I tested and found that some large methods use more spill code on LoongArch64 and AArch64 architectures than x86_64 architectures, which results in larger stack space requests.
<pre><code class="cpp">
// src/hotspot/share/c1/c1_FrameMap.cpp
279 ByteSize FrameMap::sp_offset_for_monitor_base(const int index) const {
280 int end_of_spills = align_up(first_available_sp_in_frame + _reserved_argument_area_size, (int)sizeof(double)) +
281 _num_spills * spill_slot_size_in_bytes;
282 int offset = align_up(end_of_spills, HeapWordSize) + index * (int)sizeof(BasicObjectLock);
283 return in_ByteSize(offset);
284 }
</code></pre>
Here, var `_num_spills` is sometimes larger on loongarch64/aarch64 than x86_64, then framesize is larger.
So I think using more stack space on loongarch64/aarch64 is the best solution.
-------------
PR: https://git.openjdk.org/jdk/pull/9934
More information about the compiler-dev
mailing list