25 #include "precompiled.hpp"
26 #include "aot/aotLoader.hpp"
27 #include "classfile/symbolTable.hpp"
28 #include "classfile/stringTable.hpp"
29 #include "classfile/systemDictionary.hpp"
30 #include "classfile/vmSymbols.hpp"
31 #include "code/codeCache.hpp"
32 #include "code/icBuffer.hpp"
33 #include "gc/shared/collectedHeap.inline.hpp"
34 #include "gc/shared/collectorCounters.hpp"
35 #include "gc/shared/gcId.hpp"
36 #include "gc/shared/gcLocker.inline.hpp"
37 #include "gc/shared/gcTrace.hpp"
38 #include "gc/shared/gcTraceTime.inline.hpp"
39 #include "gc/shared/genCollectedHeap.hpp"
40 #include "gc/shared/genOopClosures.inline.hpp"
41 #include "gc/shared/generationSpec.hpp"
42 #include "gc/shared/space.hpp"
43 #include "gc/shared/strongRootsScope.hpp"
44 #include "gc/shared/vmGCOperations.hpp"
45 #include "gc/shared/workgroup.hpp"
46 #include "memory/filemap.hpp"
47 #include "memory/resourceArea.hpp"
48 #include "oops/oop.inline.hpp"
49 #include "runtime/biasedLocking.hpp"
50 #include "runtime/handles.hpp"
51 #include "runtime/handles.inline.hpp"
52 #include "runtime/java.hpp"
53 #include "runtime/vmThread.hpp"
54 #include "services/management.hpp"
55 #include "services/memoryService.hpp"
56 #include "utilities/debug.hpp"
57 #include "utilities/formatBuffer.hpp"
58 #include "utilities/macros.hpp"
59 #include "utilities/stack.inline.hpp"
60 #include "utilities/vmError.hpp"
61 #if INCLUDE_ALL_GCS
62 #include "gc/cms/concurrentMarkSweepThread.hpp"
63 #include "gc/cms/vmCMSOperations.hpp"
64 #endif // INCLUDE_ALL_GCS
704 ScanningOption so,
705 bool only_strong_roots,
706 OopsInGenClosure* root_closure,
707 CLDClosure* cld_closure) {
708 MarkingCodeBlobClosure mark_code_closure(root_closure, is_adjust_phase);
709 OopsInGenClosure* weak_roots = only_strong_roots ? NULL : root_closure;
710 CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
711
712 process_roots(scope, so, root_closure, weak_roots, cld_closure, weak_cld_closure, &mark_code_closure);
713 if (is_adjust_phase) {
714 // We never treat the string table as roots during marking
715 // for the full gc, so we only need to process it during
716 // the adjust phase.
717 process_string_table_roots(scope, root_closure);
718 }
719
720 _process_strong_tasks->all_tasks_completed(scope->n_threads());
721 }
722
723 void GenCollectedHeap::gen_process_weak_roots(OopClosure* root_closure) {
724 JNIHandles::weak_oops_do(root_closure);
725 _young_gen->ref_processor()->weak_oops_do(root_closure);
726 _old_gen->ref_processor()->weak_oops_do(root_closure);
727 }
728
729 #define GCH_SINCE_SAVE_MARKS_ITERATE_DEFN(OopClosureType, nv_suffix) \
730 void GenCollectedHeap:: \
731 oop_since_save_marks_iterate(GenerationType gen, \
732 OopClosureType* cur, \
733 OopClosureType* older) { \
734 if (gen == YoungGen) { \
735 _young_gen->oop_since_save_marks_iterate##nv_suffix(cur); \
736 _old_gen->oop_since_save_marks_iterate##nv_suffix(older); \
737 } else { \
738 _old_gen->oop_since_save_marks_iterate##nv_suffix(cur); \
739 } \
740 }
741
742 ALL_SINCE_SAVE_MARKS_CLOSURES(GCH_SINCE_SAVE_MARKS_ITERATE_DEFN)
743
744 #undef GCH_SINCE_SAVE_MARKS_ITERATE_DEFN
|
25 #include "precompiled.hpp"
26 #include "aot/aotLoader.hpp"
27 #include "classfile/symbolTable.hpp"
28 #include "classfile/stringTable.hpp"
29 #include "classfile/systemDictionary.hpp"
30 #include "classfile/vmSymbols.hpp"
31 #include "code/codeCache.hpp"
32 #include "code/icBuffer.hpp"
33 #include "gc/shared/collectedHeap.inline.hpp"
34 #include "gc/shared/collectorCounters.hpp"
35 #include "gc/shared/gcId.hpp"
36 #include "gc/shared/gcLocker.inline.hpp"
37 #include "gc/shared/gcTrace.hpp"
38 #include "gc/shared/gcTraceTime.inline.hpp"
39 #include "gc/shared/genCollectedHeap.hpp"
40 #include "gc/shared/genOopClosures.inline.hpp"
41 #include "gc/shared/generationSpec.hpp"
42 #include "gc/shared/space.hpp"
43 #include "gc/shared/strongRootsScope.hpp"
44 #include "gc/shared/vmGCOperations.hpp"
45 #include "gc/shared/weakProcessor.hpp"
46 #include "gc/shared/workgroup.hpp"
47 #include "memory/filemap.hpp"
48 #include "memory/resourceArea.hpp"
49 #include "oops/oop.inline.hpp"
50 #include "runtime/biasedLocking.hpp"
51 #include "runtime/handles.hpp"
52 #include "runtime/handles.inline.hpp"
53 #include "runtime/java.hpp"
54 #include "runtime/vmThread.hpp"
55 #include "services/management.hpp"
56 #include "services/memoryService.hpp"
57 #include "utilities/debug.hpp"
58 #include "utilities/formatBuffer.hpp"
59 #include "utilities/macros.hpp"
60 #include "utilities/stack.inline.hpp"
61 #include "utilities/vmError.hpp"
62 #if INCLUDE_ALL_GCS
63 #include "gc/cms/concurrentMarkSweepThread.hpp"
64 #include "gc/cms/vmCMSOperations.hpp"
65 #endif // INCLUDE_ALL_GCS
705 ScanningOption so,
706 bool only_strong_roots,
707 OopsInGenClosure* root_closure,
708 CLDClosure* cld_closure) {
709 MarkingCodeBlobClosure mark_code_closure(root_closure, is_adjust_phase);
710 OopsInGenClosure* weak_roots = only_strong_roots ? NULL : root_closure;
711 CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
712
713 process_roots(scope, so, root_closure, weak_roots, cld_closure, weak_cld_closure, &mark_code_closure);
714 if (is_adjust_phase) {
715 // We never treat the string table as roots during marking
716 // for the full gc, so we only need to process it during
717 // the adjust phase.
718 process_string_table_roots(scope, root_closure);
719 }
720
721 _process_strong_tasks->all_tasks_completed(scope->n_threads());
722 }
723
724 void GenCollectedHeap::gen_process_weak_roots(OopClosure* root_closure) {
725 WeakProcessor::oops_do(root_closure);
726 _young_gen->ref_processor()->weak_oops_do(root_closure);
727 _old_gen->ref_processor()->weak_oops_do(root_closure);
728 }
729
730 #define GCH_SINCE_SAVE_MARKS_ITERATE_DEFN(OopClosureType, nv_suffix) \
731 void GenCollectedHeap:: \
732 oop_since_save_marks_iterate(GenerationType gen, \
733 OopClosureType* cur, \
734 OopClosureType* older) { \
735 if (gen == YoungGen) { \
736 _young_gen->oop_since_save_marks_iterate##nv_suffix(cur); \
737 _old_gen->oop_since_save_marks_iterate##nv_suffix(older); \
738 } else { \
739 _old_gen->oop_since_save_marks_iterate##nv_suffix(cur); \
740 } \
741 }
742
743 ALL_SINCE_SAVE_MARKS_CLOSURES(GCH_SINCE_SAVE_MARKS_ITERATE_DEFN)
744
745 #undef GCH_SINCE_SAVE_MARKS_ITERATE_DEFN
|