RFR: 8238988: Rename thread "in stack" methods and add in_stack_range
David Holmes
david.holmes at oracle.com
Mon Feb 17 05:18:31 UTC 2020
Bug: https://bugs.openjdk.java.net/browse/JDK-8238988
Following on from JDK-8234372 this change introduces some renaming:
Thread::is_in_stack -> Thread::is_in_live_stack
Thread::on_local_stack -> Thread::is_in_full_stack
and then introduces private:
bool is_in_stack_range(address adr, address limit, bool inclusive)
with public wrappers:
bool is_in_stack_range_incl(address adr, address limit)
bool is_in_stack_range_excl(address adr, address limit)
and reimplements the existing "in stack" methods using is_in_stack_range().
This can be seen in the phase 1 webrev:
http://cr.openjdk.java.net/~dholmes/8238988/webrev.v1/
(There are some copyright updates missing in phase 1 but they are in the
phase 2 full webrev.)
Phase 2 then replaces all the explicit stack range checks (x <
stack_base() && x >= limit) with use of the new public methods.
Incremental webrev from phase 1:
http://cr.openjdk.java.net/~dholmes/8238988/webrev.v2-incr/
Full webrev for phases 1 & 2:
http://cr.openjdk.java.net/~dholmes/8238988/webrev.v2/
A few notes:
- some checks for x < stack_base() are now is_in_full_stack(x), adding
the missing/implied check against stack_end() even though it may not
strictly be needed in some cases
- some checks for x != NULL are removed as it is implicit in the range check
- removed some redundant assertions that stack_base() != NULL as that
assertion is already executed in the "in stack" functions.
- removed redundant os::Solaris::valid_stack_address ands replaced with
thread method usage
Testing:
- tier 1-3 on x86 and sparc platforms
- build test on ARM 32-bit, Aarch64, PPC64le and S390X.
Non-x86/sparc platforms need testing by folk who have access to those
platforms - thanks.
Thanks,
David
-----
More information about the hotspot-runtime-dev
mailing list