RFR: 8303852: current_stack_region() gets called twice unnecessarily [v3]
Thomas Stuefe
stuefe at openjdk.org
Mon Aug 21 09:29:28 UTC 2023
On Mon, 21 Aug 2023 03:46:10 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> We combine:
>>
>> address os::current_stack_base();
>> size_t os::current_stack_size();
>>
>> into
>>
>> void os::current_stack_base_and_size(address* stack_base, size_t* stack_size)
>>
>> and so avoid making two underlying system calls. The os/platform specific specializations are handled by the `current_stack_region` calls. It made sense to modify that to export the `base` directly rather than the `bottom`. In doing that change it made sense to standardise on the the style of the code used (variable names etc) to make it easier to see where the 5 different versions were the same and where they differ. Having 5 versions is unfortunate ( 3 BSD: one per arch - zero, x64, aarch64; and 2 linux: zero and everything else), but trying to combine them with ifdefs would be even worse in my opinion.
>>
>> In theory there should be zero functional changes here.
>>
>> Testing:
>> - Tiers 1-3
>> - All our internal builds in tiers 1-5
>> - GHA
>>
>> Thanks.
>
> David Holmes has updated the pull request incrementally with one additional commit since the last revision:
>
> Promote os::<os>::current_stack_region to os::current_stack_base_and_size
Still good. Thanks for fixing this.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15321#issuecomment-1685972097
More information about the hotspot-dev
mailing list