1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp Sat Dec 01 00:00:00 2007 +0000 1.3 @@ -0,0 +1,145 @@ 1.4 +/* 1.5 + * Copyright 2002-2005 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. 1.11 + * 1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 + * version 2 for more details (a copy is included in the LICENSE file that 1.16 + * accompanied this code). 1.17 + * 1.18 + * You should have received a copy of the GNU General Public License version 1.19 + * 2 along with this work; if not, write to the Free Software Foundation, 1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 + * 1.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 1.24 + * have any questions. 1.25 + * 1.26 + */ 1.27 + 1.28 +// 1.29 +// psTasks.hpp is a collection of GCTasks used by the 1.30 +// parallelScavenge collector. 1.31 +// 1.32 + 1.33 +class GCTask; 1.34 +class OopClosure; 1.35 +class OopStack; 1.36 +class ObjectStartArray; 1.37 +class ParallelTaskTerminator; 1.38 +class MutableSpace; 1.39 +class PSOldGen; 1.40 +class Thread; 1.41 +class VMThread; 1.42 + 1.43 +// 1.44 +// ScavengeRootsTask 1.45 +// 1.46 +// This task scans all the roots of a given type. 1.47 +// 1.48 +// 1.49 + 1.50 +class ScavengeRootsTask : public GCTask { 1.51 + public: 1.52 + enum RootType { 1.53 + universe = 1, 1.54 + jni_handles = 2, 1.55 + threads = 3, 1.56 + object_synchronizer = 4, 1.57 + flat_profiler = 5, 1.58 + system_dictionary = 6, 1.59 + management = 7, 1.60 + jvmti = 8 1.61 + }; 1.62 + private: 1.63 + RootType _root_type; 1.64 + public: 1.65 + ScavengeRootsTask(RootType value) : _root_type(value) {} 1.66 + 1.67 + char* name() { return (char *)"scavenge-roots-task"; } 1.68 + 1.69 + virtual void do_it(GCTaskManager* manager, uint which); 1.70 +}; 1.71 + 1.72 +// 1.73 +// ThreadRootsTask 1.74 +// 1.75 +// This task scans the roots of a single thread. This task 1.76 +// enables scanning of thread roots in parallel. 1.77 +// 1.78 + 1.79 +class ThreadRootsTask : public GCTask { 1.80 + private: 1.81 + JavaThread* _java_thread; 1.82 + VMThread* _vm_thread; 1.83 + public: 1.84 + ThreadRootsTask(JavaThread* root) : _java_thread(root), _vm_thread(NULL) {} 1.85 + ThreadRootsTask(VMThread* root) : _java_thread(NULL), _vm_thread(root) {} 1.86 + 1.87 + char* name() { return (char *)"thread-roots-task"; } 1.88 + 1.89 + virtual void do_it(GCTaskManager* manager, uint which); 1.90 +}; 1.91 + 1.92 +// 1.93 +// StealTask 1.94 +// 1.95 +// This task is used to distribute work to idle threads. 1.96 +// 1.97 + 1.98 +class StealTask : public GCTask { 1.99 + private: 1.100 + ParallelTaskTerminator* const _terminator; 1.101 + public: 1.102 + char* name() { return (char *)"steal-task"; } 1.103 + 1.104 + StealTask(ParallelTaskTerminator* t); 1.105 + 1.106 + ParallelTaskTerminator* terminator() { return _terminator; } 1.107 + 1.108 + virtual void do_it(GCTaskManager* manager, uint which); 1.109 +}; 1.110 + 1.111 +// 1.112 +// SerialOldToYoungRootsTask 1.113 +// 1.114 +// This task is used to scan for roots in the perm gen 1.115 + 1.116 +class SerialOldToYoungRootsTask : public GCTask { 1.117 + private: 1.118 + PSOldGen* _gen; 1.119 + HeapWord* _gen_top; 1.120 + 1.121 + public: 1.122 + SerialOldToYoungRootsTask(PSOldGen *gen, HeapWord* gen_top) : 1.123 + _gen(gen), _gen_top(gen_top) { } 1.124 + 1.125 + char* name() { return (char *)"serial-old-to-young-roots-task"; } 1.126 + 1.127 + virtual void do_it(GCTaskManager* manager, uint which); 1.128 +}; 1.129 + 1.130 +// 1.131 +// OldToYoungRootsTask 1.132 +// 1.133 +// This task is used to scan old to young roots in parallel 1.134 + 1.135 +class OldToYoungRootsTask : public GCTask { 1.136 + private: 1.137 + PSOldGen* _gen; 1.138 + HeapWord* _gen_top; 1.139 + uint _stripe_number; 1.140 + 1.141 + public: 1.142 + OldToYoungRootsTask(PSOldGen *gen, HeapWord* gen_top, uint stripe_number) : 1.143 + _gen(gen), _gen_top(gen_top), _stripe_number(stripe_number) { } 1.144 + 1.145 + char* name() { return (char *)"old-to-young-roots-task"; } 1.146 + 1.147 + virtual void do_it(GCTaskManager* manager, uint which); 1.148 +};