src/hotspot/share/gc/cms/cmsOopClosures.hpp
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 41283 hotspot/src/share/vm/gc/cms/cmsOopClosures.hpp@2615c024f3eb
child 47580 96392e113a0a
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
35862
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
     2
 * Copyright (c) 2007, 2016, 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: 3913
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3913
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: 3913
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
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 25356
diff changeset
    25
#ifndef SHARE_VM_GC_CMS_CMSOOPCLOSURES_HPP
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 25356
diff changeset
    26
#define SHARE_VM_GC_CMS_CMSOOPCLOSURES_HPP
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 25356
diff changeset
    28
#include "gc/shared/genOopClosures.hpp"
30878
f1702744b3a4 8080877: Don't use workers()->total_workers() when walking G1CollectedHeap::_task_queues
stefank
parents: 30764
diff changeset
    29
#include "gc/shared/taskqueue.hpp"
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
    30
#include "memory/iterator.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
/////////////////////////////////////////////////////////////////
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
// Closures used by ConcurrentMarkSweepGeneration's collector
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
/////////////////////////////////////////////////////////////////
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
class ConcurrentMarkSweepGeneration;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
class CMSBitMap;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
class CMSMarkStack;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
class CMSCollector;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
class MarkFromRootsClosure;
35492
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
    40
class ParMarkFromRootsClosure;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    42
// Decode the oop and call do_oop on it.
35862
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
    43
#define DO_OOP_WORK_DEFN                             \
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
    44
  void do_oop(oop obj);                              \
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
    45
  template <class T> inline void do_oop_work(T* p);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    46
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
    47
// TODO: This duplication of the MetadataAwareOopClosure class is only needed
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
    48
//       because some CMS OopClosures derive from OopsInGenClosure. It would be
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
    49
//       good to get rid of them completely.
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
    50
class MetadataAwareOopsInGenClosure: public OopsInGenClosure {
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
    51
  KlassToOopClosure _klass_closure;
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    52
 public:
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
    53
  MetadataAwareOopsInGenClosure() {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    54
    _klass_closure.initialize(this);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    55
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    56
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    57
  virtual bool do_metadata()    { return do_metadata_nv(); }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    58
  inline  bool do_metadata_nv() { return true; }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    59
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    60
  virtual void do_klass(Klass* k);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    61
  void do_klass_nv(Klass* k);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    62
32606
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30878
diff changeset
    63
  virtual void do_cld(ClassLoaderData* cld) { do_cld_nv(cld); }
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30878
diff changeset
    64
  void do_cld_nv(ClassLoaderData* cld);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    65
};
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    66
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
    67
class MarkRefsIntoClosure: public MetadataAwareOopsInGenClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    68
 private:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    69
  const MemRegion _span;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    70
  CMSBitMap*      _bitMap;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    71
 protected:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    72
  DO_OOP_WORK_DEFN
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
 public:
3913
e049e6b81e11 6885169: merge of 4957990 and 6863023 causes conflict on do_nmethods
jrose
parents: 3912
diff changeset
    74
  MarkRefsIntoClosure(MemRegion span, CMSBitMap* bitMap);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    75
  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
    76
  virtual void do_oop(narrowOop* p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
35492
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
    79
class ParMarkRefsIntoClosure: public MetadataAwareOopsInGenClosure {
18996
05c86e558c94 6412968: CMS Long initial mark pauses
jmasa
parents: 13728
diff changeset
    80
 private:
05c86e558c94 6412968: CMS Long initial mark pauses
jmasa
parents: 13728
diff changeset
    81
  const MemRegion _span;
05c86e558c94 6412968: CMS Long initial mark pauses
jmasa
parents: 13728
diff changeset
    82
  CMSBitMap*      _bitMap;
05c86e558c94 6412968: CMS Long initial mark pauses
jmasa
parents: 13728
diff changeset
    83
 protected:
05c86e558c94 6412968: CMS Long initial mark pauses
jmasa
parents: 13728
diff changeset
    84
  DO_OOP_WORK_DEFN
05c86e558c94 6412968: CMS Long initial mark pauses
jmasa
parents: 13728
diff changeset
    85
 public:
35492
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
    86
  ParMarkRefsIntoClosure(MemRegion span, CMSBitMap* bitMap);
18996
05c86e558c94 6412968: CMS Long initial mark pauses
jmasa
parents: 13728
diff changeset
    87
  virtual void do_oop(oop* p);
05c86e558c94 6412968: CMS Long initial mark pauses
jmasa
parents: 13728
diff changeset
    88
  virtual void do_oop(narrowOop* p);
05c86e558c94 6412968: CMS Long initial mark pauses
jmasa
parents: 13728
diff changeset
    89
};
05c86e558c94 6412968: CMS Long initial mark pauses
jmasa
parents: 13728
diff changeset
    90
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
// A variant of the above used in certain kinds of CMS
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
// marking verification.
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
    93
class MarkRefsIntoVerifyClosure: public MetadataAwareOopsInGenClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    94
 private:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    95
  const MemRegion _span;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    96
  CMSBitMap*      _verification_bm;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    97
  CMSBitMap*      _cms_bm;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    98
 protected:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    99
  DO_OOP_WORK_DEFN
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  MarkRefsIntoVerifyClosure(MemRegion span, CMSBitMap* verification_bm,
3913
e049e6b81e11 6885169: merge of 4957990 and 6863023 causes conflict on do_nmethods
jrose
parents: 3912
diff changeset
   102
                            CMSBitMap* cms_bm);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   103
  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
   104
  virtual void do_oop(narrowOop* p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   107
// The non-parallel version (the parallel version appears further below).
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
   108
class PushAndMarkClosure: public MetadataAwareOopClosure {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   109
 private:
3690
dba50b88bd50 6798898: CMS: bugs related to class unloading
jmasa
parents: 1605
diff changeset
   110
  CMSCollector* _collector;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   111
  MemRegion     _span;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   112
  CMSBitMap*    _bit_map;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   113
  CMSBitMap*    _mod_union_table;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   114
  CMSMarkStack* _mark_stack;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   115
  bool          _concurrent_precleaning;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   116
 protected:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   117
  DO_OOP_WORK_DEFN
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  PushAndMarkClosure(CMSCollector* collector,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
                     MemRegion span,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
                     ReferenceProcessor* rp,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
                     CMSBitMap* bit_map,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
                     CMSBitMap* mod_union_table,
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   124
                     CMSMarkStack* mark_stack,
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   125
                     bool concurrent_precleaning);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   126
  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
   127
  virtual void do_oop(narrowOop* p);
35862
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
   128
  inline void do_oop_nv(oop* p);
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
   129
  inline void do_oop_nv(narrowOop* p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   132
// In the parallel case, the bit map and the
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
// reference processor are currently all shared. Access to
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
// these shared mutable structures must use appropriate
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
// synchronization (for instance, via CAS). The marking stack
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
// used in the non-parallel case above is here replaced with
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
// an OopTaskQueue structure to allow efficient work stealing.
35492
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   138
class ParPushAndMarkClosure: public MetadataAwareOopClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   139
 private:
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   140
  CMSCollector* _collector;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   141
  MemRegion     _span;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   142
  CMSBitMap*    _bit_map;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   143
  OopTaskQueue* _work_queue;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   144
 protected:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   145
  DO_OOP_WORK_DEFN
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
 public:
35492
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   147
  ParPushAndMarkClosure(CMSCollector* collector,
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   148
                        MemRegion span,
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   149
                        ReferenceProcessor* rp,
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   150
                        CMSBitMap* bit_map,
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   151
                        OopTaskQueue* work_queue);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   152
  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
   153
  virtual void do_oop(narrowOop* p);
35862
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
   154
  inline void do_oop_nv(oop* p);
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
   155
  inline void do_oop_nv(narrowOop* p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
// The non-parallel version (the parallel version appears further below).
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
   159
class MarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   160
 private:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   161
  MemRegion          _span;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   162
  CMSBitMap*         _bit_map;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   163
  CMSMarkStack*      _mark_stack;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   164
  PushAndMarkClosure _pushAndMarkClosure;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   165
  CMSCollector*      _collector;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   166
  Mutex*             _freelistLock;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   167
  bool               _yield;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  // Whether closure is being used for concurrent precleaning
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   169
  bool               _concurrent_precleaning;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   170
 protected:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   171
  DO_OOP_WORK_DEFN
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  MarkRefsIntoAndScanClosure(MemRegion span,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
                             ReferenceProcessor* rp,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
                             CMSBitMap* bit_map,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
                             CMSBitMap* mod_union_table,
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   177
                             CMSMarkStack* mark_stack,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
                             CMSCollector* collector,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
                             bool should_yield,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
                             bool concurrent_precleaning);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   181
  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
   182
  virtual void do_oop(narrowOop* p);
35862
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
   183
  inline void do_oop_nv(oop* p);
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
   184
  inline void do_oop_nv(narrowOop* p);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   185
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  void set_freelistLock(Mutex* m) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
    _freelistLock = m;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  inline void do_yield_check();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
  void do_yield_work();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  bool take_from_overflow_list();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
22551
9bf46d16dcc6 8025856: Fix typos in the GC code
jwilhelm
parents: 22234
diff changeset
   196
// In this, the parallel avatar of MarkRefsIntoAndScanClosure, the revisit
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
// stack and the bitMap are shared, so access needs to be suitably
22551
9bf46d16dcc6 8025856: Fix typos in the GC code
jwilhelm
parents: 22234
diff changeset
   198
// synchronized. An OopTaskQueue structure, supporting efficient
9bf46d16dcc6 8025856: Fix typos in the GC code
jwilhelm
parents: 22234
diff changeset
   199
// work stealing, replaces a CMSMarkStack for storing grey objects.
35492
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   200
class ParMarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   201
 private:
35492
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   202
  MemRegion             _span;
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   203
  CMSBitMap*            _bit_map;
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   204
  OopTaskQueue*         _work_queue;
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   205
  const uint            _low_water_mark;
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   206
  ParPushAndMarkClosure _parPushAndMarkClosure;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   207
 protected:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   208
  DO_OOP_WORK_DEFN
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
 public:
35492
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   210
  ParMarkRefsIntoAndScanClosure(CMSCollector* collector,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
                                 MemRegion span,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
                                 ReferenceProcessor* rp,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
                                 CMSBitMap* bit_map,
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   214
                                 OopTaskQueue* work_queue);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   215
  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
   216
  virtual void do_oop(narrowOop* p);
35862
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
   217
  inline void do_oop_nv(oop* p);
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
   218
  inline void do_oop_nv(narrowOop* p);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   219
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  void trim_queue(uint size);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
// This closure is used during the concurrent marking phase
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
// following the first checkpoint. Its use is buried in
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
// the closure MarkFromRootsClosure.
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
   226
class PushOrMarkClosure: public MetadataAwareOopClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   227
 private:
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   228
  CMSCollector*   _collector;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   229
  MemRegion       _span;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   230
  CMSBitMap*      _bitMap;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   231
  CMSMarkStack*   _markStack;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   232
  HeapWord* const _finger;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   233
  MarkFromRootsClosure* const
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   234
                  _parent;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   235
 protected:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   236
  DO_OOP_WORK_DEFN
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
  PushOrMarkClosure(CMSCollector* cms_collector,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
                    MemRegion span,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
                    CMSBitMap* bitMap,
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   241
                    CMSMarkStack* markStack,
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   242
                    HeapWord* finger,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
                    MarkFromRootsClosure* parent);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   244
  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
   245
  virtual void do_oop(narrowOop* p);
35862
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
   246
  inline void do_oop_nv(oop* p);
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
   247
  inline void do_oop_nv(narrowOop* p);
3696
9e5d9b5e1049 4957990: Perm heap bloat in JVM
ysr
parents: 3690
diff changeset
   248
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
  // Deal with a stack overflow condition
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
  void handle_stack_overflow(HeapWord* lost);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
  inline void do_yield_check();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
// A parallel (MT) version of the above.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
// This closure is used during the concurrent marking phase
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
// following the first checkpoint. Its use is buried in
35492
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   258
// the closure ParMarkFromRootsClosure.
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   259
class ParPushOrMarkClosure: public MetadataAwareOopClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   260
 private:
41283
2615c024f3eb 8033552: Fix missing missing volatile specifiers in CAS operations in GC code
eosterlund
parents: 35862
diff changeset
   261
  CMSCollector*                  _collector;
2615c024f3eb 8033552: Fix missing missing volatile specifiers in CAS operations in GC code
eosterlund
parents: 35862
diff changeset
   262
  MemRegion                      _whole_span;
2615c024f3eb 8033552: Fix missing missing volatile specifiers in CAS operations in GC code
eosterlund
parents: 35862
diff changeset
   263
  MemRegion                      _span;       // local chunk
2615c024f3eb 8033552: Fix missing missing volatile specifiers in CAS operations in GC code
eosterlund
parents: 35862
diff changeset
   264
  CMSBitMap*                     _bit_map;
2615c024f3eb 8033552: Fix missing missing volatile specifiers in CAS operations in GC code
eosterlund
parents: 35862
diff changeset
   265
  OopTaskQueue*                  _work_queue;
2615c024f3eb 8033552: Fix missing missing volatile specifiers in CAS operations in GC code
eosterlund
parents: 35862
diff changeset
   266
  CMSMarkStack*                  _overflow_stack;
2615c024f3eb 8033552: Fix missing missing volatile specifiers in CAS operations in GC code
eosterlund
parents: 35862
diff changeset
   267
  HeapWord*  const               _finger;
2615c024f3eb 8033552: Fix missing missing volatile specifiers in CAS operations in GC code
eosterlund
parents: 35862
diff changeset
   268
  HeapWord* volatile* const      _global_finger_addr;
2615c024f3eb 8033552: Fix missing missing volatile specifiers in CAS operations in GC code
eosterlund
parents: 35862
diff changeset
   269
  ParMarkFromRootsClosure* const _parent;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   270
 protected:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   271
  DO_OOP_WORK_DEFN
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
 public:
35492
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   273
  ParPushOrMarkClosure(CMSCollector* cms_collector,
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   274
                       MemRegion span,
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   275
                       CMSBitMap* bit_map,
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   276
                       OopTaskQueue* work_queue,
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   277
                       CMSMarkStack* mark_stack,
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   278
                       HeapWord* finger,
41283
2615c024f3eb 8033552: Fix missing missing volatile specifiers in CAS operations in GC code
eosterlund
parents: 35862
diff changeset
   279
                       HeapWord* volatile* global_finger_addr,
35492
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 32606
diff changeset
   280
                       ParMarkFromRootsClosure* parent);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   281
  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
   282
  virtual void do_oop(narrowOop* p);
35862
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
   283
  inline void do_oop_nv(oop* p);
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
   284
  inline void do_oop_nv(narrowOop* p);
3696
9e5d9b5e1049 4957990: Perm heap bloat in JVM
ysr
parents: 3690
diff changeset
   285
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
  // Deal with a stack overflow condition
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
  void handle_stack_overflow(HeapWord* lost);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
  inline void do_yield_check();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
// For objects in CMS generation, this closure marks
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
// given objects (transitively) as being reachable/live.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
// This is currently used during the (weak) reference object
1605
6b43d186eb8d 6722113: CMS: Incorrect overflow handling during precleaning of Reference lists
ysr
parents: 390
diff changeset
   295
// processing phase of the CMS final checkpoint step, as
6b43d186eb8d 6722113: CMS: Incorrect overflow handling during precleaning of Reference lists
ysr
parents: 390
diff changeset
   296
// well as during the concurrent precleaning of the discovered
6b43d186eb8d 6722113: CMS: Incorrect overflow handling during precleaning of Reference lists
ysr
parents: 390
diff changeset
   297
// reference lists.
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
   298
class CMSKeepAliveClosure: public MetadataAwareOopClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   299
 private:
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   300
  CMSCollector* _collector;
390
2e094c1be4af 6662086: 6u4+, 7b11+: CMS never clears referents when -XX:+ParallelRefProcEnabled
ysr
parents: 360
diff changeset
   301
  const MemRegion _span;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
  CMSMarkStack* _mark_stack;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
  CMSBitMap*    _bit_map;
1605
6b43d186eb8d 6722113: CMS: Incorrect overflow handling during precleaning of Reference lists
ysr
parents: 390
diff changeset
   304
  bool          _concurrent_precleaning;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   305
 protected:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   306
  DO_OOP_WORK_DEFN
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
  CMSKeepAliveClosure(CMSCollector* collector, MemRegion span,
1605
6b43d186eb8d 6722113: CMS: Incorrect overflow handling during precleaning of Reference lists
ysr
parents: 390
diff changeset
   309
                      CMSBitMap* bit_map, CMSMarkStack* mark_stack,
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   310
                      bool cpc);
1605
6b43d186eb8d 6722113: CMS: Incorrect overflow handling during precleaning of Reference lists
ysr
parents: 390
diff changeset
   311
  bool    concurrent_precleaning() const { return _concurrent_precleaning; }
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   312
  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
   313
  virtual void do_oop(narrowOop* p);
35862
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
   314
  inline void do_oop_nv(oop* p);
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
   315
  inline void do_oop_nv(narrowOop* p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
   318
class CMSInnerParMarkAndPushClosure: public MetadataAwareOopClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   319
 private:
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   320
  CMSCollector* _collector;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
  MemRegion     _span;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
  OopTaskQueue* _work_queue;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
  CMSBitMap*    _bit_map;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   324
 protected:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   325
  DO_OOP_WORK_DEFN
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
  CMSInnerParMarkAndPushClosure(CMSCollector* collector,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
                                MemRegion span, CMSBitMap* bit_map,
3690
dba50b88bd50 6798898: CMS: bugs related to class unloading
jmasa
parents: 1605
diff changeset
   329
                                OopTaskQueue* work_queue);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   330
  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
   331
  virtual void do_oop(narrowOop* p);
35862
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
   332
  inline void do_oop_nv(oop* p);
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 35492
diff changeset
   333
  inline void do_oop_nv(narrowOop* p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
// A parallel (MT) version of the above, used when
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
// reference processing is parallel; the only difference
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
// is in the do_oop method.
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
   339
class CMSParKeepAliveClosure: public MetadataAwareOopClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   340
 private:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
  MemRegion     _span;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
  OopTaskQueue* _work_queue;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
  CMSBitMap*    _bit_map;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   344
  CMSInnerParMarkAndPushClosure
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   345
                _mark_and_push;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
  const uint    _low_water_mark;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
  void trim_queue(uint max);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   348
 protected:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   349
  DO_OOP_WORK_DEFN
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
  CMSParKeepAliveClosure(CMSCollector* collector, MemRegion span,
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   352
                         CMSBitMap* bit_map, OopTaskQueue* work_queue);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   353
  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
   354
  virtual void do_oop(narrowOop* p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   356
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 25356
diff changeset
   357
#endif // SHARE_VM_GC_CMS_CMSOOPCLOSURES_HPP