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 26 // Tasks for parallel compaction of the old generation 27 // 28 // Tasks are created and enqueued on a task queue. The 29 // tasks for parallel old collector for marking objects 30 // are MarkFromRootsTask and ThreadRootsMarkingTask. 31 // 32 // MarkFromRootsTask's are created 33 // with a root group (e.g., jni_handles) and when the do_it() 34 // method of a MarkFromRootsTask is executed, it starts marking 35 // form it's root group. 36 // 37 // ThreadRootsMarkingTask's are created for each Java thread. When 38 // the do_it() method of a ThreadRootsMarkingTask is executed, it 39 // starts marking from the thread's roots. 40 // 41 // The enqueuing of the MarkFromRootsTask and ThreadRootsMarkingTask 42 // do little more than create the task and put it on a queue. The 43 // queue is a GCTaskQueue and threads steal tasks from this GCTaskQueue. 44 // 233 // DrainStacksCompactionTask 234 // 235 // This task processes regions that have been added to the stacks of each 236 // compaction manager. 237 // 238 // Trying to use one draining thread does not work because there are no 239 // guarantees about which task will be picked up by which thread. For example, 240 // if thread A gets all the preloaded regions, thread A may not get a draining 241 // task (they may all be done by other threads). 242 // 243 244 class DrainStacksCompactionTask : public GCTask { 245 uint _stack_index; 246 uint stack_index() { return _stack_index; } 247 public: 248 DrainStacksCompactionTask(uint stack_index) : GCTask(), 249 _stack_index(stack_index) {}; 250 char* name() { return (char *)"drain-region-task"; } 251 virtual void do_it(GCTaskManager* manager, uint which); 252 }; | 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_PARALLELSCAVENGE_PCTASKS_HPP 26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP 27 28 #include "gc_implementation/parallelScavenge/gcTaskManager.hpp" 29 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp" 30 #include "gc_implementation/parallelScavenge/psTasks.hpp" 31 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 // 48 // The enqueuing of the MarkFromRootsTask and ThreadRootsMarkingTask 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 // 240 // DrainStacksCompactionTask 241 // 242 // This task processes regions that have been added to the stacks of each 243 // compaction manager. 244 // 245 // Trying to use one draining thread does not work because there are no 246 // guarantees about which task will be picked up by which thread. For example, 247 // if thread A gets all the preloaded regions, thread A may not get a draining 248 // task (they may all be done by other threads). 249 // 250 251 class DrainStacksCompactionTask : public GCTask { 252 uint _stack_index; 253 uint stack_index() { return _stack_index; } 254 public: 255 DrainStacksCompactionTask(uint stack_index) : GCTask(), 256 _stack_index(stack_index) {}; 257 char* name() { return (char *)"drain-region-task"; } 258 virtual void do_it(GCTaskManager* manager, uint which); 259 }; 260 261 #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP |