Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 989:148e5441d916
6863023: need non-perm oops in code cache for JSR 292
Summary: Make a special root-list for those few nmethods which might contain non-perm oops.
Reviewed-by: twisti, kvn, never, jmasa, ysr
author | jrose |
---|---|
date | Tue, 15 Sep 2009 21:53:47 -0700 |
parents | 308762b2bf14 |
children | 54b3b351d6f9 |
comparison
equal
deleted
inserted
replaced
987:00977607da34 | 989:148e5441d916 |
---|---|
745 sprintf(fn_buf, "/tmp/reachable.txt.%d", os::current_process_id()); | 745 sprintf(fn_buf, "/tmp/reachable.txt.%d", os::current_process_id()); |
746 reachable_file = fopen(fn_buf, "w"); | 746 reachable_file = fopen(fn_buf, "w"); |
747 // clear the mark bitmap (no grey objects to start with) | 747 // clear the mark bitmap (no grey objects to start with) |
748 _nextMarkBitMap->clearAll(); | 748 _nextMarkBitMap->clearAll(); |
749 PrintReachableClosure prcl(_nextMarkBitMap); | 749 PrintReachableClosure prcl(_nextMarkBitMap); |
750 g1h->process_strong_roots( | 750 g1h->process_strong_roots(true, // activate StrongRootsScope |
751 false, // fake perm gen collection | 751 false, // fake perm gen collection |
752 SharedHeap::SO_AllClasses, | 752 SharedHeap::SO_AllClasses, |
753 &prcl, // Regular roots | 753 &prcl, // Regular roots |
754 NULL, // do not visit active blobs | |
754 &prcl // Perm Gen Roots | 755 &prcl // Perm Gen Roots |
755 ); | 756 ); |
756 // The root iteration above "consumed" dirty cards in the perm gen. | 757 // The root iteration above "consumed" dirty cards in the perm gen. |
757 // Therefore, as a shortcut, we dirty all such cards. | 758 // Therefore, as a shortcut, we dirty all such cards. |
758 g1h->rem_set()->invalidate(g1h->perm_gen()->used_region(), false); | 759 g1h->rem_set()->invalidate(g1h->perm_gen()->used_region(), false); |
864 CMMarkRootsClosure older(this, g1h, true); | 865 CMMarkRootsClosure older(this, g1h, true); |
865 | 866 |
866 g1h->set_marking_started(); | 867 g1h->set_marking_started(); |
867 g1h->rem_set()->prepare_for_younger_refs_iterate(false); | 868 g1h->rem_set()->prepare_for_younger_refs_iterate(false); |
868 | 869 |
869 g1h->process_strong_roots(false, // fake perm gen collection | 870 g1h->process_strong_roots(true, // activate StrongRootsScope |
871 false, // fake perm gen collection | |
870 SharedHeap::SO_AllClasses, | 872 SharedHeap::SO_AllClasses, |
871 ¬Older, // Regular roots | 873 ¬Older, // Regular roots |
874 NULL, // do not visit active blobs | |
872 &older // Perm Gen Roots | 875 &older // Perm Gen Roots |
873 ); | 876 ); |
874 checkpointRootsInitialPost(); | 877 checkpointRootsInitialPost(); |
875 | 878 |
876 // Statistics. | 879 // Statistics. |
1961 G1CollectedHeap* g1h = G1CollectedHeap::heap(); | 1964 G1CollectedHeap* g1h = G1CollectedHeap::heap(); |
1962 | 1965 |
1963 g1h->ensure_parsability(false); | 1966 g1h->ensure_parsability(false); |
1964 | 1967 |
1965 if (ParallelGCThreads > 0) { | 1968 if (ParallelGCThreads > 0) { |
1966 g1h->change_strong_roots_parity(); | 1969 G1CollectedHeap::StrongRootsScope srs(g1h); |
1967 // this is remark, so we'll use up all available threads | 1970 // this is remark, so we'll use up all available threads |
1968 int active_workers = ParallelGCThreads; | 1971 int active_workers = ParallelGCThreads; |
1969 set_phase(active_workers, false); | 1972 set_phase(active_workers, false); |
1970 | 1973 |
1971 CMRemarkTask remarkTask(this); | 1974 CMRemarkTask remarkTask(this); |
1978 g1h->set_par_threads(0); | 1981 g1h->set_par_threads(0); |
1979 | 1982 |
1980 SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); | 1983 SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); |
1981 guarantee( satb_mq_set.completed_buffers_num() == 0, "invariant" ); | 1984 guarantee( satb_mq_set.completed_buffers_num() == 0, "invariant" ); |
1982 } else { | 1985 } else { |
1983 g1h->change_strong_roots_parity(); | 1986 G1CollectedHeap::StrongRootsScope srs(g1h); |
1984 // this is remark, so we'll use up all available threads | 1987 // this is remark, so we'll use up all available threads |
1985 int active_workers = 1; | 1988 int active_workers = 1; |
1986 set_phase(active_workers, false); | 1989 set_phase(active_workers, false); |
1987 | 1990 |
1988 CMRemarkTask remarkTask(this); | 1991 CMRemarkTask remarkTask(this); |