hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.hpp
author stefank
Tue, 23 Nov 2010 13:22:55 -0800
changeset 7397 5b173b4ca846
parent 6067 8bfddf73fc04
child 13195 be27e1b6a4b9
permissions -rw-r--r--
6989984: Use standard include model for Hospot Summary: Replaced MakeDeps and the includeDB files with more standardized solutions. Reviewed-by: coleenp, kvn, kamg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
6067
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
     2
 * Copyright (c) 2007, 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: 360
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 360
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: 360
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: 6067
diff changeset
    25
#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6067
diff changeset
    26
#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6067
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6067
diff changeset
    28
#include "memory/genOopClosures.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6067
diff changeset
    29
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
// Closures for ParNewGeneration
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
class ParScanThreadState;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
class ParNewGeneration;
6067
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
    34
typedef Padded<OopTaskQueue> ObjToScanQueue;
8bfddf73fc04 6962947: shared TaskQueue statistics
jcoomes
parents: 5547
diff changeset
    35
typedef GenericTaskQueueSet<ObjToScanQueue> ObjToScanQueueSet;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
class ParallelTaskTerminator;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
class ParScanClosure: public OopsInGenClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    39
 protected:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
  ParScanThreadState* _par_scan_state;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    41
  ParNewGeneration*   _g;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    42
  HeapWord*           _boundary;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    43
  template <class T> void inline par_do_barrier(T* p);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    44
  template <class T> void inline do_oop_work(T* p,
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    45
                                             bool gc_barrier,
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    46
                                             bool root_scan);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    47
 public:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  ParScanClosure(ParNewGeneration* g, ParScanThreadState* par_scan_state);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
class ParScanWithBarrierClosure: public ParScanClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    52
 public:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  ParScanWithBarrierClosure(ParNewGeneration* g,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
                            ParScanThreadState* par_scan_state) :
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
    ParScanClosure(g, par_scan_state) {}
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    56
  virtual void do_oop(oop* p);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    57
  virtual void do_oop(narrowOop* p);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    58
  inline void do_oop_nv(oop* p);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    59
  inline void do_oop_nv(narrowOop* p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
class ParScanWithoutBarrierClosure: public ParScanClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    63
 public:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  ParScanWithoutBarrierClosure(ParNewGeneration* g,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
                               ParScanThreadState* par_scan_state) :
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
    ParScanClosure(g, par_scan_state) {}
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    67
  virtual void do_oop(oop* p);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    68
  virtual void do_oop(narrowOop* p);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    69
  inline void do_oop_nv(oop* p);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    70
  inline void do_oop_nv(narrowOop* p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
class ParRootScanWithBarrierTwoGensClosure: public ParScanClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    74
 public:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  ParRootScanWithBarrierTwoGensClosure(ParNewGeneration* g,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
                                       ParScanThreadState* par_scan_state) :
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
    ParScanClosure(g, par_scan_state) {}
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    78
  virtual void do_oop(oop* p);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    79
  virtual void do_oop(narrowOop* p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
class ParRootScanWithoutBarrierClosure: public ParScanClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    83
 public:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  ParRootScanWithoutBarrierClosure(ParNewGeneration* g,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
                                   ParScanThreadState* par_scan_state) :
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
    ParScanClosure(g, par_scan_state) {}
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    87
  virtual void do_oop(oop* p);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    88
  virtual void do_oop(narrowOop* p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
class ParScanWeakRefClosure: public ScanWeakRefClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    92
 protected:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  ParScanThreadState* _par_scan_state;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    94
  template <class T> inline void do_oop_work(T* p);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    95
 public:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  ParScanWeakRefClosure(ParNewGeneration* g,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
                        ParScanThreadState* par_scan_state);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    98
  virtual void do_oop(oop* p);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    99
  virtual void do_oop(narrowOop* p);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   100
  inline void do_oop_nv(oop* p);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   101
  inline void do_oop_nv(narrowOop* p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
class ParEvacuateFollowersClosure: public VoidClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   105
 private:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  ParScanThreadState* _par_scan_state;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  ParScanThreadState* par_scan_state() { return _par_scan_state; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  // We want to preserve the specific types here (rather than "OopClosure")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  // for later de-virtualization of do_oop calls.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  ParScanWithoutBarrierClosure* _to_space_closure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  ParScanWithoutBarrierClosure* to_space_closure() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
    return _to_space_closure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  ParRootScanWithoutBarrierClosure* _to_space_root_closure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  ParRootScanWithoutBarrierClosure* to_space_root_closure() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
    return _to_space_root_closure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  ParScanWithBarrierClosure* _old_gen_closure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  ParScanWithBarrierClosure* old_gen_closure () {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
    return _old_gen_closure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  ParRootScanWithBarrierTwoGensClosure* _old_gen_root_closure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  ParRootScanWithBarrierTwoGensClosure* old_gen_root_closure () {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
    return _old_gen_root_closure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  ParNewGeneration* _par_gen;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  ParNewGeneration* par_gen() { return _par_gen; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  ObjToScanQueueSet*  _task_queues;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  ObjToScanQueueSet*  task_queues() { return _task_queues; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  ParallelTaskTerminator* _terminator;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  ParallelTaskTerminator* terminator() { return _terminator; }
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   137
 public:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  ParEvacuateFollowersClosure(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
    ParScanThreadState* par_scan_state_,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
    ParScanWithoutBarrierClosure* to_space_closure_,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
    ParScanWithBarrierClosure* old_gen_closure_,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
    ParRootScanWithoutBarrierClosure* to_space_root_closure_,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
    ParNewGeneration* par_gen_,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
    ParRootScanWithBarrierTwoGensClosure* old_gen_root_closure_,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
    ObjToScanQueueSet* task_queues_,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
    ParallelTaskTerminator* terminator_);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   147
  virtual void do_void();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6067
diff changeset
   149
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6067
diff changeset
   150
#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP