6860920: serialize.cpp shouldn't use objArrayOopDesc::base_offset_in_bytes(T_BYTE)

Serialize.cpp currently uses objArrayOopDesc::base_offset_in_bytes(T_BYTE), which seems to be wrong.

Reviewed-by: coleenp, kvn
This commit is contained in:
Christian Thalinger 2009-07-20 08:20:00 -07:00
parent 7229ae9b95
commit 6b849a12a0
3 changed files with 7 additions and 2 deletions

View File

@ -51,7 +51,7 @@ void CompactingPermGenGen::serialize_oops(SerializeOopClosure* soc) {
soc->do_tag(arrayOopDesc::base_offset_in_bytes(T_BYTE));
soc->do_tag(sizeof(constantPoolOopDesc));
soc->do_tag(sizeof(constantPoolCacheOopDesc));
soc->do_tag(objArrayOopDesc::base_offset_in_bytes(T_BYTE));
soc->do_tag(objArrayOopDesc::base_offset_in_bytes());
soc->do_tag(typeArrayOopDesc::base_offset_in_bytes(T_BYTE));
soc->do_tag(sizeof(symbolOopDesc));
soc->do_tag(sizeof(klassOopDesc));

View File

@ -38,6 +38,11 @@ class objArrayOopDesc : public arrayOopDesc {
}
public:
// Returns the offset of the first element.
static int base_offset_in_bytes() {
return arrayOopDesc::base_offset_in_bytes(T_OBJECT);
}
// base is the address following the header.
HeapWord* base() const { return (HeapWord*) arrayOopDesc::base(T_OBJECT); }

View File

@ -2074,7 +2074,7 @@ bool LibraryCallKit::inline_unsafe_access(bool is_native_ptr, bool is_store, Bas
// See if it is a narrow oop array.
if (adr_type->isa_aryptr()) {
if (adr_type->offset() >= objArrayOopDesc::base_offset_in_bytes(type)) {
if (adr_type->offset() >= objArrayOopDesc::base_offset_in_bytes()) {
const TypeOopPtr *elem_type = adr_type->is_aryptr()->elem()->isa_oopptr();
if (elem_type != NULL) {
sharpened_klass = elem_type->klass();