RFR (S) 8184753: Assert against MinObjectAlignmentMask to avoid integer division

Aleksey Shipilev shade at redhat.com
Tue Jul 18 07:51:09 UTC 2017


Hi Mikael,

On 07/18/2017 09:48 AM, Mikael Gerdin wrote:
>> Noticed two new asserts in arguments.cpp have excess whitespace, fixed:
>>    http://cr.openjdk.java.net/~shade/8184753/webrev.02
> 
> Did you consider using is_object_aligned in the newly created align.hpp?
> 
> http://hg.openjdk.java.net/jdk10/hs/hotspot/file/5e9c41536bd2/src/share/vm/utilities/align.hpp#l120
> 
> inline bool is_object_aligned(size_t word_size) {
>   return is_aligned(word_size, MinObjAlignment);
> }

I did, but haven't done this for two reasons:
  a) The asserts are about object _sizes_, not the objects themselves;
  b) Doing *Mask fits other uses of MinObjAlignment(InBytes)(Mask) around HS;

Thanks,
-Aleksey





More information about the hotspot-dev mailing list