hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp
author stefank
Thu, 01 Sep 2011 16:18:17 +0200
changeset 10524 6594ca81279a
parent 7397 5b173b4ca846
child 11174 fccee5238e70
permissions -rw-r--r--
7085906: Replace the permgen allocated sentinelRef with a self-looped end Summary: Remove the sentinelRef and let the last Reference in a discovered chain point back to itself. Reviewed-by: ysr, jmasa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
     2
 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    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
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSTASKS_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSTASKS_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "memory/allocation.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "utilities/growableArray.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    30
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
// psTasks.hpp is a collection of GCTasks used by the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
// parallelScavenge collector.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
class GCTask;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
class OopClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
class OopStack;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
class ObjectStartArray;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
class ParallelTaskTerminator;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
class MutableSpace;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
class PSOldGen;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
class Thread;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
class VMThread;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
// ScavengeRootsTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
// This task scans all the roots of a given type.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
class ScavengeRootsTask : public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  enum RootType {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
    universe              = 1,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
    jni_handles           = 2,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
    threads               = 3,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
    object_synchronizer   = 4,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
    flat_profiler         = 5,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
    system_dictionary     = 6,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
    management            = 7,
3908
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
    63
    jvmti                 = 8,
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1
diff changeset
    64
    code_cache            = 9
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  RootType _root_type;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  ScavengeRootsTask(RootType value) : _root_type(value) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  char* name() { return (char *)"scavenge-roots-task"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
// ThreadRootsTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
// This task scans the roots of a single thread. This task
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
// enables scanning of thread roots in parallel.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
class ThreadRootsTask : public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  JavaThread* _java_thread;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  VMThread* _vm_thread;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  ThreadRootsTask(JavaThread* root) : _java_thread(root), _vm_thread(NULL) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  ThreadRootsTask(VMThread* root) : _java_thread(NULL), _vm_thread(root) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  char* name() { return (char *)"thread-roots-task"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
// StealTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
// This task is used to distribute work to idle threads.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
class StealTask : public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
   ParallelTaskTerminator* const _terminator;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  char* name() { return (char *)"steal-task"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  StealTask(ParallelTaskTerminator* t);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  ParallelTaskTerminator* terminator() { return _terminator; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
// SerialOldToYoungRootsTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
// This task is used to scan for roots in the perm gen
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
class SerialOldToYoungRootsTask : public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  PSOldGen* _gen;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  HeapWord* _gen_top;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  SerialOldToYoungRootsTask(PSOldGen *gen, HeapWord* gen_top) :
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
    _gen(gen), _gen_top(gen_top) { }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  char* name() { return (char *)"serial-old-to-young-roots-task"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
// OldToYoungRootsTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
// This task is used to scan old to young roots in parallel
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
class OldToYoungRootsTask : public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  PSOldGen* _gen;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  HeapWord* _gen_top;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
  uint _stripe_number;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  OldToYoungRootsTask(PSOldGen *gen, HeapWord* gen_top, uint stripe_number) :
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
    _gen(gen), _gen_top(gen_top), _stripe_number(stripe_number) { }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  char* name() { return (char *)"old-to-young-roots-task"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   153
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   154
#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSTASKS_HPP