author | lkorinth |
Mon, 25 Mar 2019 14:46:55 +0100 | |
changeset 54264 | 41af8d0546bc |
parent 53244 | 9807daeb47c4 |
child 54669 | ad45b3802d4e |
permissions | -rw-r--r-- |
1 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50606
diff
changeset
|
2 |
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3908
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3908
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3908
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50606
diff
changeset
|
25 |
#ifndef SHARE_GC_PARALLEL_PCTASKS_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50606
diff
changeset
|
26 |
#define SHARE_GC_PARALLEL_PCTASKS_HPP |
7397 | 27 |
|
30764 | 28 |
#include "gc/parallel/gcTaskManager.hpp" |
29 |
#include "gc/parallel/psParallelCompact.hpp" |
|
30 |
#include "gc/parallel/psTasks.hpp" |
|
7397 | 31 |
|
1 | 32 |
|
33 |
// Tasks for parallel compaction of the old generation |
|
34 |
// |
|
35 |
// Tasks are created and enqueued on a task queue. The |
|
36 |
// tasks for parallel old collector for marking objects |
|
37 |
// are MarkFromRootsTask and ThreadRootsMarkingTask. |
|
38 |
// |
|
39 |
// MarkFromRootsTask's are created |
|
40 |
// with a root group (e.g., jni_handles) and when the do_it() |
|
41 |
// method of a MarkFromRootsTask is executed, it starts marking |
|
42 |
// form it's root group. |
|
43 |
// |
|
44 |
// ThreadRootsMarkingTask's are created for each Java thread. When |
|
45 |
// the do_it() method of a ThreadRootsMarkingTask is executed, it |
|
46 |
// starts marking from the thread's roots. |
|
47 |
// |
|
22551 | 48 |
// The enqueueing of the MarkFromRootsTask and ThreadRootsMarkingTask |
1 | 49 |
// do little more than create the task and put it on a queue. The |
50 |
// queue is a GCTaskQueue and threads steal tasks from this GCTaskQueue. |
|
51 |
// |
|
52 |
// In addition to the MarkFromRootsTask and ThreadRootsMarkingTask |
|
53 |
// tasks there are StealMarkingTask tasks. The StealMarkingTask's |
|
54 |
// steal a reference from the marking stack of another |
|
55 |
// thread and transitively marks the object of the reference |
|
56 |
// and internal references. After successfully stealing a reference |
|
57 |
// and marking it, the StealMarkingTask drains its marking stack |
|
58 |
// stack before attempting another steal. |
|
59 |
// |
|
60 |
// ThreadRootsMarkingTask |
|
61 |
// |
|
62 |
// This task marks from the roots of a single thread. This task |
|
63 |
// enables marking of thread roots in parallel. |
|
64 |
// |
|
65 |
||
66 |
class ParallelTaskTerminator; |
|
67 |
||
68 |
class ThreadRootsMarkingTask : public GCTask { |
|
69 |
private: |
|
50058
f7e564cacfbc
8202649: Move the Parallel GC specific task creation functions out of Threads
stefank
parents:
47216
diff
changeset
|
70 |
Thread* _thread; |
f7e564cacfbc
8202649: Move the Parallel GC specific task creation functions out of Threads
stefank
parents:
47216
diff
changeset
|
71 |
|
1 | 72 |
public: |
50058
f7e564cacfbc
8202649: Move the Parallel GC specific task creation functions out of Threads
stefank
parents:
47216
diff
changeset
|
73 |
ThreadRootsMarkingTask(Thread* root) : _thread(root) {} |
1 | 74 |
|
75 |
char* name() { return (char *)"thread-roots-marking-task"; } |
|
76 |
||
77 |
virtual void do_it(GCTaskManager* manager, uint which); |
|
78 |
}; |
|
79 |
||
80 |
||
81 |
// |
|
82 |
// MarkFromRootsTask |
|
83 |
// |
|
84 |
// This task marks from all the roots to all live |
|
85 |
// objects. |
|
86 |
// |
|
87 |
// |
|
88 |
||
89 |
class MarkFromRootsTask : public GCTask { |
|
90 |
public: |
|
91 |
enum RootType { |
|
92 |
universe = 1, |
|
93 |
jni_handles = 2, |
|
94 |
threads = 3, |
|
95 |
object_synchronizer = 4, |
|
47106 | 96 |
management = 5, |
97 |
jvmti = 6, |
|
98 |
system_dictionary = 7, |
|
99 |
class_loader_data = 8, |
|
100 |
code_cache = 9 |
|
1 | 101 |
}; |
102 |
private: |
|
103 |
RootType _root_type; |
|
104 |
public: |
|
105 |
MarkFromRootsTask(RootType value) : _root_type(value) {} |
|
106 |
||
107 |
char* name() { return (char *)"mark-from-roots-task"; } |
|
108 |
||
109 |
virtual void do_it(GCTaskManager* manager, uint which); |
|
110 |
}; |
|
111 |
||
112 |
// |
|
113 |
// RefProcTaskProxy |
|
114 |
// |
|
115 |
// This task is used as a proxy to parallel reference processing tasks . |
|
116 |
// |
|
117 |
||
118 |
class RefProcTaskProxy : public GCTask { |
|
119 |
typedef AbstractRefProcTaskExecutor::ProcessTask ProcessTask; |
|
120 |
ProcessTask & _rp_task; |
|
121 |
uint _work_id; |
|
122 |
public: |
|
123 |
RefProcTaskProxy(ProcessTask & rp_task, uint work_id) |
|
124 |
: _rp_task(rp_task), |
|
125 |
_work_id(work_id) |
|
126 |
{ } |
|
127 |
||
128 |
private: |
|
129 |
virtual char* name() { return (char *)"Process referents by policy in parallel"; } |
|
130 |
||
131 |
virtual void do_it(GCTaskManager* manager, uint which); |
|
132 |
}; |
|
133 |
||
134 |
||
135 |
// |
|
136 |
// RefProcTaskExecutor |
|
137 |
// |
|
138 |
// Task executor is an interface for the reference processor to run |
|
139 |
// tasks using GCTaskManager. |
|
140 |
// |
|
141 |
||
142 |
class RefProcTaskExecutor: public AbstractRefProcTaskExecutor { |
|
50606
8f1d5d706bdd
8043575: Dynamically parallelize reference processing work
tschatzl
parents:
50071
diff
changeset
|
143 |
virtual void execute(ProcessTask& task, uint ergo_workers); |
1 | 144 |
}; |
145 |
||
146 |
||
147 |
// |
|
148 |
// StealMarkingTask |
|
149 |
// |
|
150 |
// This task is used to distribute work to idle threads. |
|
151 |
// |
|
152 |
||
153 |
class StealMarkingTask : public GCTask { |
|
154 |
private: |
|
155 |
ParallelTaskTerminator* const _terminator; |
|
156 |
private: |
|
157 |
||
158 |
public: |
|
159 |
char* name() { return (char *)"steal-marking-task"; } |
|
160 |
||
161 |
StealMarkingTask(ParallelTaskTerminator* t); |
|
162 |
||
163 |
ParallelTaskTerminator* terminator() { return _terminator; } |
|
164 |
||
165 |
virtual void do_it(GCTaskManager* manager, uint which); |
|
166 |
}; |
|
167 |
||
168 |
// |
|
38250
37d739fb07fc
8155992: Change name of StealRegionCompactionTask to something that emphasizes the compaction task.
jmasa
parents:
38170
diff
changeset
|
169 |
// CompactionWithStealingTask |
1 | 170 |
// |
171 |
// This task is used to distribute work to idle threads. |
|
172 |
// |
|
173 |
||
38250
37d739fb07fc
8155992: Change name of StealRegionCompactionTask to something that emphasizes the compaction task.
jmasa
parents:
38170
diff
changeset
|
174 |
class CompactionWithStealingTask : public GCTask { |
1 | 175 |
private: |
176 |
ParallelTaskTerminator* const _terminator; |
|
177 |
public: |
|
38250
37d739fb07fc
8155992: Change name of StealRegionCompactionTask to something that emphasizes the compaction task.
jmasa
parents:
38170
diff
changeset
|
178 |
CompactionWithStealingTask(ParallelTaskTerminator* t); |
1 | 179 |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
180 |
char* name() { return (char *)"steal-region-task"; } |
1 | 181 |
ParallelTaskTerminator* terminator() { return _terminator; } |
182 |
||
183 |
virtual void do_it(GCTaskManager* manager, uint which); |
|
184 |
}; |
|
185 |
||
186 |
// |
|
187 |
// UpdateDensePrefixTask |
|
188 |
// |
|
189 |
// This task is used to update the dense prefix |
|
190 |
// of a space. |
|
191 |
// |
|
192 |
||
193 |
class UpdateDensePrefixTask : public GCTask { |
|
194 |
private: |
|
195 |
PSParallelCompact::SpaceId _space_id; |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
196 |
size_t _region_index_start; |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
197 |
size_t _region_index_end; |
1 | 198 |
|
199 |
public: |
|
200 |
char* name() { return (char *)"update-dense_prefix-task"; } |
|
201 |
||
202 |
UpdateDensePrefixTask(PSParallelCompact::SpaceId space_id, |
|
1407
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
203 |
size_t region_index_start, |
9006b01ba3fd
6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents:
1
diff
changeset
|
204 |
size_t region_index_end); |
1 | 205 |
|
206 |
virtual void do_it(GCTaskManager* manager, uint which); |
|
207 |
}; |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50606
diff
changeset
|
208 |
#endif // SHARE_GC_PARALLEL_PCTASKS_HPP |