8178500: Replace usages of round_to and round_down with align_up and align_down

Reviewed-by: rehn, tschatzl
This commit is contained in:
Stefan Karlsson 2017-04-13 09:57:51 +02:00
parent dbd3b5a79e
commit d37b9c1f8d
68 changed files with 254 additions and 271 deletions

View file

@ -238,10 +238,8 @@ int oopDesc::size_given_klass(Klass* klass) {
// This code could be simplified, but by keeping array_header_in_bytes
// in units of bytes and doing it this way we can round up just once,
// skipping the intermediate round to HeapWordSize. Cast the result
// of round_to to size_t to guarantee unsigned division == right shift.
s = (int)((size_t)round_to(size_in_bytes, MinObjAlignmentInBytes) /
HeapWordSize);
// skipping the intermediate round to HeapWordSize.
s = (int)(align_up(size_in_bytes, MinObjAlignmentInBytes) / HeapWordSize);
// ParNew (used by CMS), UseParallelGC and UseG1GC can change the length field
// of an "old copy" of an object array in the young gen so it indicates