Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/concurrentMark.hpp @ 3316:cd8e33b2a8ad
7034139: G1: assert(Thread::current()->is_ConcurrentGC_thread()) failed: only a conc GC thread can call this.
Summary: We were calling STS join and leave during a STW pause and we are not suppoesed to. I now only call those during concurrent phase. I also added stress code in the non-product builds to force an overflows (the condition that ws uncovering the bug) to make sure it does not happen again.
Reviewed-by: johnc, brutisso
author | tonyp |
---|---|
date | Fri, 29 Apr 2011 12:40:49 -0400 |
parents | 371bbc844bf1 |
children | 69293e516993 |
comparison
equal
deleted
inserted
replaced
3315:da0fffdcc453 | 3316:cd8e33b2a8ad |
---|---|
314 } | 314 } |
315 | 315 |
316 void setEmpty() { _index = 0; clear_overflow(); } | 316 void setEmpty() { _index = 0; clear_overflow(); } |
317 }; | 317 }; |
318 | 318 |
319 class ForceOverflowSettings VALUE_OBJ_CLASS_SPEC { | |
320 private: | |
321 #ifndef PRODUCT | |
322 uintx _num_remaining; | |
323 bool _force; | |
324 #endif // !defined(PRODUCT) | |
325 | |
326 public: | |
327 void init() PRODUCT_RETURN; | |
328 void update() PRODUCT_RETURN; | |
329 bool should_force() PRODUCT_RETURN_( return false; ); | |
330 }; | |
331 | |
319 // this will enable a variety of different statistics per GC task | 332 // this will enable a variety of different statistics per GC task |
320 #define _MARKING_STATS_ 0 | 333 #define _MARKING_STATS_ 0 |
321 // this will enable the higher verbose levels | 334 // this will enable the higher verbose levels |
322 #define _MARKING_VERBOSE_ 0 | 335 #define _MARKING_VERBOSE_ 0 |
323 | 336 |
460 | 473 |
461 double* _accum_task_vtime; // accumulated task vtime | 474 double* _accum_task_vtime; // accumulated task vtime |
462 | 475 |
463 WorkGang* _parallel_workers; | 476 WorkGang* _parallel_workers; |
464 | 477 |
478 ForceOverflowSettings _force_overflow_conc; | |
479 ForceOverflowSettings _force_overflow_stw; | |
480 | |
465 void weakRefsWork(bool clear_all_soft_refs); | 481 void weakRefsWork(bool clear_all_soft_refs); |
466 | 482 |
467 void swapMarkBitMaps(); | 483 void swapMarkBitMaps(); |
468 | 484 |
469 // It resets the global marking data structures, as well as the | 485 // It resets the global marking data structures, as well as the |
470 // task local ones; should be called during initial mark. | 486 // task local ones; should be called during initial mark. |
471 void reset(); | 487 void reset(); |
472 // It resets all the marking data structures. | 488 // It resets all the marking data structures. |
473 void clear_marking_state(); | 489 void clear_marking_state(bool clear_overflow = true); |
474 | 490 |
475 // It should be called to indicate which phase we're in (concurrent | 491 // It should be called to indicate which phase we're in (concurrent |
476 // mark or remark) and how many threads are currently active. | 492 // mark or remark) and how many threads are currently active. |
477 void set_phase(size_t active_tasks, bool concurrent); | 493 void set_phase(size_t active_tasks, bool concurrent); |
478 // We do this after we're done with marking so that the marking data | 494 // We do this after we're done with marking so that the marking data |
544 bool restart_for_overflow() { return _restart_for_overflow; } | 560 bool restart_for_overflow() { return _restart_for_overflow; } |
545 | 561 |
546 // Methods to enter the two overflow sync barriers | 562 // Methods to enter the two overflow sync barriers |
547 void enter_first_sync_barrier(int task_num); | 563 void enter_first_sync_barrier(int task_num); |
548 void enter_second_sync_barrier(int task_num); | 564 void enter_second_sync_barrier(int task_num); |
565 | |
566 ForceOverflowSettings* force_overflow_conc() { | |
567 return &_force_overflow_conc; | |
568 } | |
569 | |
570 ForceOverflowSettings* force_overflow_stw() { | |
571 return &_force_overflow_stw; | |
572 } | |
573 | |
574 ForceOverflowSettings* force_overflow() { | |
575 if (concurrent()) { | |
576 return force_overflow_conc(); | |
577 } else { | |
578 return force_overflow_stw(); | |
579 } | |
580 } | |
549 | 581 |
550 public: | 582 public: |
551 // Manipulation of the global mark stack. | 583 // Manipulation of the global mark stack. |
552 // Notice that the first mark_stack_push is CAS-based, whereas the | 584 // Notice that the first mark_stack_push is CAS-based, whereas the |
553 // two below are Mutex-based. This is OK since the first one is only | 585 // two below are Mutex-based. This is OK since the first one is only |