< prev index next > src/hotspot/share/gc/parallel/psParallelCompact.cpp
Print this page
#include "gc/shared/oopStorageSetParState.inline.hpp"
#include "gc/shared/preservedMarks.inline.hpp"
#include "gc/shared/referencePolicy.hpp"
#include "gc/shared/referenceProcessor.hpp"
#include "gc/shared/referenceProcessorPhaseTimes.hpp"
+ #include "gc/shared/slidingForwarding.inline.hpp"
#include "gc/shared/strongRootsScope.hpp"
#include "gc/shared/taskTerminator.hpp"
#include "gc/shared/weakProcessor.inline.hpp"
#include "gc/shared/workerPolicy.hpp"
#include "gc/shared/workerThread.hpp"
//
// Need to fill in the gap only if it's smaller than min-obj-size, and the
// filler obj will extend to next region.
// Note: If min-fill-size decreases to 1, this whole method becomes redundant.
+ if (UseCompactObjectHeaders) {
+ // The gap is always equal to min-fill-size, so nothing to do.
+ return;
+ }
assert(CollectedHeap::min_fill_size() >= 2, "inv");
#ifndef _LP64
// In 32-bit system, each heap word is 4 bytes, so MinObjAlignment == 2.
// The gap is always equal to min-fill-size, so nothing to do.
return;
#if COMPILER2_OR_JVMCI
assert(DerivedPointerTable::is_active(), "Sanity");
DerivedPointerTable::set_active(false);
#endif
+ SlidingForwarding::begin();
+
forward_to_new_addr();
adjust_pointers();
compact();
+ SlidingForwarding::end();
+
ParCompactionManager::_preserved_marks_set->restore(&ParallelScavengeHeap::heap()->workers());
ParCompactionManager::verify_all_region_stack_empty();
// Reset the mark bitmap, summary data, and do other bookkeeping. Must be
assert(mark_bitmap()->is_marked(cur_addr), "inv");
HeapWord* new_addr = destination + live_words;
oop obj = cast_to_oop(cur_addr);
if (new_addr != cur_addr) {
cm->preserved_marks()->push_if_necessary(obj, obj->mark());
! obj->forward_to(cast_to_oop(new_addr));
}
size_t obj_size = obj->size();
live_words += obj_size;
cur_addr += obj_size;
}
assert(mark_bitmap()->is_marked(cur_addr), "inv");
HeapWord* new_addr = destination + live_words;
oop obj = cast_to_oop(cur_addr);
if (new_addr != cur_addr) {
cm->preserved_marks()->push_if_necessary(obj, obj->mark());
! SlidingForwarding::forward_to(obj, cast_to_oop(new_addr));
}
size_t obj_size = obj->size();
live_words += obj_size;
cur_addr += obj_size;
}
bump_ptr = space(space_id(cur_addr))->bottom();
bump_ptr_space = space_id(bump_ptr);
}
oop obj = cast_to_oop(cur_addr);
if (cur_addr != bump_ptr) {
! assert(obj->forwardee() == cast_to_oop(bump_ptr), "inv");
}
bump_ptr += obj->size();
cur_addr += obj->size();
}
}
bump_ptr = space(space_id(cur_addr))->bottom();
bump_ptr_space = space_id(bump_ptr);
}
oop obj = cast_to_oop(cur_addr);
if (cur_addr != bump_ptr) {
! assert(SlidingForwarding::forwardee(obj) == cast_to_oop(bump_ptr), "inv");
}
bump_ptr += obj->size();
cur_addr += obj->size();
}
}
if (copy_destination() != source()) {
DEBUG_ONLY(PSParallelCompact::check_new_location(source(), destination());)
assert(source() != destination(), "inv");
assert(cast_to_oop(source())->is_forwarded(), "inv");
! assert(cast_to_oop(source())->forwardee() == cast_to_oop(destination()), "inv");
Copy::aligned_conjoint_words(source(), copy_destination(), words);
cast_to_oop(copy_destination())->init_mark();
}
update_state(words);
if (copy_destination() != source()) {
DEBUG_ONLY(PSParallelCompact::check_new_location(source(), destination());)
assert(source() != destination(), "inv");
assert(cast_to_oop(source())->is_forwarded(), "inv");
! assert(SlidingForwarding::forwardee(cast_to_oop(source())) == cast_to_oop(destination()), "inv");
Copy::aligned_conjoint_words(source(), copy_destination(), words);
cast_to_oop(copy_destination())->init_mark();
}
update_state(words);
< prev index next >