8149973: Optimize object alignment check in debug builds

Reviewed-by: coleenp, tschatzl
This commit is contained in:
Dmitry Dmitriev 2016-03-07 10:36:50 +03:00
parent 6b037d45a6
commit 34effca3ac
3 changed files with 4 additions and 18 deletions

View file

@ -295,7 +295,7 @@ address* oopDesc::address_field_addr(int offset) const { return (address*) f
// in inner GC loops so these are separated.
inline bool check_obj_alignment(oop obj) {
return cast_from_oop<intptr_t>(obj) % MinObjAlignmentInBytes == 0;
return (cast_from_oop<intptr_t>(obj) & MinObjAlignmentInBytesMask) == 0;
}
oop oopDesc::decode_heap_oop_not_null(narrowOop v) {