RFR: 8183569: Remove duplicated flag limits in parse_xss and globals.hpp [v2]
Ioi Lam
iklam at openjdk.java.net
Tue Feb 23 17:44:42 UTC 2021
On Tue, 23 Feb 2021 08:18:00 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>>
>> use macros to simplify assert_compatible_type; restore code in parse_xss so the comments make sense
>
> Hi Ioi,
>
> Seems reasonable. Some remarks below.
>
> ..Thomas
In rev [8c4b5cd](https://github.com/openjdk/jdk/commit/8c4b5cd9288b063482f28836ca5b0b337a412d5d):
I updated `Arguments::parse_xss()` to restore the original code -- I think it's important to see the `1 * M` to make sense of what this comment is talking about:
// The min and max sizes match the values in globals.hpp, but scaled
// with K. The values have been chosen so that alignment with page
// size doesn't change the max value, which makes the conversions
// back and forth between Xss value and ThreadStackSize value easier.
// The values have also been chosen to fit inside a 32-bit signed type.
const julong min_ThreadStackSize = 0;
const julong max_ThreadStackSize = 1 * M;
So instead of the PR's initially proposed changes, I added these to make sure that the value `1 * M` matches with globals.hpp:
// Make sure the above values match the range set in globals.hpp
const JVMTypedFlagLimit<intx>* limit = JVMFlagLimit::get_range_at(FLAG_MEMBER_ENUM(ThreadStackSize))->cast<intx>();
assert(min_ThreadStackSize == static_cast<julong>(limit->min()), "must be");
assert(max_ThreadStackSize == static_cast<julong>(limit->max()), "must be");
If people are OK with this, I will update the PR's initial comment, and the bug title as well.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2688
More information about the hotspot-runtime-dev
mailing list