RFR: 8265064: Move clearing and setting of members into helpers in ReservedSpace

Stefan Johansson sjohanss at openjdk.java.net
Tue Apr 13 06:53:57 UTC 2021


On Mon, 12 Apr 2021 13:48:14 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Currently there are a few places in `ReservedSpace` that updates a set of members directly during initialization. This could be refactored into helper functions to improve readability and also to pave way for some further cleanups.
>> 
>> This is one of a few cleanups I plan to do to enable a clean implementation of:
>> [JDK-8261527: Record page size used for underlying mapping in ReservedSpace](https://bugs.openjdk.java.net/browse/JDK-8261527)
>> 
>> **Testing**
>> Mach5 tier1 and tier2.
>
> src/hotspot/share/memory/virtualspace.cpp line 139:
> 
>> 137: 
>> 138: void ReservedSpace::clear_members() {
>> 139:   _base = NULL;
> 
> This method could call `initialize_members()` with the appropriate argument values, couldn't it?

Yes. I tried that as well, but then I called it `set_members()` because calling `initialize_members()` from `clear_members()` felt a bit backwards. The reason I didn't go with this approach was that I preferred the name `initialize_members()`. But I'll make the change and call initialize from clear, it's pretty obvious what is going on.

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

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


More information about the hotspot-dev mailing list