hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.hpp
author tonyp
Tue, 08 Nov 2011 00:41:28 -0500
changeset 10997 0be4b3be7197
parent 10524 6594ca81279a
child 17844 28ca9179db98
permissions -rw-r--r--
7099849: G1: include heap region information in hs_err files Reviewed-by: johnc, brutisso, poonam
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
8921
14bfe81f2a9d 7010070: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - second pass
trims
parents: 8076
diff changeset
     2
 * Copyright (c) 2005, 2011, 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: 6759
diff changeset
    25
#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6759
diff changeset
    26
#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6759
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6759
diff changeset
    28
#include "gc_implementation/parallelScavenge/gcTaskManager.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6759
diff changeset
    29
#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6759
diff changeset
    30
#include "gc_implementation/parallelScavenge/psTasks.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6759
diff changeset
    31
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
// Tasks for parallel compaction of the old generation
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
// Tasks are created and enqueued on a task queue. The
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
// tasks for parallel old collector for marking objects
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
// are MarkFromRootsTask and ThreadRootsMarkingTask.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
// MarkFromRootsTask's are created
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
// with a root group (e.g., jni_handles) and when the do_it()
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
// method of a MarkFromRootsTask is executed, it starts marking
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
// form it's root group.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
// ThreadRootsMarkingTask's are created for each Java thread.  When
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
// the do_it() method of a ThreadRootsMarkingTask is executed, it
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
// starts marking from the thread's roots.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
// The enqueuing of the MarkFromRootsTask and ThreadRootsMarkingTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
// do little more than create the task and put it on a queue.  The
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
// queue is a GCTaskQueue and threads steal tasks from this GCTaskQueue.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
// In addition to the MarkFromRootsTask and ThreadRootsMarkingTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
// tasks there are StealMarkingTask tasks.  The StealMarkingTask's
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
// steal a reference from the marking stack of another
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
// thread and transitively marks the object of the reference
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
// and internal references.  After successfully stealing a reference
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
// and marking it, the StealMarkingTask drains its marking stack
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
// stack before attempting another steal.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
// ThreadRootsMarkingTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
// This task marks from the roots of a single thread. This task
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
// enables marking of thread roots in parallel.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
class ParallelTaskTerminator;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
class ThreadRootsMarkingTask : public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  JavaThread* _java_thread;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  VMThread* _vm_thread;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  ThreadRootsMarkingTask(JavaThread* root) : _java_thread(root), _vm_thread(NULL) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  ThreadRootsMarkingTask(VMThread* root) : _java_thread(NULL), _vm_thread(root) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  char* name() { return (char *)"thread-roots-marking-task"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
// MarkFromRootsTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
// This task marks from all the roots to all live
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
// objects.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
class MarkFromRootsTask : public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  enum RootType {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
    universe              = 1,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
    jni_handles           = 2,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
    threads               = 3,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
    object_synchronizer   = 4,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
    flat_profiler         = 5,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
    management            = 6,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
    jvmti                 = 7,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
    system_dictionary     = 8,
10524
6594ca81279a 7085906: Replace the permgen allocated sentinelRef with a self-looped end
stefank
parents: 8921
diff changeset
   101
    code_cache            = 9
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  RootType _root_type;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  MarkFromRootsTask(RootType value) : _root_type(value) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  char* name() { return (char *)"mark-from-roots-task"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
// RefProcTaskProxy
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
// This task is used as a proxy to parallel reference processing tasks .
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
class RefProcTaskProxy : public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  typedef AbstractRefProcTaskExecutor::ProcessTask ProcessTask;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  ProcessTask & _rp_task;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  uint          _work_id;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  RefProcTaskProxy(ProcessTask & rp_task, uint work_id)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
    : _rp_task(rp_task),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
      _work_id(work_id)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  { }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  virtual char* name() { return (char *)"Process referents by policy in parallel"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
// RefEnqueueTaskProxy
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
// This task is used as a proxy to parallel reference processing tasks .
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
class RefEnqueueTaskProxy: public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
  typedef AbstractRefProcTaskExecutor::EnqueueTask EnqueueTask;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  EnqueueTask& _enq_task;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  uint         _work_id;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  RefEnqueueTaskProxy(EnqueueTask& enq_task, uint work_id)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
    : _enq_task(enq_task),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
      _work_id(work_id)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  { }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  virtual char* name() { return (char *)"Enqueue reference objects in parallel"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  virtual void do_it(GCTaskManager* manager, uint which)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
    _enq_task.work(_work_id);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
// RefProcTaskExecutor
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
// Task executor is an interface for the reference processor to run
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
// tasks using GCTaskManager.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
class RefProcTaskExecutor: public AbstractRefProcTaskExecutor {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
  virtual void execute(ProcessTask& task);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
  virtual void execute(EnqueueTask& task);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
// StealMarkingTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
// This task is used to distribute work to idle threads.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
class StealMarkingTask : public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
   ParallelTaskTerminator* const _terminator;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
  char* name() { return (char *)"steal-marking-task"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  StealMarkingTask(ParallelTaskTerminator* t);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  ParallelTaskTerminator* terminator() { return _terminator; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
//
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   197
// StealRegionCompactionTask
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
// This task is used to distribute work to idle threads.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   202
class StealRegionCompactionTask : public GCTask {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
   ParallelTaskTerminator* const _terminator;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
 public:
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   206
  StealRegionCompactionTask(ParallelTaskTerminator* t);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   208
  char* name() { return (char *)"steal-region-task"; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  ParallelTaskTerminator* terminator() { return _terminator; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
// UpdateDensePrefixTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
// This task is used to update the dense prefix
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
// of a space.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
class UpdateDensePrefixTask : public GCTask {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
  PSParallelCompact::SpaceId _space_id;
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   224
  size_t _region_index_start;
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   225
  size_t _region_index_end;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
  char* name() { return (char *)"update-dense_prefix-task"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
  UpdateDensePrefixTask(PSParallelCompact::SpaceId space_id,
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   231
                        size_t region_index_start,
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   232
                        size_t region_index_end);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
// DrainStacksCompactionTask
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
//
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   240
// This task processes regions that have been added to the stacks of each
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
// compaction manager.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
// Trying to use one draining thread does not work because there are no
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
// guarantees about which task will be picked up by which thread.  For example,
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   245
// if thread A gets all the preloaded regions, thread A may not get a draining
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
// task (they may all be done by other threads).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
class DrainStacksCompactionTask : public GCTask {
6759
67b1a69ef5aa 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 5547
diff changeset
   250
 uint _stack_index;
67b1a69ef5aa 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 5547
diff changeset
   251
 uint stack_index() { return _stack_index; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
 public:
6759
67b1a69ef5aa 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 5547
diff changeset
   253
  DrainStacksCompactionTask(uint stack_index) : GCTask(),
67b1a69ef5aa 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 5547
diff changeset
   254
                                                _stack_index(stack_index) {};
1407
9006b01ba3fd 6725697: par compact - rename class ChunkData to RegionData
jcoomes
parents: 1
diff changeset
   255
  char* name() { return (char *)"drain-region-task"; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
  virtual void do_it(GCTaskManager* manager, uint which);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6759
diff changeset
   258
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6759
diff changeset
   259
#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PCTASKS_HPP