src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp

Thu, 11 Dec 2008 12:05:21 -0800

author
jcoomes
date
Thu, 11 Dec 2008 12:05:21 -0800
changeset 918
0f773163217d
parent 435
a61af66fc99e
child 1424
148e5441d916
permissions
-rw-r--r--

6765954: par compact - stress mode for splitting young gen spaces
Reviewed-by: jmasa

duke@435 1 /*
duke@435 2 * Copyright 2002-2005 Sun Microsystems, Inc. All Rights Reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
duke@435 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@435 20 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@435 21 * have any questions.
duke@435 22 *
duke@435 23 */
duke@435 24
duke@435 25 //
duke@435 26 // psTasks.hpp is a collection of GCTasks used by the
duke@435 27 // parallelScavenge collector.
duke@435 28 //
duke@435 29
duke@435 30 class GCTask;
duke@435 31 class OopClosure;
duke@435 32 class OopStack;
duke@435 33 class ObjectStartArray;
duke@435 34 class ParallelTaskTerminator;
duke@435 35 class MutableSpace;
duke@435 36 class PSOldGen;
duke@435 37 class Thread;
duke@435 38 class VMThread;
duke@435 39
duke@435 40 //
duke@435 41 // ScavengeRootsTask
duke@435 42 //
duke@435 43 // This task scans all the roots of a given type.
duke@435 44 //
duke@435 45 //
duke@435 46
duke@435 47 class ScavengeRootsTask : public GCTask {
duke@435 48 public:
duke@435 49 enum RootType {
duke@435 50 universe = 1,
duke@435 51 jni_handles = 2,
duke@435 52 threads = 3,
duke@435 53 object_synchronizer = 4,
duke@435 54 flat_profiler = 5,
duke@435 55 system_dictionary = 6,
duke@435 56 management = 7,
duke@435 57 jvmti = 8
duke@435 58 };
duke@435 59 private:
duke@435 60 RootType _root_type;
duke@435 61 public:
duke@435 62 ScavengeRootsTask(RootType value) : _root_type(value) {}
duke@435 63
duke@435 64 char* name() { return (char *)"scavenge-roots-task"; }
duke@435 65
duke@435 66 virtual void do_it(GCTaskManager* manager, uint which);
duke@435 67 };
duke@435 68
duke@435 69 //
duke@435 70 // ThreadRootsTask
duke@435 71 //
duke@435 72 // This task scans the roots of a single thread. This task
duke@435 73 // enables scanning of thread roots in parallel.
duke@435 74 //
duke@435 75
duke@435 76 class ThreadRootsTask : public GCTask {
duke@435 77 private:
duke@435 78 JavaThread* _java_thread;
duke@435 79 VMThread* _vm_thread;
duke@435 80 public:
duke@435 81 ThreadRootsTask(JavaThread* root) : _java_thread(root), _vm_thread(NULL) {}
duke@435 82 ThreadRootsTask(VMThread* root) : _java_thread(NULL), _vm_thread(root) {}
duke@435 83
duke@435 84 char* name() { return (char *)"thread-roots-task"; }
duke@435 85
duke@435 86 virtual void do_it(GCTaskManager* manager, uint which);
duke@435 87 };
duke@435 88
duke@435 89 //
duke@435 90 // StealTask
duke@435 91 //
duke@435 92 // This task is used to distribute work to idle threads.
duke@435 93 //
duke@435 94
duke@435 95 class StealTask : public GCTask {
duke@435 96 private:
duke@435 97 ParallelTaskTerminator* const _terminator;
duke@435 98 public:
duke@435 99 char* name() { return (char *)"steal-task"; }
duke@435 100
duke@435 101 StealTask(ParallelTaskTerminator* t);
duke@435 102
duke@435 103 ParallelTaskTerminator* terminator() { return _terminator; }
duke@435 104
duke@435 105 virtual void do_it(GCTaskManager* manager, uint which);
duke@435 106 };
duke@435 107
duke@435 108 //
duke@435 109 // SerialOldToYoungRootsTask
duke@435 110 //
duke@435 111 // This task is used to scan for roots in the perm gen
duke@435 112
duke@435 113 class SerialOldToYoungRootsTask : public GCTask {
duke@435 114 private:
duke@435 115 PSOldGen* _gen;
duke@435 116 HeapWord* _gen_top;
duke@435 117
duke@435 118 public:
duke@435 119 SerialOldToYoungRootsTask(PSOldGen *gen, HeapWord* gen_top) :
duke@435 120 _gen(gen), _gen_top(gen_top) { }
duke@435 121
duke@435 122 char* name() { return (char *)"serial-old-to-young-roots-task"; }
duke@435 123
duke@435 124 virtual void do_it(GCTaskManager* manager, uint which);
duke@435 125 };
duke@435 126
duke@435 127 //
duke@435 128 // OldToYoungRootsTask
duke@435 129 //
duke@435 130 // This task is used to scan old to young roots in parallel
duke@435 131
duke@435 132 class OldToYoungRootsTask : public GCTask {
duke@435 133 private:
duke@435 134 PSOldGen* _gen;
duke@435 135 HeapWord* _gen_top;
duke@435 136 uint _stripe_number;
duke@435 137
duke@435 138 public:
duke@435 139 OldToYoungRootsTask(PSOldGen *gen, HeapWord* gen_top, uint stripe_number) :
duke@435 140 _gen(gen), _gen_top(gen_top), _stripe_number(stripe_number) { }
duke@435 141
duke@435 142 char* name() { return (char *)"old-to-young-roots-task"; }
duke@435 143
duke@435 144 virtual void do_it(GCTaskManager* manager, uint which);
duke@435 145 };

mercurial