< prev index next >
src/share/vm/gc/g1/g1ConcurrentMark.inline.hpp
Print this page
rev 12311 : 8057003: Large reference arrays cause extremely long synchronization times
Summary: Slice large object arrays into parts so that the synchronization of marking threads with an STW pause request does not take long.
Reviewed-by:
*** 115,129 ****
// It scans an object and visits its children.
inline void G1CMTask::scan_object(oop obj) { process_grey_object<true>(obj); }
inline void G1CMTask::push(oop obj) {
HeapWord* objAddr = (HeapWord*) obj;
! assert(_g1h->is_in_g1_reserved(objAddr), "invariant");
! assert(!_g1h->is_on_master_free_list(
_g1h->heap_region_containing((HeapWord*) objAddr)), "invariant");
! assert(!_g1h->is_obj_ill(obj), "invariant");
! assert(_nextMarkBitMap->isMarked(objAddr), "invariant");
if (!_task_queue->push(obj)) {
// The local task queue looks full. We need to push some entries
// to the global stack.
move_entries_to_global_stack();
--- 115,129 ----
// It scans an object and visits its children.
inline void G1CMTask::scan_object(oop obj) { process_grey_object<true>(obj); }
inline void G1CMTask::push(oop obj) {
HeapWord* objAddr = (HeapWord*) obj;
! assert(G1CMObjArrayProcessor::is_array_slice(obj) || _g1h->is_in_g1_reserved(objAddr), "invariant");
! assert(G1CMObjArrayProcessor::is_array_slice(obj) || !_g1h->is_on_master_free_list(
_g1h->heap_region_containing((HeapWord*) objAddr)), "invariant");
! assert(G1CMObjArrayProcessor::is_array_slice(obj) || !_g1h->is_obj_ill(obj), "invariant");
! assert(G1CMObjArrayProcessor::is_array_slice(obj) || _nextMarkBitMap->isMarked(objAddr), "invariant");
if (!_task_queue->push(obj)) {
// The local task queue looks full. We need to push some entries
// to the global stack.
move_entries_to_global_stack();
*** 169,187 ****
template<bool scan>
inline void G1CMTask::process_grey_object(oop obj) {
assert(scan || obj->is_typeArray(), "Skipping scan of grey non-typeArray");
assert(_nextMarkBitMap->isMarked((HeapWord*) obj), "invariant");
- size_t obj_size = obj->size();
- _words_scanned += obj_size;
-
if (scan) {
! obj->oop_iterate(_cm_oop_closure);
}
check_limits();
}
inline void G1CMTask::make_reference_grey(oop obj) {
if (_cm->par_mark(obj)) {
// No OrderAccess:store_load() is needed. It is implicit in the
// CAS done in G1CMBitMap::parMark() call in the routine above.
HeapWord* global_finger = _cm->finger();
--- 169,193 ----
template<bool scan>
inline void G1CMTask::process_grey_object(oop obj) {
assert(scan || obj->is_typeArray(), "Skipping scan of grey non-typeArray");
assert(_nextMarkBitMap->isMarked((HeapWord*) obj), "invariant");
if (scan) {
! if (obj->is_objArray() && _objArray_processor.is_large(objArrayOop(obj)->size())) {
! _words_scanned += _objArray_processor.process_large_grey_object(obj, objArrayOop(obj)->size());
! } else {
! _words_scanned += obj->oop_iterate_size(_cm_oop_closure);;
! }
}
check_limits();
}
+ inline size_t G1CMTask::scan_objArray(objArrayOop const obj, MemRegion mr) {
+ obj->oop_iterate(_cm_oop_closure, mr);
+ return mr.word_size();
+ }
+
inline void G1CMTask::make_reference_grey(oop obj) {
if (_cm->par_mark(obj)) {
// No OrderAccess:store_load() is needed. It is implicit in the
// CAS done in G1CMBitMap::parMark() call in the routine above.
HeapWord* global_finger = _cm->finger();
< prev index next >