提交 6d6eeee0 编写于 作者: J jmasa

Merge

......@@ -1699,6 +1699,9 @@ void SystemDictionary::always_strong_oops_do(OopClosure* blk) {
blk->do_oop(&_system_loader_lock_obj);
dictionary()->always_strong_oops_do(blk);
// Visit extra methods
invoke_method_table()->oops_do(blk);
}
void SystemDictionary::always_strong_classes_do(KlassClosure* closure) {
......
......@@ -2395,7 +2395,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) {
if (VerifyBeforeGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
Universe::verify(true);
Universe::verify();
}
// Snapshot the soft reference policy to be used in this collection cycle.
......@@ -2419,7 +2419,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) {
if (VerifyDuringGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
gclog_or_tty->print("Verify before initial mark: ");
Universe::verify(true);
Universe::verify();
}
{
bool res = markFromRoots(false);
......@@ -2431,7 +2431,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) {
if (VerifyDuringGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
gclog_or_tty->print("Verify before re-mark: ");
Universe::verify(true);
Universe::verify();
}
checkpointRootsFinal(false, clear_all_soft_refs,
init_mark_was_synchronous);
......@@ -2443,7 +2443,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) {
if (VerifyDuringGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
gclog_or_tty->print("Verify before sweep: ");
Universe::verify(true);
Universe::verify();
}
sweep(false);
assert(_collectorState == Resizing, "Incorrect state");
......@@ -2459,7 +2459,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) {
if (VerifyDuringGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
gclog_or_tty->print("Verify before reset: ");
Universe::verify(true);
Universe::verify();
}
reset(false);
assert(_collectorState == Idling, "Collector state should "
......@@ -2486,7 +2486,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) {
if (VerifyAfterGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
Universe::verify(true);
Universe::verify();
}
if (TraceCMSState) {
gclog_or_tty->print_cr("CMS Thread " INTPTR_FORMAT
......@@ -5668,7 +5668,7 @@ void CMSCollector::do_remark_non_parallel() {
if (VerifyDuringGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification
Universe::verify(true);
Universe::verify();
}
{
TraceTime t("root rescan", PrintGCDetails, false, gclog_or_tty);
......
......@@ -64,7 +64,7 @@ void VM_CMS_Operation::verify_before_gc() {
FreelistLocker x(_collector);
MutexLockerEx y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag);
Universe::heap()->prepare_for_verify();
Universe::verify(true);
Universe::verify();
}
}
......@@ -74,7 +74,7 @@ void VM_CMS_Operation::verify_after_gc() {
HandleMark hm;
FreelistLocker x(_collector);
MutexLockerEx y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag);
Universe::verify(true);
Universe::verify();
}
}
......
......@@ -399,9 +399,9 @@ protected:
// last claimed region
// marking tasks
uint _max_task_num; // maximum task number
uint _max_worker_id;// maximum worker id
uint _active_tasks; // task num currently active
CMTask** _tasks; // task queue array (max_task_num len)
CMTask** _tasks; // task queue array (max_worker_id len)
CMTaskQueueSet* _task_queues; // task queue set
ParallelTaskTerminator _terminator; // for termination
......@@ -492,10 +492,10 @@ protected:
ParallelTaskTerminator* terminator() { return &_terminator; }
// It claims the next available region to be scanned by a marking
// task. It might return NULL if the next region is empty or we have
// run out of regions. In the latter case, out_of_regions()
// task/thread. It might return NULL if the next region is empty or
// we have run out of regions. In the latter case, out_of_regions()
// determines whether we've really run out of regions or the task
// should call claim_region() again. This might seem a bit
// should call claim_region() again. This might seem a bit
// awkward. Originally, the code was written so that claim_region()
// either successfully returned with a non-empty region or there
// were no more regions to be claimed. The problem with this was
......@@ -505,7 +505,7 @@ protected:
// method. So, this way, each task will spend very little time in
// claim_region() and is allowed to call the regular clock method
// frequently.
HeapRegion* claim_region(int task);
HeapRegion* claim_region(uint worker_id);
// It determines whether we've run out of regions to scan.
bool out_of_regions() { return _finger == _heap_end; }
......@@ -537,8 +537,8 @@ protected:
bool has_aborted() { return _has_aborted; }
// Methods to enter the two overflow sync barriers
void enter_first_sync_barrier(int task_num);
void enter_second_sync_barrier(int task_num);
void enter_first_sync_barrier(uint worker_id);
void enter_second_sync_barrier(uint worker_id);
ForceOverflowSettings* force_overflow_conc() {
return &_force_overflow_conc;
......@@ -626,14 +626,14 @@ public:
double all_task_accum_vtime() {
double ret = 0.0;
for (int i = 0; i < (int)_max_task_num; ++i)
for (uint i = 0; i < _max_worker_id; ++i)
ret += _accum_task_vtime[i];
return ret;
}
// Attempts to steal an object from the task queues of other tasks
bool try_stealing(int task_num, int* hash_seed, oop& obj) {
return _task_queues->steal(task_num, hash_seed, obj);
bool try_stealing(uint worker_id, int* hash_seed, oop& obj) {
return _task_queues->steal(worker_id, hash_seed, obj);
}
ConcurrentMark(ReservedSpace rs, uint max_regions);
......@@ -823,7 +823,7 @@ public:
// Returns the card bitmap for a given task or worker id.
BitMap* count_card_bitmap_for(uint worker_id) {
assert(0 <= worker_id && worker_id < _max_task_num, "oob");
assert(0 <= worker_id && worker_id < _max_worker_id, "oob");
assert(_count_card_bitmaps != NULL, "uninitialized");
BitMap* task_card_bm = &_count_card_bitmaps[worker_id];
assert(task_card_bm->size() == _card_bm.size(), "size mismatch");
......@@ -833,7 +833,7 @@ public:
// Returns the array containing the marked bytes for each region,
// for the given worker or task id.
size_t* count_marked_bytes_array_for(uint worker_id) {
assert(0 <= worker_id && worker_id < _max_task_num, "oob");
assert(0 <= worker_id && worker_id < _max_worker_id, "oob");
assert(_count_marked_bytes != NULL, "uninitialized");
size_t* marked_bytes_array = _count_marked_bytes[worker_id];
assert(marked_bytes_array != NULL, "uninitialized");
......@@ -939,7 +939,7 @@ private:
global_stack_transfer_size = 16
};
int _task_id;
uint _worker_id;
G1CollectedHeap* _g1h;
ConcurrentMark* _cm;
CMBitMap* _nextMarkBitMap;
......@@ -1115,8 +1115,8 @@ public:
_elapsed_time_ms = os::elapsedTime() * 1000.0 - _elapsed_time_ms;
}
// returns the task ID
int task_id() { return _task_id; }
// returns the worker ID associated with this task.
uint worker_id() { return _worker_id; }
// From TerminatorTerminator. It determines whether this task should
// exit the termination protocol after it's entered it.
......@@ -1170,7 +1170,7 @@ public:
_finger = new_finger;
}
CMTask(int task_num, ConcurrentMark *cm,
CMTask(uint worker_id, ConcurrentMark *cm,
size_t* marked_bytes, BitMap* card_bm,
CMTaskQueue* task_queue, CMTaskQueueSet* task_queues);
......
......@@ -279,7 +279,7 @@ inline void CMTask::push(oop obj) {
assert(_nextMarkBitMap->isMarked(objAddr), "invariant");
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%d] pushing "PTR_FORMAT, _task_id, (void*) obj);
gclog_or_tty->print_cr("[%u] pushing "PTR_FORMAT, _worker_id, (void*) obj);
}
if (!_task_queue->push(obj)) {
......@@ -287,9 +287,9 @@ inline void CMTask::push(oop obj) {
// to the global stack.
if (_cm->verbose_medium()) {
gclog_or_tty->print_cr("[%d] task queue overflow, "
gclog_or_tty->print_cr("[%u] task queue overflow, "
"moving entries to the global stack",
_task_id);
_worker_id);
}
move_entries_to_global_stack();
......@@ -318,8 +318,8 @@ inline void CMTask::push(oop obj) {
inline void CMTask::deal_with_reference(oop obj) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%d] we're dealing with reference = "PTR_FORMAT,
_task_id, (void*) obj);
gclog_or_tty->print_cr("[%u] we're dealing with reference = "PTR_FORMAT,
_worker_id, (void*) obj);
}
++_refs_reached;
......@@ -335,8 +335,8 @@ inline void CMTask::deal_with_reference(oop obj) {
HeapRegion* hr = _g1h->heap_region_containing_raw(obj);
if (!hr->obj_allocated_since_next_marking(obj)) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%d] "PTR_FORMAT" is not considered marked",
_task_id, (void*) obj);
gclog_or_tty->print_cr("[%u] "PTR_FORMAT" is not considered marked",
_worker_id, (void*) obj);
}
// we need to mark it first
......@@ -350,8 +350,8 @@ inline void CMTask::deal_with_reference(oop obj) {
if (_finger != NULL && objAddr < _finger) {
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%d] below the local finger ("PTR_FORMAT"), "
"pushing it", _task_id, _finger);
gclog_or_tty->print_cr("[%u] below the local finger ("PTR_FORMAT"), "
"pushing it", _worker_id, _finger);
}
push(obj);
} else if (_curr_region != NULL && objAddr < _region_limit) {
......@@ -367,9 +367,9 @@ inline void CMTask::deal_with_reference(oop obj) {
// correctness problems.
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%d] below the global finger "
gclog_or_tty->print_cr("[%u] below the global finger "
"("PTR_FORMAT"), pushing it",
_task_id, global_finger);
_worker_id, global_finger);
}
push(obj);
} else {
......@@ -382,9 +382,9 @@ inline void CMTask::deal_with_reference(oop obj) {
// see long comment above
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%d] below the global finger "
gclog_or_tty->print_cr("[%u] below the global finger "
"("PTR_FORMAT"), pushing it",
_task_id, global_finger);
_worker_id, global_finger);
}
push(obj);
}
......
......@@ -3388,6 +3388,7 @@ void G1CollectedHeap::print_on(outputStream* st) const {
st->print("%u survivors (" SIZE_FORMAT "K)", survivor_regions,
(size_t) survivor_regions * HeapRegion::GrainBytes / K);
st->cr();
MetaspaceAux::print_on(st);
}
void G1CollectedHeap::print_extended_on(outputStream* st) const {
......
......@@ -111,9 +111,9 @@ inline void G1CMOopClosure::do_oop_nv(T* p) {
oop obj = oopDesc::load_decode_heap_oop(p);
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%d] we're looking at location "
gclog_or_tty->print_cr("[%u] we're looking at location "
"*"PTR_FORMAT" = "PTR_FORMAT,
_task->task_id(), p, (void*) obj);
_task->worker_id(), p, (void*) obj);
}
_task->deal_with_reference(obj);
}
......
......@@ -139,7 +139,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) {
if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification
gclog_or_tty->print(" VerifyBeforeGC:");
Universe::verify(true);
Universe::verify();
}
// Verify object start arrays
......@@ -341,7 +341,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) {
if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification
gclog_or_tty->print(" VerifyAfterGC:");
Universe::verify(false);
Universe::verify();
}
// Re-verify object start arrays
......
......@@ -983,7 +983,7 @@ void PSParallelCompact::pre_compact(PreGCValues* pre_gc_values)
if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification
gclog_or_tty->print(" VerifyBeforeGC:");
Universe::verify(true);
Universe::verify();
}
// Verify object start arrays
......@@ -2184,7 +2184,7 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification
gclog_or_tty->print(" VerifyAfterGC:");
Universe::verify(false);
Universe::verify();
}
// Re-verify object start arrays
......
......@@ -315,7 +315,7 @@ bool PSScavenge::invoke_no_policy() {
if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification
gclog_or_tty->print(" VerifyBeforeGC:");
Universe::verify(true);
Universe::verify();
}
{
......@@ -639,7 +639,7 @@ bool PSScavenge::invoke_no_policy() {
if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification
gclog_or_tty->print(" VerifyAfterGC:");
Universe::verify(false);
Universe::verify();
}
heap->print_heap_after_gc();
......
......@@ -447,7 +447,7 @@ void GenCollectedHeap::do_collection(bool full,
prepared_for_verification = true;
}
gclog_or_tty->print(" VerifyBeforeGC:");
Universe::verify(true);
Universe::verify();
}
COMPILER2_PRESENT(DerivedPointerTable::clear());
......@@ -519,7 +519,7 @@ void GenCollectedHeap::do_collection(bool full,
total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification
gclog_or_tty->print(" VerifyAfterGC:");
Universe::verify(false);
Universe::verify();
}
if (PrintGCDetails) {
......
......@@ -435,8 +435,14 @@ class Universe: AllStatic {
// Debugging
static bool verify_in_progress() { return _verify_in_progress; }
static void verify(bool silent = false,
VerifyOption option = VerifyOption_Default );
static void verify(bool silent, VerifyOption option);
static void verify(bool silent) {
verify(silent, VerifyOption_Default /* option */);
}
static void verify() {
verify(false /* silent */);
}
static int verify_count() { return _verify_count; }
// The default behavior is to call print_on() on gclog_or_tty.
static void print();
......
......@@ -477,7 +477,7 @@ extern "C" void verify() {
}
// Ensure Eden top is correct before verification
Universe::heap()->prepare_for_verify();
Universe::verify(true);
Universe::verify();
if (!safe) SafepointSynchronize::set_is_not_at_safepoint();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册