6906727: UseCompressedOops: some card-marking fixes related to object arrays

Introduced a new write_ref_array(HeapWords* start, size_t count) method that does the requisite MemRegion range calculation so (some of the) clients of the erstwhile write_ref_array(MemRegion mr) do not need to worry. This removed all external uses of array_size(), which was also simplified and made private. Asserts were added to catch other possible issues. Further, less essential, fixes stemming from this investigation are deferred to CR 6904516 (to follow shortly in hs17).

Reviewed-by: kvn, coleenp, jmasa
This commit is contained in:
Y. Srinivas Ramakrishna 2009-12-03 15:01:57 -08:00
parent 5a239d996b
commit d875a8e0f1
8 changed files with 74 additions and 36 deletions

View file

@ -127,16 +127,14 @@ template <class T> void objArrayKlass::do_copy(arrayOop s, T* src,
// pointer delta is scaled to number of elements (length field in
// objArrayOop) which we assume is 32 bit.
assert(pd == (size_t)(int)pd, "length field overflow");
const size_t done_word_len = objArrayOopDesc::array_size((int)pd);
bs->write_ref_array(MemRegion((HeapWord*)dst, done_word_len));
bs->write_ref_array((HeapWord*)dst, pd);
THROW(vmSymbols::java_lang_ArrayStoreException());
return;
}
}
}
}
const size_t word_len = objArrayOopDesc::array_size(length);
bs->write_ref_array(MemRegion((HeapWord*)dst, word_len));
bs->write_ref_array((HeapWord*)dst, length);
}
void objArrayKlass::copy_array(arrayOop s, int src_pos, arrayOop d,