RFR: 8303852: current_stack_region() gets called twice unnecessarily [v4]

David Holmes dholmes at openjdk.org
Wed Aug 23 22:56:35 UTC 2023


> 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 two additional commits since the last revision:

 - extra parens
 - Fix pre-existing error in comment: P2 = P1 + size (not  minus)
   Fix format specifier.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/15321/files
  - new: https://git.openjdk.org/jdk/pull/15321/files/4e22dab0..a3a6102e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=15321&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15321&range=02-03

  Stats: 3 lines in 3 files changed: 0 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/15321.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15321/head:pull/15321

PR: https://git.openjdk.org/jdk/pull/15321


More information about the hotspot-dev mailing list