Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 13400:86e6d691f2e1
8028128: Add a type safe alternative for working with counter based data
Reviewed-by: dholmes, egahlin
author | mgronlun |
---|---|
date | Sat, 23 Nov 2013 12:25:13 +0100 |
parents | 28674af341ac |
children | 02f27ecb4f3a ff355e26c78d 5a32d2a3cc1e |
comparison
equal
deleted
inserted
replaced
13399:260ac69dc096 | 13400:86e6d691f2e1 |
---|---|
54 #include "memory/generationSpec.hpp" | 54 #include "memory/generationSpec.hpp" |
55 #include "memory/referenceProcessor.hpp" | 55 #include "memory/referenceProcessor.hpp" |
56 #include "oops/oop.inline.hpp" | 56 #include "oops/oop.inline.hpp" |
57 #include "oops/oop.pcgc.inline.hpp" | 57 #include "oops/oop.pcgc.inline.hpp" |
58 #include "runtime/vmThread.hpp" | 58 #include "runtime/vmThread.hpp" |
59 #include "utilities/ticks.hpp" | |
59 | 60 |
60 size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0; | 61 size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0; |
61 | 62 |
62 // turn it on so that the contents of the young list (scan-only / | 63 // turn it on so that the contents of the young list (scan-only / |
63 // to-be-collected) are printed at "strategic" points before / during | 64 // to-be-collected) are printed at "strategic" points before / during |
1282 if (GC_locker::check_active_before_gc()) { | 1283 if (GC_locker::check_active_before_gc()) { |
1283 return false; | 1284 return false; |
1284 } | 1285 } |
1285 | 1286 |
1286 STWGCTimer* gc_timer = G1MarkSweep::gc_timer(); | 1287 STWGCTimer* gc_timer = G1MarkSweep::gc_timer(); |
1287 gc_timer->register_gc_start(os::elapsed_counter()); | 1288 gc_timer->register_gc_start(); |
1288 | 1289 |
1289 SerialOldTracer* gc_tracer = G1MarkSweep::gc_tracer(); | 1290 SerialOldTracer* gc_tracer = G1MarkSweep::gc_tracer(); |
1290 gc_tracer->report_gc_start(gc_cause(), gc_timer->gc_start()); | 1291 gc_tracer->report_gc_start(gc_cause(), gc_timer->gc_start()); |
1291 | 1292 |
1292 SvcGCMarker sgcm(SvcGCMarker::FULL); | 1293 SvcGCMarker sgcm(SvcGCMarker::FULL); |
1550 print_heap_after_gc(); | 1551 print_heap_after_gc(); |
1551 trace_heap_after_gc(gc_tracer); | 1552 trace_heap_after_gc(gc_tracer); |
1552 | 1553 |
1553 post_full_gc_dump(gc_timer); | 1554 post_full_gc_dump(gc_timer); |
1554 | 1555 |
1555 gc_timer->register_gc_end(os::elapsed_counter()); | 1556 gc_timer->register_gc_end(); |
1556 gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions()); | 1557 gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions()); |
1557 } | 1558 } |
1558 | 1559 |
1559 return true; | 1560 return true; |
1560 } | 1561 } |
2480 // and it's waiting for a full GC to finish will be woken up. It is | 2481 // and it's waiting for a full GC to finish will be woken up. It is |
2481 // waiting in VM_G1IncCollectionPause::doit_epilogue(). | 2482 // waiting in VM_G1IncCollectionPause::doit_epilogue(). |
2482 FullGCCount_lock->notify_all(); | 2483 FullGCCount_lock->notify_all(); |
2483 } | 2484 } |
2484 | 2485 |
2485 void G1CollectedHeap::register_concurrent_cycle_start(jlong start_time) { | 2486 void G1CollectedHeap::register_concurrent_cycle_start(const Ticks& start_time) { |
2486 _concurrent_cycle_started = true; | 2487 _concurrent_cycle_started = true; |
2487 _gc_timer_cm->register_gc_start(start_time); | 2488 _gc_timer_cm->register_gc_start(start_time); |
2488 | 2489 |
2489 _gc_tracer_cm->report_gc_start(gc_cause(), _gc_timer_cm->gc_start()); | 2490 _gc_tracer_cm->report_gc_start(gc_cause(), _gc_timer_cm->gc_start()); |
2490 trace_heap_before_gc(_gc_tracer_cm); | 2491 trace_heap_before_gc(_gc_tracer_cm); |
2494 if (_concurrent_cycle_started) { | 2495 if (_concurrent_cycle_started) { |
2495 if (_cm->has_aborted()) { | 2496 if (_cm->has_aborted()) { |
2496 _gc_tracer_cm->report_concurrent_mode_failure(); | 2497 _gc_tracer_cm->report_concurrent_mode_failure(); |
2497 } | 2498 } |
2498 | 2499 |
2499 _gc_timer_cm->register_gc_end(os::elapsed_counter()); | 2500 _gc_timer_cm->register_gc_end(); |
2500 _gc_tracer_cm->report_gc_end(_gc_timer_cm->gc_end(), _gc_timer_cm->time_partitions()); | 2501 _gc_tracer_cm->report_gc_end(_gc_timer_cm->gc_end(), _gc_timer_cm->time_partitions()); |
2501 | 2502 |
2502 _concurrent_cycle_started = false; | 2503 _concurrent_cycle_started = false; |
2503 } | 2504 } |
2504 } | 2505 } |
3885 | 3886 |
3886 if (GC_locker::check_active_before_gc()) { | 3887 if (GC_locker::check_active_before_gc()) { |
3887 return false; | 3888 return false; |
3888 } | 3889 } |
3889 | 3890 |
3890 _gc_timer_stw->register_gc_start(os::elapsed_counter()); | 3891 _gc_timer_stw->register_gc_start(); |
3891 | 3892 |
3892 _gc_tracer_stw->report_gc_start(gc_cause(), _gc_timer_stw->gc_start()); | 3893 _gc_tracer_stw->report_gc_start(gc_cause(), _gc_timer_stw->gc_start()); |
3893 | 3894 |
3894 SvcGCMarker sgcm(SvcGCMarker::MINOR); | 3895 SvcGCMarker sgcm(SvcGCMarker::MINOR); |
3895 ResourceMark rm; | 3896 ResourceMark rm; |
4263 // before any GC notifications are raised. | 4264 // before any GC notifications are raised. |
4264 g1mm()->update_sizes(); | 4265 g1mm()->update_sizes(); |
4265 | 4266 |
4266 _gc_tracer_stw->report_evacuation_info(&evacuation_info); | 4267 _gc_tracer_stw->report_evacuation_info(&evacuation_info); |
4267 _gc_tracer_stw->report_tenuring_threshold(_g1_policy->tenuring_threshold()); | 4268 _gc_tracer_stw->report_tenuring_threshold(_g1_policy->tenuring_threshold()); |
4268 _gc_timer_stw->register_gc_end(os::elapsed_counter()); | 4269 _gc_timer_stw->register_gc_end(); |
4269 _gc_tracer_stw->report_gc_end(_gc_timer_stw->gc_end(), _gc_timer_stw->time_partitions()); | 4270 _gc_tracer_stw->report_gc_end(_gc_timer_stw->gc_end(), _gc_timer_stw->time_partitions()); |
4270 } | 4271 } |
4271 // It should now be safe to tell the concurrent mark thread to start | 4272 // It should now be safe to tell the concurrent mark thread to start |
4272 // without its logging output interfering with the logging output | 4273 // without its logging output interfering with the logging output |
4273 // that came from the pause. | 4274 // that came from the pause. |