src/share/vm/memory/sharedHeap.cpp

changeset 5277
01522ca68fc7
parent 5194
eda078b01c65
child 5461
ca9dedeebdec
equal deleted inserted replaced
5276:0abfeed51c9e 5277:01522ca68fc7
1 /* 1 /*
2 * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
45 SH_PS_FlatProfiler_oops_do, 45 SH_PS_FlatProfiler_oops_do,
46 SH_PS_Management_oops_do, 46 SH_PS_Management_oops_do,
47 SH_PS_SystemDictionary_oops_do, 47 SH_PS_SystemDictionary_oops_do,
48 SH_PS_ClassLoaderDataGraph_oops_do, 48 SH_PS_ClassLoaderDataGraph_oops_do,
49 SH_PS_jvmti_oops_do, 49 SH_PS_jvmti_oops_do,
50 SH_PS_StringTable_oops_do,
51 SH_PS_CodeCache_oops_do, 50 SH_PS_CodeCache_oops_do,
52 // Leave this one last. 51 // Leave this one last.
53 SH_PS_NumElements 52 SH_PS_NumElements
54 }; 53 };
55 54
125 SharedHeap::StrongRootsScope::StrongRootsScope(SharedHeap* outer, bool activate) 124 SharedHeap::StrongRootsScope::StrongRootsScope(SharedHeap* outer, bool activate)
126 : MarkScope(activate) 125 : MarkScope(activate)
127 { 126 {
128 if (_active) { 127 if (_active) {
129 outer->change_strong_roots_parity(); 128 outer->change_strong_roots_parity();
129 // Zero the claimed high water mark in the StringTable
130 StringTable::clear_parallel_claimed_index();
130 } 131 }
131 } 132 }
132 133
133 SharedHeap::StrongRootsScope::~StrongRootsScope() { 134 SharedHeap::StrongRootsScope::~StrongRootsScope() {
134 // nothing particular 135 // nothing particular
152 Universe::oops_do(roots); 153 Universe::oops_do(roots);
153 } 154 }
154 // Global (strong) JNI handles 155 // Global (strong) JNI handles
155 if (!_process_strong_tasks->is_task_claimed(SH_PS_JNIHandles_oops_do)) 156 if (!_process_strong_tasks->is_task_claimed(SH_PS_JNIHandles_oops_do))
156 JNIHandles::oops_do(roots); 157 JNIHandles::oops_do(roots);
158
157 // All threads execute this; the individual threads are task groups. 159 // All threads execute this; the individual threads are task groups.
158 CLDToOopClosure roots_from_clds(roots); 160 CLDToOopClosure roots_from_clds(roots);
159 CLDToOopClosure* roots_from_clds_p = (is_scavenging ? NULL : &roots_from_clds); 161 CLDToOopClosure* roots_from_clds_p = (is_scavenging ? NULL : &roots_from_clds);
160 if (ParallelGCThreads > 0) { 162 if (CollectedHeap::use_parallel_gc_threads()) {
161 Threads::possibly_parallel_oops_do(roots, roots_from_clds_p ,code_roots); 163 Threads::possibly_parallel_oops_do(roots, roots_from_clds_p, code_roots);
162 } else { 164 } else {
163 Threads::oops_do(roots, roots_from_clds_p, code_roots); 165 Threads::oops_do(roots, roots_from_clds_p, code_roots);
164 } 166 }
167
165 if (!_process_strong_tasks-> is_task_claimed(SH_PS_ObjectSynchronizer_oops_do)) 168 if (!_process_strong_tasks-> is_task_claimed(SH_PS_ObjectSynchronizer_oops_do))
166 ObjectSynchronizer::oops_do(roots); 169 ObjectSynchronizer::oops_do(roots);
167 if (!_process_strong_tasks->is_task_claimed(SH_PS_FlatProfiler_oops_do)) 170 if (!_process_strong_tasks->is_task_claimed(SH_PS_FlatProfiler_oops_do))
168 FlatProfiler::oops_do(roots); 171 FlatProfiler::oops_do(roots);
169 if (!_process_strong_tasks->is_task_claimed(SH_PS_Management_oops_do)) 172 if (!_process_strong_tasks->is_task_claimed(SH_PS_Management_oops_do))
187 } else if (so & SO_SystemClasses) { 190 } else if (so & SO_SystemClasses) {
188 ClassLoaderDataGraph::always_strong_oops_do(roots, klass_closure, !is_scavenging); 191 ClassLoaderDataGraph::always_strong_oops_do(roots, klass_closure, !is_scavenging);
189 } 192 }
190 } 193 }
191 194
192 if (!_process_strong_tasks->is_task_claimed(SH_PS_StringTable_oops_do)) { 195 // All threads execute the following. A specific chunk of buckets
193 if (so & SO_Strings) { 196 // from the StringTable are the individual tasks.
197 if (so & SO_Strings) {
198 if (CollectedHeap::use_parallel_gc_threads()) {
199 StringTable::possibly_parallel_oops_do(roots);
200 } else {
194 StringTable::oops_do(roots); 201 StringTable::oops_do(roots);
195 } 202 }
196 } 203 }
197 204
198 if (!_process_strong_tasks->is_task_claimed(SH_PS_CodeCache_oops_do)) { 205 if (!_process_strong_tasks->is_task_claimed(SH_PS_CodeCache_oops_do)) {

mercurial