RFR: 8253717: Relocate stack overflow code out of thread.hpp/cpp

Coleen Phillimore coleenp at openjdk.java.net
Tue Oct 6 19:03:07 UTC 2020


On Tue, 6 Oct 2020 16:44:52 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> This change moves the significant amount of stack overflow related code (with ascii art!) out of thread files into a
>> new file.  Many of the functions are static functions and some go through JavaThread::_stack_overflow_state where
>> needed.   All functions are moved and not modified except for qualification.  I also added a delegating constructor to
>> JavaThread::JavaThread so reordered the assignments as initializers from JavaThread::initialize.
>> Tested with tier1-6 and builds on arm32, ppc, s390 and zero.
>
> Really nice refactoring and cleanup. Thumbs up.
> 
> Any idea whether the change in compilation unit will have any performance effects?

To answer the performance question, since it's not an actual indirection, the compiler should be smart enough to adjust
the offset of the field to reflect its offset in stack_overflow_state.  So this wouldn't make a difference in generated
code.  Even if it did, there are few places where stack overflow is accessed via thread and these are generally during
exception handling.  The stack overflow checking code mostly uses the static shadow, yellow and red sizes.

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

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


More information about the hotspot-dev mailing list