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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1ROOTPROCESSOR_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1ROOTPROCESSOR_HPP
27
28 #include "memory/allocation.hpp"
29 #include "memory/strongRootsScope.hpp"
30 #include "runtime/mutex.hpp"
31
32 class CLDClosure;
33 class CodeBlobClosure;
34 class G1CollectedHeap;
35 class G1GCPhaseTimes;
36 class G1ParPushHeapRSClosure;
37 class Monitor;
38 class OopClosure;
39 class SubTasksDone;
40
41 // Scoped object to assist in applying oop, CLD and code blob closures to
42 // root locations. Handles claiming of different root scanning tasks
43 // and takes care of global state for root scanning via a StrongRootsScope.
44 // In the parallel case there is a shared G1RootProcessor object where all
45 // worker thread call the process_roots methods.
46 class G1RootProcessor : public StackObj {
47 G1CollectedHeap* _g1h;
48 SubTasksDone* _process_strong_tasks;
49 StrongRootsScope _srs;
101 void process_strong_roots(OopClosure* oops,
102 CLDClosure* clds,
103 CodeBlobClosure* blobs);
104
105 // Apply oops, clds and blobs to strongly and weakly reachable roots in the system
106 void process_all_roots(OopClosure* oops,
107 CLDClosure* clds,
108 CodeBlobClosure* blobs);
109
110 // Apply scan_rs to all locations in the union of the remembered sets for all
111 // regions in the collection set
112 // (having done "set_region" to indicate the region in which the root resides),
113 void scan_remembered_sets(G1ParPushHeapRSClosure* scan_rs,
114 OopClosure* scan_non_heap_weak_roots,
115 uint worker_i);
116
117 // Inform the root processor about the number of worker threads
118 void set_num_workers(uint active_workers);
119 };
120
121 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1ROOTPROCESSOR_HPP
|
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_G1_G1ROOTPROCESSOR_HPP
26 #define SHARE_VM_GC_G1_G1ROOTPROCESSOR_HPP
27
28 #include "gc/shared/strongRootsScope.hpp"
29 #include "memory/allocation.hpp"
30 #include "runtime/mutex.hpp"
31
32 class CLDClosure;
33 class CodeBlobClosure;
34 class G1CollectedHeap;
35 class G1GCPhaseTimes;
36 class G1ParPushHeapRSClosure;
37 class Monitor;
38 class OopClosure;
39 class SubTasksDone;
40
41 // Scoped object to assist in applying oop, CLD and code blob closures to
42 // root locations. Handles claiming of different root scanning tasks
43 // and takes care of global state for root scanning via a StrongRootsScope.
44 // In the parallel case there is a shared G1RootProcessor object where all
45 // worker thread call the process_roots methods.
46 class G1RootProcessor : public StackObj {
47 G1CollectedHeap* _g1h;
48 SubTasksDone* _process_strong_tasks;
49 StrongRootsScope _srs;
101 void process_strong_roots(OopClosure* oops,
102 CLDClosure* clds,
103 CodeBlobClosure* blobs);
104
105 // Apply oops, clds and blobs to strongly and weakly reachable roots in the system
106 void process_all_roots(OopClosure* oops,
107 CLDClosure* clds,
108 CodeBlobClosure* blobs);
109
110 // Apply scan_rs to all locations in the union of the remembered sets for all
111 // regions in the collection set
112 // (having done "set_region" to indicate the region in which the root resides),
113 void scan_remembered_sets(G1ParPushHeapRSClosure* scan_rs,
114 OopClosure* scan_non_heap_weak_roots,
115 uint worker_i);
116
117 // Inform the root processor about the number of worker threads
118 void set_num_workers(uint active_workers);
119 };
120
121 #endif // SHARE_VM_GC_G1_G1ROOTPROCESSOR_HPP
|