annotate src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp @ 10185:d50cc62e94ff

8012715: G1: GraphKit accesses PtrQueue::_index as int but is size_t Summary: In graphKit INT operations were generated to access PtrQueue::_index which has type size_t. This is 64 bit on 64-bit machines. No problems occur on little endian machines as long as the index fits into 32 bit, but on big endian machines the upper part is read, which is zero. This leads to unnecessary branches to the slow path in the runtime. Reviewed-by: twisti, johnc Contributed-by: Martin Doerr <martin.doerr@sap.com>
author johnc
date Wed, 24 Apr 2013 14:48:43 -0700
parents c2bf0120ee5d
children eda078b01c65
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
2426
1d1603768966 7010070: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - second pass
trims
parents: 2177
diff changeset
2 * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 989
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 989
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 989
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
28 #include "gc_implementation/parallelScavenge/gcTaskManager.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
29 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
30 #include "gc_implementation/parallelScavenge/psTasks.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
31
0
a61af66fc99e Initial load
duke
parents:
diff changeset
32
a61af66fc99e Initial load
duke
parents:
diff changeset
33 // Tasks for parallel compaction of the old generation
a61af66fc99e Initial load
duke
parents:
diff changeset
34 //
a61af66fc99e Initial load
duke
parents:
diff changeset
35 // Tasks are created and enqueued on a task queue. The
a61af66fc99e Initial load
duke
parents:
diff changeset
36 // tasks for parallel old collector for marking objects
a61af66fc99e Initial load
duke
parents:
diff changeset
37 // are MarkFromRootsTask and ThreadRootsMarkingTask.
a61af66fc99e Initial load
duke
parents:
diff changeset
38 //
a61af66fc99e Initial load
duke
parents:
diff changeset
39 // MarkFromRootsTask's are created
a61af66fc99e Initial load
duke
parents:
diff changeset
40 // with a root group (e.g., jni_handles) and when the do_it()
a61af66fc99e Initial load
duke
parents:
diff changeset
41 // method of a MarkFromRootsTask is executed, it starts marking
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // form it's root group.
a61af66fc99e Initial load
duke
parents:
diff changeset
43 //
a61af66fc99e Initial load
duke
parents:
diff changeset
44 // ThreadRootsMarkingTask's are created for each Java thread. When
a61af66fc99e Initial load
duke
parents:
diff changeset
45 // the do_it() method of a ThreadRootsMarkingTask is executed, it
a61af66fc99e Initial load
duke
parents:
diff changeset
46 // starts marking from the thread's roots.
a61af66fc99e Initial load
duke
parents:
diff changeset
47 //
a61af66fc99e Initial load
duke
parents:
diff changeset
48 // The enqueuing of the MarkFromRootsTask and ThreadRootsMarkingTask
a61af66fc99e Initial load
duke
parents:
diff changeset
49 // do little more than create the task and put it on a queue. The
a61af66fc99e Initial load
duke
parents:
diff changeset
50 // queue is a GCTaskQueue and threads steal tasks from this GCTaskQueue.
a61af66fc99e Initial load
duke
parents:
diff changeset
51 //
a61af66fc99e Initial load
duke
parents:
diff changeset
52 // In addition to the MarkFromRootsTask and ThreadRootsMarkingTask
a61af66fc99e Initial load
duke
parents:
diff changeset
53 // tasks there are StealMarkingTask tasks. The StealMarkingTask's
a61af66fc99e Initial load
duke
parents:
diff changeset
54 // steal a reference from the marking stack of another
a61af66fc99e Initial load
duke
parents:
diff changeset
55 // thread and transitively marks the object of the reference
a61af66fc99e Initial load
duke
parents:
diff changeset
56 // and internal references. After successfully stealing a reference
a61af66fc99e Initial load
duke
parents:
diff changeset
57 // and marking it, the StealMarkingTask drains its marking stack
a61af66fc99e Initial load
duke
parents:
diff changeset
58 // stack before attempting another steal.
a61af66fc99e Initial load
duke
parents:
diff changeset
59 //
a61af66fc99e Initial load
duke
parents:
diff changeset
60 // ThreadRootsMarkingTask
a61af66fc99e Initial load
duke
parents:
diff changeset
61 //
a61af66fc99e Initial load
duke
parents:
diff changeset
62 // This task marks from the roots of a single thread. This task
a61af66fc99e Initial load
duke
parents:
diff changeset
63 // enables marking of thread roots in parallel.
a61af66fc99e Initial load
duke
parents:
diff changeset
64 //
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 class ParallelTaskTerminator;
a61af66fc99e Initial load
duke
parents:
diff changeset
67
a61af66fc99e Initial load
duke
parents:
diff changeset
68 class ThreadRootsMarkingTask : public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
69 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
70 JavaThread* _java_thread;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 VMThread* _vm_thread;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
73 ThreadRootsMarkingTask(JavaThread* root) : _java_thread(root), _vm_thread(NULL) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
74 ThreadRootsMarkingTask(VMThread* root) : _java_thread(NULL), _vm_thread(root) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 char* name() { return (char *)"thread-roots-marking-task"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
77
a61af66fc99e Initial load
duke
parents:
diff changeset
78 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
79 };
a61af66fc99e Initial load
duke
parents:
diff changeset
80
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82 //
a61af66fc99e Initial load
duke
parents:
diff changeset
83 // MarkFromRootsTask
a61af66fc99e Initial load
duke
parents:
diff changeset
84 //
a61af66fc99e Initial load
duke
parents:
diff changeset
85 // This task marks from all the roots to all live
a61af66fc99e Initial load
duke
parents:
diff changeset
86 // objects.
a61af66fc99e Initial load
duke
parents:
diff changeset
87 //
a61af66fc99e Initial load
duke
parents:
diff changeset
88 //
a61af66fc99e Initial load
duke
parents:
diff changeset
89
a61af66fc99e Initial load
duke
parents:
diff changeset
90 class MarkFromRootsTask : public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
91 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
92 enum RootType {
a61af66fc99e Initial load
duke
parents:
diff changeset
93 universe = 1,
a61af66fc99e Initial load
duke
parents:
diff changeset
94 jni_handles = 2,
a61af66fc99e Initial load
duke
parents:
diff changeset
95 threads = 3,
a61af66fc99e Initial load
duke
parents:
diff changeset
96 object_synchronizer = 4,
a61af66fc99e Initial load
duke
parents:
diff changeset
97 flat_profiler = 5,
a61af66fc99e Initial load
duke
parents:
diff changeset
98 management = 6,
a61af66fc99e Initial load
duke
parents:
diff changeset
99 jvmti = 7,
a61af66fc99e Initial load
duke
parents:
diff changeset
100 system_dictionary = 8,
3915
c2bf0120ee5d 7085906: Replace the permgen allocated sentinelRef with a self-looped end
stefank
parents: 2426
diff changeset
101 code_cache = 9
0
a61af66fc99e Initial load
duke
parents:
diff changeset
102 };
a61af66fc99e Initial load
duke
parents:
diff changeset
103 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
104 RootType _root_type;
a61af66fc99e Initial load
duke
parents:
diff changeset
105 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
106 MarkFromRootsTask(RootType value) : _root_type(value) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108 char* name() { return (char *)"mark-from-roots-task"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
109
a61af66fc99e Initial load
duke
parents:
diff changeset
110 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
111 };
a61af66fc99e Initial load
duke
parents:
diff changeset
112
a61af66fc99e Initial load
duke
parents:
diff changeset
113 //
a61af66fc99e Initial load
duke
parents:
diff changeset
114 // RefProcTaskProxy
a61af66fc99e Initial load
duke
parents:
diff changeset
115 //
a61af66fc99e Initial load
duke
parents:
diff changeset
116 // This task is used as a proxy to parallel reference processing tasks .
a61af66fc99e Initial load
duke
parents:
diff changeset
117 //
a61af66fc99e Initial load
duke
parents:
diff changeset
118
a61af66fc99e Initial load
duke
parents:
diff changeset
119 class RefProcTaskProxy : public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
120 typedef AbstractRefProcTaskExecutor::ProcessTask ProcessTask;
a61af66fc99e Initial load
duke
parents:
diff changeset
121 ProcessTask & _rp_task;
a61af66fc99e Initial load
duke
parents:
diff changeset
122 uint _work_id;
a61af66fc99e Initial load
duke
parents:
diff changeset
123 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
124 RefProcTaskProxy(ProcessTask & rp_task, uint work_id)
a61af66fc99e Initial load
duke
parents:
diff changeset
125 : _rp_task(rp_task),
a61af66fc99e Initial load
duke
parents:
diff changeset
126 _work_id(work_id)
a61af66fc99e Initial load
duke
parents:
diff changeset
127 { }
a61af66fc99e Initial load
duke
parents:
diff changeset
128
a61af66fc99e Initial load
duke
parents:
diff changeset
129 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
130 virtual char* name() { return (char *)"Process referents by policy in parallel"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
131
a61af66fc99e Initial load
duke
parents:
diff changeset
132 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
133 };
a61af66fc99e Initial load
duke
parents:
diff changeset
134
a61af66fc99e Initial load
duke
parents:
diff changeset
135
a61af66fc99e Initial load
duke
parents:
diff changeset
136
a61af66fc99e Initial load
duke
parents:
diff changeset
137 //
a61af66fc99e Initial load
duke
parents:
diff changeset
138 // RefEnqueueTaskProxy
a61af66fc99e Initial load
duke
parents:
diff changeset
139 //
a61af66fc99e Initial load
duke
parents:
diff changeset
140 // This task is used as a proxy to parallel reference processing tasks .
a61af66fc99e Initial load
duke
parents:
diff changeset
141 //
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 class RefEnqueueTaskProxy: public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
144 typedef AbstractRefProcTaskExecutor::EnqueueTask EnqueueTask;
a61af66fc99e Initial load
duke
parents:
diff changeset
145 EnqueueTask& _enq_task;
a61af66fc99e Initial load
duke
parents:
diff changeset
146 uint _work_id;
a61af66fc99e Initial load
duke
parents:
diff changeset
147
a61af66fc99e Initial load
duke
parents:
diff changeset
148 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
149 RefEnqueueTaskProxy(EnqueueTask& enq_task, uint work_id)
a61af66fc99e Initial load
duke
parents:
diff changeset
150 : _enq_task(enq_task),
a61af66fc99e Initial load
duke
parents:
diff changeset
151 _work_id(work_id)
a61af66fc99e Initial load
duke
parents:
diff changeset
152 { }
a61af66fc99e Initial load
duke
parents:
diff changeset
153
a61af66fc99e Initial load
duke
parents:
diff changeset
154 virtual char* name() { return (char *)"Enqueue reference objects in parallel"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
155 virtual void do_it(GCTaskManager* manager, uint which)
a61af66fc99e Initial load
duke
parents:
diff changeset
156 {
a61af66fc99e Initial load
duke
parents:
diff changeset
157 _enq_task.work(_work_id);
a61af66fc99e Initial load
duke
parents:
diff changeset
158 }
a61af66fc99e Initial load
duke
parents:
diff changeset
159 };
a61af66fc99e Initial load
duke
parents:
diff changeset
160
a61af66fc99e Initial load
duke
parents:
diff changeset
161
a61af66fc99e Initial load
duke
parents:
diff changeset
162 //
a61af66fc99e Initial load
duke
parents:
diff changeset
163 // RefProcTaskExecutor
a61af66fc99e Initial load
duke
parents:
diff changeset
164 //
a61af66fc99e Initial load
duke
parents:
diff changeset
165 // Task executor is an interface for the reference processor to run
a61af66fc99e Initial load
duke
parents:
diff changeset
166 // tasks using GCTaskManager.
a61af66fc99e Initial load
duke
parents:
diff changeset
167 //
a61af66fc99e Initial load
duke
parents:
diff changeset
168
a61af66fc99e Initial load
duke
parents:
diff changeset
169 class RefProcTaskExecutor: public AbstractRefProcTaskExecutor {
a61af66fc99e Initial load
duke
parents:
diff changeset
170 virtual void execute(ProcessTask& task);
a61af66fc99e Initial load
duke
parents:
diff changeset
171 virtual void execute(EnqueueTask& task);
a61af66fc99e Initial load
duke
parents:
diff changeset
172 };
a61af66fc99e Initial load
duke
parents:
diff changeset
173
a61af66fc99e Initial load
duke
parents:
diff changeset
174
a61af66fc99e Initial load
duke
parents:
diff changeset
175 //
a61af66fc99e Initial load
duke
parents:
diff changeset
176 // StealMarkingTask
a61af66fc99e Initial load
duke
parents:
diff changeset
177 //
a61af66fc99e Initial load
duke
parents:
diff changeset
178 // This task is used to distribute work to idle threads.
a61af66fc99e Initial load
duke
parents:
diff changeset
179 //
a61af66fc99e Initial load
duke
parents:
diff changeset
180
a61af66fc99e Initial load
duke
parents:
diff changeset
181 class StealMarkingTask : public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
182 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
183 ParallelTaskTerminator* const _terminator;
a61af66fc99e Initial load
duke
parents:
diff changeset
184 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
185
a61af66fc99e Initial load
duke
parents:
diff changeset
186 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
187 char* name() { return (char *)"steal-marking-task"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
188
a61af66fc99e Initial load
duke
parents:
diff changeset
189 StealMarkingTask(ParallelTaskTerminator* t);
a61af66fc99e Initial load
duke
parents:
diff changeset
190
a61af66fc99e Initial load
duke
parents:
diff changeset
191 ParallelTaskTerminator* terminator() { return _terminator; }
a61af66fc99e Initial load
duke
parents:
diff changeset
192
a61af66fc99e Initial load
duke
parents:
diff changeset
193 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
194 };
a61af66fc99e Initial load
duke
parents:
diff changeset
195
a61af66fc99e Initial load
duke
parents:
diff changeset
196 //
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
197 // StealRegionCompactionTask
0
a61af66fc99e Initial load
duke
parents:
diff changeset
198 //
a61af66fc99e Initial load
duke
parents:
diff changeset
199 // This task is used to distribute work to idle threads.
a61af66fc99e Initial load
duke
parents:
diff changeset
200 //
a61af66fc99e Initial load
duke
parents:
diff changeset
201
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
202 class StealRegionCompactionTask : public GCTask {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
203 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
204 ParallelTaskTerminator* const _terminator;
a61af66fc99e Initial load
duke
parents:
diff changeset
205 public:
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
206 StealRegionCompactionTask(ParallelTaskTerminator* t);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
207
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
208 char* name() { return (char *)"steal-region-task"; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
209 ParallelTaskTerminator* terminator() { return _terminator; }
a61af66fc99e Initial load
duke
parents:
diff changeset
210
a61af66fc99e Initial load
duke
parents:
diff changeset
211 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
212 };
a61af66fc99e Initial load
duke
parents:
diff changeset
213
a61af66fc99e Initial load
duke
parents:
diff changeset
214 //
a61af66fc99e Initial load
duke
parents:
diff changeset
215 // UpdateDensePrefixTask
a61af66fc99e Initial load
duke
parents:
diff changeset
216 //
a61af66fc99e Initial load
duke
parents:
diff changeset
217 // This task is used to update the dense prefix
a61af66fc99e Initial load
duke
parents:
diff changeset
218 // of a space.
a61af66fc99e Initial load
duke
parents:
diff changeset
219 //
a61af66fc99e Initial load
duke
parents:
diff changeset
220
a61af66fc99e Initial load
duke
parents:
diff changeset
221 class UpdateDensePrefixTask : public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
222 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
223 PSParallelCompact::SpaceId _space_id;
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
224 size_t _region_index_start;
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
225 size_t _region_index_end;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
226
a61af66fc99e Initial load
duke
parents:
diff changeset
227 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
228 char* name() { return (char *)"update-dense_prefix-task"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
229
a61af66fc99e Initial load
duke
parents:
diff changeset
230 UpdateDensePrefixTask(PSParallelCompact::SpaceId space_id,
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
231 size_t region_index_start,
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
232 size_t region_index_end);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
233
a61af66fc99e Initial load
duke
parents:
diff changeset
234 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
235 };
a61af66fc99e Initial load
duke
parents:
diff changeset
236
a61af66fc99e Initial load
duke
parents:
diff changeset
237 //
a61af66fc99e Initial load
duke
parents:
diff changeset
238 // DrainStacksCompactionTask
a61af66fc99e Initial load
duke
parents:
diff changeset
239 //
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
240 // This task processes regions that have been added to the stacks of each
0
a61af66fc99e Initial load
duke
parents:
diff changeset
241 // compaction manager.
a61af66fc99e Initial load
duke
parents:
diff changeset
242 //
a61af66fc99e Initial load
duke
parents:
diff changeset
243 // Trying to use one draining thread does not work because there are no
a61af66fc99e Initial load
duke
parents:
diff changeset
244 // guarantees about which task will be picked up by which thread. For example,
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
245 // if thread A gets all the preloaded regions, thread A may not get a draining
0
a61af66fc99e Initial load
duke
parents:
diff changeset
246 // task (they may all be done by other threads).
a61af66fc99e Initial load
duke
parents:
diff changeset
247 //
a61af66fc99e Initial load
duke
parents:
diff changeset
248
a61af66fc99e Initial load
duke
parents:
diff changeset
249 class DrainStacksCompactionTask : public GCTask {
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
250 uint _stack_index;
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
251 uint stack_index() { return _stack_index; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
252 public:
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
253 DrainStacksCompactionTask(uint stack_index) : GCTask(),
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
254 _stack_index(stack_index) {};
375
81cd571500b0 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 0
diff changeset
255 char* name() { return (char *)"drain-region-task"; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
256 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
257 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
258
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
259 #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP