850 set_concurrent_marking_in_progress(); 851 } else { 852 // We currently assume that the concurrent flag has been set to 853 // false before we start remark. At this point we should also be 854 // in a STW phase. 855 assert(!concurrent_marking_in_progress(), "invariant"); 856 assert(out_of_regions(), 857 err_msg("only way to get here: _finger: "PTR_FORMAT", _heap_end: "PTR_FORMAT, 858 p2i(_finger), p2i(_heap_end))); 859 } 860 } 861 862 void ConcurrentMark::set_non_marking_state() { 863 // We set the global marking state to some default values when we're 864 // not doing marking. 865 reset_marking_state(); 866 _active_tasks = 0; 867 clear_concurrent_marking_in_progress(); 868 } 869 870 ConcurrentMark::~ConcurrentMark() { 871 // The ConcurrentMark instance is never freed. 872 ShouldNotReachHere(); 873 } 874 875 void ConcurrentMark::clearNextBitmap() { 876 G1CollectedHeap* g1h = G1CollectedHeap::heap(); 877 878 // Make sure that the concurrent mark thread looks to still be in 879 // the current cycle. 880 guarantee(cmThread()->during_cycle(), "invariant"); 881 882 // We are finishing up the current cycle by clearing the next 883 // marking bitmap and getting it ready for the next cycle. During 884 // this time no other cycle can start. So, let's make sure that this 885 // is the case. 886 guarantee(!g1h->mark_in_progress(), "invariant"); 887 888 ClearBitmapHRClosure cl(this, _nextMarkBitMap, true /* may_yield */); 889 ParClearNextMarkBitmapTask task(&cl, parallel_marking_threads(), true); 890 _parallel_workers->run_task(&task); 891 892 // Clear the liveness counting data. If the marking has been aborted, the abort() 893 // call already did that. 894 if (cl.complete()) { | 850 set_concurrent_marking_in_progress(); 851 } else { 852 // We currently assume that the concurrent flag has been set to 853 // false before we start remark. At this point we should also be 854 // in a STW phase. 855 assert(!concurrent_marking_in_progress(), "invariant"); 856 assert(out_of_regions(), 857 err_msg("only way to get here: _finger: "PTR_FORMAT", _heap_end: "PTR_FORMAT, 858 p2i(_finger), p2i(_heap_end))); 859 } 860 } 861 862 void ConcurrentMark::set_non_marking_state() { 863 // We set the global marking state to some default values when we're 864 // not doing marking. 865 reset_marking_state(); 866 _active_tasks = 0; 867 clear_concurrent_marking_in_progress(); 868 } 869 870 void ConcurrentMark::clearNextBitmap() { 871 G1CollectedHeap* g1h = G1CollectedHeap::heap(); 872 873 // Make sure that the concurrent mark thread looks to still be in 874 // the current cycle. 875 guarantee(cmThread()->during_cycle(), "invariant"); 876 877 // We are finishing up the current cycle by clearing the next 878 // marking bitmap and getting it ready for the next cycle. During 879 // this time no other cycle can start. So, let's make sure that this 880 // is the case. 881 guarantee(!g1h->mark_in_progress(), "invariant"); 882 883 ClearBitmapHRClosure cl(this, _nextMarkBitMap, true /* may_yield */); 884 ParClearNextMarkBitmapTask task(&cl, parallel_marking_threads(), true); 885 _parallel_workers->run_task(&task); 886 887 // Clear the liveness counting data. If the marking has been aborted, the abort() 888 // call already did that. 889 if (cl.complete()) { |