RFR(S) 8178351 - Simplify MetaspaceShared::is_in_shared_space and MetaspaceObj::is_shared

Aleksey Shipilev shade at redhat.com
Tue Jan 16 08:27:46 UTC 2018


On 01/16/2018 01:40 AM, Ioi Lam wrote:
> Hi,
> 
> Please review the following simple fix for improving CDS start-up time:
> 
> https://bugs.openjdk.java.net/browse/JDK-8178351
> http://cr.openjdk.java.net/~iklam/jdk11/8178351-simplify-is-shared.v01/

Looks awesome.

Nits:

 *) Stray whitespace before field names?

 229 class MetaspaceObj {
 230   friend class MetaspaceShared;
 231   static void*   _shared_metaspace_base;
 232   static void*   _shared_metaspace_top;

 *) I'd probably write this statement as math inequality, unless you think one condition fails
overwhelmingly more frequently:

   return (((void*)this) < _shared_metaspace_top && ((void*)this) >= _shared_metaspace_base);
 =>
   return (_shared_metaspace_base <= (void*)this) && ((void*)this < _shared_metaspace_top);

   return (p < MetaspaceObj::_shared_metaspace_top && p >= MetaspaceObj::_shared_metaspace_base);
 =>
   return (MetaspaceObj::_shared_metaspace_base <= p) && (p < MetaspaceObj::_shared_metaspace_top);


 *) Do you really need "this->" here?

  2183   } else if (this->is_shared()) {

-Aleksey



More information about the hotspot-runtime-dev mailing list