RFR: 8302369: Reduce the stack size of the C1 compiler [v2]
Dean Long
dlong at openjdk.org
Sat Feb 18 00:31:28 UTC 2023
On Wed, 15 Feb 2023 06:52:53 GMT, SUN Guoyun <duke at openjdk.org> wrote:
>> In order to reduce the minimum size lower than 2, C1 would need to determine (in advance?) if any stubs might be called. Maybe there is a way to calculate actual frame size required based on actual stores emitted, but that seems tricky if the prologue has already been emitted.
>
> <pre><code class="cpp">
> // src/hotspot/share/c1/c1_FrameMap.cpp
> // bool FrameMap::finalize_frame(int nof_slots) {
>
> 191 _framesize = align_up(in_bytes(sp_offset_for_monitor_base(0)) +
> 192 _num_monitors * (int)sizeof(BasicObjectLock) +
> 193 (int)sizeof(intptr_t) + // offset of deopt orig pc
> 194 frame_pad_in_bytes,
> 195 StackAlignmentInBytes) / 4;
> </code></pre>
> Here the value of ` (int)sizeof(intptr_t)` is 8 and the value of `StackAlignmentInBytes` is 16, so the minimum stack size of a method is guaranteed to be 16, which should ensure that CounterOverflowStub (or other stub) needs two slots(0, 1).
> But I don't understand what the addition of `(int)sizeof(intptr_t)` does here and what does `// offset of deopt orig pc` mean, do you know?
That would be to support `nmethod::orig_pc_offset()`.
-------------
PR: https://git.openjdk.org/jdk/pull/12548
More information about the hotspot-compiler-dev
mailing list