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

Aleksey Shipilev shade at redhat.com
Tue Jan 16 10:49:36 UTC 2018


On 01/16/2018 10:07 AM, Ioi Lam wrote:
> On 1/16/18 12:27 AM, Aleksey Shipilev wrote:
>>   *) 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);
> 
> I want to have fast rejects when CDS is not enabled (and thus both base and top are NULL). In this
> case, this comparison
> 
>     (p < MetaspaceObj::_shared_metaspace_top)
> 
> will always fail.

Ok then!

-Aleksey



More information about the hotspot-runtime-dev mailing list