Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/concurrentMark.hpp @ 1023:11d4857fe5e1
6888619: G1: too many guarantees in concurrent marking
Summary: change more guarantees in concurrent marking into asserts.
Reviewed-by: apetrusenko, iveresov
author | tonyp |
---|---|
date | Wed, 07 Oct 2009 10:09:57 -0400 |
parents | 035d2e036a9b |
children | 6270f80a7331 |
comparison
equal
deleted
inserted
replaced
1022:4c3458a31e17 | 1023:11d4857fe5e1 |
---|---|
293 #define statsOnly(statement) \ | 293 #define statsOnly(statement) \ |
294 do { \ | 294 do { \ |
295 } while (0) | 295 } while (0) |
296 #endif // _MARKING_STATS_ | 296 #endif // _MARKING_STATS_ |
297 | 297 |
298 // Some extra guarantees that I like to also enable in optimised mode | |
299 // when debugging. If you want to enable them, comment out the assert | |
300 // macro and uncomment out the guaratee macro | |
301 // #define tmp_guarantee_CM(expr, str) guarantee(expr, str) | |
302 #define tmp_guarantee_CM(expr, str) assert(expr, str) | |
303 | |
304 typedef enum { | 298 typedef enum { |
305 no_verbose = 0, // verbose turned off | 299 no_verbose = 0, // verbose turned off |
306 stats_verbose, // only prints stats at the end of marking | 300 stats_verbose, // only prints stats at the end of marking |
307 low_verbose, // low verbose, mostly per region and per major event | 301 low_verbose, // low verbose, mostly per region and per major event |
308 medium_verbose, // a bit more detailed than low | 302 medium_verbose, // a bit more detailed than low |
483 // It determines whether we've run out of regions to scan. | 477 // It determines whether we've run out of regions to scan. |
484 bool out_of_regions() { return _finger == _heap_end; } | 478 bool out_of_regions() { return _finger == _heap_end; } |
485 | 479 |
486 // Returns the task with the given id | 480 // Returns the task with the given id |
487 CMTask* task(int id) { | 481 CMTask* task(int id) { |
488 guarantee( 0 <= id && id < (int) _active_tasks, "task id not within " | 482 assert(0 <= id && id < (int) _active_tasks, |
489 "active bounds" ); | 483 "task id not within active bounds"); |
490 return _tasks[id]; | 484 return _tasks[id]; |
491 } | 485 } |
492 | 486 |
493 // Returns the task queue with the given id | 487 // Returns the task queue with the given id |
494 CMTaskQueue* task_queue(int id) { | 488 CMTaskQueue* task_queue(int id) { |
495 guarantee( 0 <= id && id < (int) _active_tasks, "task queue id not within " | 489 assert(0 <= id && id < (int) _active_tasks, |
496 "active bounds" ); | 490 "task queue id not within active bounds"); |
497 return (CMTaskQueue*) _task_queues->queue(id); | 491 return (CMTaskQueue*) _task_queues->queue(id); |
498 } | 492 } |
499 | 493 |
500 // Returns the task queue set | 494 // Returns the task queue set |
501 CMTaskQueueSet* task_queues() { return _task_queues; } | 495 CMTaskQueueSet* task_queues() { return _task_queues; } |
959 // on the local queue | 953 // on the local queue |
960 void deal_with_reference(oop obj); | 954 void deal_with_reference(oop obj); |
961 | 955 |
962 // It scans an object and visits its children. | 956 // It scans an object and visits its children. |
963 void scan_object(oop obj) { | 957 void scan_object(oop obj) { |
964 tmp_guarantee_CM( _nextMarkBitMap->isMarked((HeapWord*) obj), | 958 assert(_nextMarkBitMap->isMarked((HeapWord*) obj), "invariant"); |
965 "invariant" ); | |
966 | 959 |
967 if (_cm->verbose_high()) | 960 if (_cm->verbose_high()) |
968 gclog_or_tty->print_cr("[%d] we're scanning object "PTR_FORMAT, | 961 gclog_or_tty->print_cr("[%d] we're scanning object "PTR_FORMAT, |
969 _task_id, (void*) obj); | 962 _task_id, (void*) obj); |
970 | 963 |
999 // them until the region stack is empty. | 992 // them until the region stack is empty. |
1000 void drain_region_stack(BitMapClosure* closure); | 993 void drain_region_stack(BitMapClosure* closure); |
1001 | 994 |
1002 // moves the local finger to a new location | 995 // moves the local finger to a new location |
1003 inline void move_finger_to(HeapWord* new_finger) { | 996 inline void move_finger_to(HeapWord* new_finger) { |
1004 tmp_guarantee_CM( new_finger >= _finger && new_finger < _region_limit, | 997 assert(new_finger >= _finger && new_finger < _region_limit, "invariant"); |
1005 "invariant" ); | |
1006 _finger = new_finger; | 998 _finger = new_finger; |
1007 } | 999 } |
1008 | 1000 |
1009 // moves the region finger to a new location | 1001 // moves the region finger to a new location |
1010 inline void move_region_finger_to(HeapWord* new_finger) { | 1002 inline void move_region_finger_to(HeapWord* new_finger) { |
1011 tmp_guarantee_CM( new_finger < _cm->finger(), "invariant" ); | 1003 assert(new_finger < _cm->finger(), "invariant"); |
1012 _region_finger = new_finger; | 1004 _region_finger = new_finger; |
1013 } | 1005 } |
1014 | 1006 |
1015 CMTask(int task_num, ConcurrentMark *cm, | 1007 CMTask(int task_num, ConcurrentMark *cm, |
1016 CMTaskQueue* task_queue, CMTaskQueueSet* task_queues); | 1008 CMTaskQueue* task_queue, CMTaskQueueSet* task_queues); |