8193312: Rename VM_CGC_Operation to VM_G1Concurrent

Reviewed-by: pliden, sjohanss, jgeorge
This commit is contained in:
Thomas Schatzl 2018-12-06 13:55:22 +01:00
parent 136295d845
commit b1c5e310ac
5 changed files with 28 additions and 37 deletions

View File

@ -339,7 +339,7 @@ void G1ConcurrentMarkThread::run_service() {
TimeHelper::counter_to_millis(mark_end - mark_start));
mark_manager.set_phase(G1ConcurrentPhase::REMARK, false);
CMRemark cl(_cm);
VM_CGC_Operation op(&cl, "Pause Remark");
VM_G1Concurrent op(&cl, "Pause Remark");
VMThread::execute(&op);
if (_cm->has_aborted()) {
break;
@ -370,7 +370,7 @@ void G1ConcurrentMarkThread::run_service() {
if (!_cm->has_aborted()) {
CMCleanup cl_cl(_cm);
VM_CGC_Operation op(&cl_cl, "Pause Cleanup");
VM_G1Concurrent op(&cl_cl, "Pause Cleanup");
VMThread::execute(&op);
}

View File

@ -43,13 +43,14 @@ VM_G1CollectForAllocation::VM_G1CollectForAllocation(size_t word_size,
uint gc_count_before,
GCCause::Cause gc_cause,
bool should_initiate_conc_mark,
double target_pause_time_ms)
: VM_CollectForAllocation(word_size, gc_count_before, gc_cause),
_pause_succeeded(false),
_should_initiate_conc_mark(should_initiate_conc_mark),
_should_retry_gc(false),
_target_pause_time_ms(target_pause_time_ms),
_old_marking_cycles_completed_before(0) {
double target_pause_time_ms) :
VM_CollectForAllocation(word_size, gc_count_before, gc_cause),
_pause_succeeded(false),
_should_initiate_conc_mark(should_initiate_conc_mark),
_should_retry_gc(false),
_target_pause_time_ms(target_pause_time_ms),
_old_marking_cycles_completed_before(0) {
guarantee(target_pause_time_ms > 0.0,
"target_pause_time_ms = %1.6lf should be positive",
target_pause_time_ms);
@ -199,23 +200,23 @@ void VM_G1CollectForAllocation::doit_epilogue() {
}
}
void VM_CGC_Operation::doit() {
void VM_G1Concurrent::doit() {
GCIdMark gc_id_mark(_gc_id);
GCTraceCPUTime tcpu;
G1CollectedHeap* g1h = G1CollectedHeap::heap();
GCTraceTime(Info, gc) t(_printGCMessage, g1h->concurrent_mark()->gc_timer_cm(), GCCause::_no_gc, true);
GCTraceTime(Info, gc) t(_message, g1h->concurrent_mark()->gc_timer_cm(), GCCause::_no_gc, true);
TraceCollectorStats tcs(g1h->g1mm()->conc_collection_counters());
SvcGCMarker sgcm(SvcGCMarker::CONCURRENT);
IsGCActiveMark x;
_cl->do_void();
}
bool VM_CGC_Operation::doit_prologue() {
bool VM_G1Concurrent::doit_prologue() {
Heap_lock->lock();
return true;
}
void VM_CGC_Operation::doit_epilogue() {
void VM_G1Concurrent::doit_epilogue() {
if (Universe::has_reference_pending_list()) {
Heap_lock->notify_all();
}

View File

@ -30,31 +30,28 @@
// VM_operations for the G1 collector.
// VM_GC_Operation:
// - VM_CGC_Operation
// - VM_G1Concurrent
// - VM_G1CollectForAllocation
// - VM_G1CollectFull
class VM_G1CollectFull: public VM_GC_Operation {
class VM_G1CollectFull : public VM_GC_Operation {
public:
VM_G1CollectFull(uint gc_count_before,
uint full_gc_count_before,
GCCause::Cause cause)
: VM_GC_Operation(gc_count_before, cause, full_gc_count_before, true) { }
GCCause::Cause cause) :
VM_GC_Operation(gc_count_before, cause, full_gc_count_before, true) { }
virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
virtual void doit();
virtual const char* name() const {
return "G1 Full collection";
}
};
class VM_G1CollectForAllocation: public VM_CollectForAllocation {
private:
class VM_G1CollectForAllocation : public VM_CollectForAllocation {
bool _pause_succeeded;
bool _should_initiate_conc_mark;
bool _should_retry_gc;
double _target_pause_time_ms;
uint _old_marking_cycles_completed_before;
public:
VM_G1CollectForAllocation(size_t word_size,
uint gc_count_before,
@ -65,30 +62,23 @@ public:
virtual bool doit_prologue();
virtual void doit();
virtual void doit_epilogue();
virtual const char* name() const {
return "G1 collect for allocation";
}
bool should_retry_gc() const { return _should_retry_gc; }
bool pause_succeeded() { return _pause_succeeded; }
};
// Concurrent GC stop-the-world operations such as remark and cleanup;
// consider sharing these with CMS's counterparts.
class VM_CGC_Operation: public VM_Operation {
// Concurrent G1 stop-the-world operations such as remark and cleanup.
class VM_G1Concurrent : public VM_Operation {
VoidClosure* _cl;
const char* _printGCMessage;
const char* _message;
uint _gc_id;
public:
VM_CGC_Operation(VoidClosure* cl, const char *printGCMsg)
: _cl(cl), _printGCMessage(printGCMsg), _gc_id(GCId::current()) {}
virtual VMOp_Type type() const { return VMOp_CGC_Operation; }
VM_G1Concurrent(VoidClosure* cl, const char* message) :
_cl(cl), _message(message), _gc_id(GCId::current()) { }
virtual VMOp_Type type() const { return VMOp_G1Concurrent; }
virtual void doit();
virtual bool doit_prologue();
virtual void doit_epilogue();
virtual const char* name() const {
return "concurrent gc";
}
};
#endif // SHARE_VM_GC_G1_VM_OPERATIONS_G1_HPP

View File

@ -63,11 +63,11 @@
template(GenCollectForAllocation) \
template(ParallelGCFailedAllocation) \
template(ParallelGCSystemGC) \
template(CGC_Operation) \
template(CMS_Initial_Mark) \
template(CMS_Final_Remark) \
template(G1CollectForAllocation) \
template(G1CollectFull) \
template(G1Concurrent) \
template(ZOperation) \
template(HandshakeOneThread) \
template(HandshakeAllThreads) \

View File

@ -50,13 +50,13 @@ public enum VMOps {
GenCollectForAllocation,
ParallelGCFailedAllocation,
ParallelGCSystemGC,
CGC_Operation,
CMS_Initial_Mark,
CMS_Final_Remark,
G1CollectFull,
ZOperation,
G1CollectForAllocation,
G1IncCollectionPause,
G1Concurrent,
EnableBiasedLocking,
RevokeBias,
BulkRevokeBias,