8139293: TestGCEventMixedWithG1ConcurrentMark.java fails after JDK-8134953

Reviewed-by: ecaspole, jwilhelm
This commit is contained in:
Bengt Rutisson 2015-10-09 20:31:56 +02:00
parent aeffdfc249
commit b266f13f2c
4 changed files with 11 additions and 1 deletions

View file

@ -109,7 +109,7 @@ void ConcurrentMarkThread::run() {
break;
}
GCIdMark gc_id_mark;
assert(GCId::current() != GCId::undefined(), "GC id should have been set up by the initial mark GC.");
{
ResourceMark rm;
HandleMark hm;

View file

@ -2612,15 +2612,18 @@ void G1CollectedHeap::increment_old_marking_cycles_completed(bool concurrent) {
}
void G1CollectedHeap::register_concurrent_cycle_start(const Ticks& start_time) {
GCIdMarkAndRestore conc_gc_id_mark;
collector_state()->set_concurrent_cycle_started(true);
_gc_timer_cm->register_gc_start(start_time);
_gc_tracer_cm->report_gc_start(gc_cause(), _gc_timer_cm->gc_start());
trace_heap_before_gc(_gc_tracer_cm);
_cmThread->set_gc_id(GCId::current());
}
void G1CollectedHeap::register_concurrent_cycle_end() {
if (collector_state()->concurrent_cycle_started()) {
GCIdMarkAndRestore conc_gc_id_mark(_cmThread->gc_id());
if (_cm->has_aborted()) {
_gc_tracer_cm->report_concurrent_mode_failure();
}
@ -2643,6 +2646,7 @@ void G1CollectedHeap::trace_heap_after_concurrent_cycle() {
// but before the concurrent cycle end has been registered.
// Make sure that we only send the heap information once.
if (!_heap_summary_sent) {
GCIdMarkAndRestore conc_gc_id_mark(_cmThread->gc_id());
trace_heap_after_gc(_gc_tracer_cm);
_heap_summary_sent = true;
}

View file

@ -60,6 +60,11 @@ GCIdMark::~GCIdMark() {
}
GCIdMarkAndRestore::GCIdMarkAndRestore() : _gc_id(GCId::create()) {
_previous_gc_id = GCId::current(); // will assert that the GC Id is not undefined
currentNamedthread()->set_gc_id(_gc_id);
}
GCIdMarkAndRestore::GCIdMarkAndRestore(uint gc_id) : _gc_id(gc_id) {
_previous_gc_id = GCId::current(); // will assert that the GC Id is not undefinied
currentNamedthread()->set_gc_id(_gc_id);
}

View file

@ -55,6 +55,7 @@ class GCIdMarkAndRestore : public StackObj {
uint _previous_gc_id;
public:
GCIdMarkAndRestore();
GCIdMarkAndRestore(uint gc_id);
~GCIdMarkAndRestore();
};