src/hotspot/share/gc/shared/genOopClosures.hpp
author tschatzl
Tue, 29 May 2018 09:26:00 +0200
changeset 50605 7f63c74f0974
parent 49982 9042ffe5b7fe
child 50621 4216de02077e
permissions -rw-r--r--
8202845: Refactor reference processing for improved parallelism Summary: Fold reference processing's nine phases into four to decrease startup and termination time of this phase. Reviewed-by: kbarrett, sjohanss
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
49827
a4672513d6e3 8201646: Introduce ReferenceDiscoverer interface
pliden
parents: 49455
diff changeset
     2
 * Copyright (c) 2001, 2018, 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: 5076
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5076
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: 5076
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: 29084
diff changeset
    25
#ifndef SHARE_VM_GC_SHARED_GENOOPCLOSURES_HPP
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29084
diff changeset
    26
#define SHARE_VM_GC_SHARED_GENOOPCLOSURES_HPP
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "memory/iterator.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "oops/oop.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    30
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
class Generation;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
class HeapWord;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
class CardTableRS;
49455
848864ed9b17 8199604: Rename CardTableModRefBS to CardTableBarrierSet
eosterlund
parents: 47580
diff changeset
    34
class CardTableBarrierSet;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
class DefNewGeneration;
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
    36
class KlassRemSet;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
// Closure for iterating roots from a particular generation
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
// Note: all classes deriving from this MUST call this do_barrier
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
// method at the end of their own do_oop method!
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
// Note: no do_oop defined, this is an abstract class.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
    43
class OopsInGenClosure : public ExtendedOopClosure {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
 private:
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    45
  Generation*  _orig_gen;     // generation originally set in ctor
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    46
  Generation*  _gen;          // generation being scanned
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
 protected:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  // Some subtypes need access.
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    50
  HeapWord*    _gen_boundary; // start of generation
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    51
  CardTableRS* _rs;           // remembered set
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  // For assertions
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  Generation* generation() { return _gen; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  CardTableRS* rs() { return _rs; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  // Derived classes that modify oops so that they might be old-to-young
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  // pointers must call the method below.
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    59
  template <class T> void do_barrier(T* p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
    61
  // Version for use by closures that may be called in parallel code.
3262
30d1c247fc25 6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents: 1388
diff changeset
    62
  template <class T> void par_do_barrier(T* p);
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
    63
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
 public:
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
    65
  OopsInGenClosure() : ExtendedOopClosure(NULL),
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
    _orig_gen(NULL), _gen(NULL), _gen_boundary(NULL), _rs(NULL) {};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  OopsInGenClosure(Generation* gen);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  void set_generation(Generation* gen);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  void reset_generation() { _gen = _orig_gen; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  // Problem with static closures: must have _gen_boundary set at some point,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  // but cannot do this until after the heap is initialized.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  void set_orig_generation(Generation* gen) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
    _orig_gen = gen;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
    set_generation(gen);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
  HeapWord* gen_boundary() { return _gen_boundary; }
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
    81
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
    82
};
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
    83
47580
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
    84
// Super class for scan closures. It contains code to dirty scanned class loader data.
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
    85
class OopsInClassLoaderDataOrGenClosure: public OopsInGenClosure {
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
    86
  ClassLoaderData* _scanned_cld;
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
    87
 public:
47580
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
    88
  OopsInClassLoaderDataOrGenClosure(Generation* g) : OopsInGenClosure(g), _scanned_cld(NULL) {}
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
    89
  void set_scanned_cld(ClassLoaderData* cld) {
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
    90
    assert(cld == NULL || _scanned_cld == NULL, "Must be");
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
    91
    _scanned_cld = cld;
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
    92
  }
47580
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
    93
  bool is_scanning_a_cld() { return _scanned_cld != NULL; }
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
    94
  void do_cld_barrier();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
49982
9042ffe5b7fe 8200729: Conditional compilation of GCs
stefank
parents: 49827
diff changeset
    97
#if INCLUDE_SERIALGC
47580
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
    98
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
// Closure for scanning DefNewGeneration.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
// This closure will perform barrier store calls for ALL
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
// pointers in scanned oops.
47580
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
   103
class ScanClosure: public OopsInClassLoaderDataOrGenClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   104
 protected:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  DefNewGeneration* _g;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   106
  HeapWord*         _boundary;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   107
  bool              _gc_barrier;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   108
  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
   109
 public:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  ScanClosure(DefNewGeneration* g, bool gc_barrier);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   111
  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
   112
  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
   113
  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
   114
  inline void do_oop_nv(narrowOop* p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
// Closure for scanning DefNewGeneration.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
// This closure only performs barrier store calls on
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
// pointers into the DefNewGeneration. This is less
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
// precise, but faster, than a ScanClosure
47580
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
   122
class FastScanClosure: public OopsInClassLoaderDataOrGenClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   123
 protected:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  DefNewGeneration* _g;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   125
  HeapWord*         _boundary;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   126
  bool              _gc_barrier;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   127
  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
   128
 public:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  FastScanClosure(DefNewGeneration* g, bool gc_barrier);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   130
  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
   131
  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
   132
  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
   133
  inline void do_oop_nv(narrowOop* p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
49982
9042ffe5b7fe 8200729: Conditional compilation of GCs
stefank
parents: 49827
diff changeset
   136
#endif // INCLUDE_SERIALGC
9042ffe5b7fe 8200729: Conditional compilation of GCs
stefank
parents: 49827
diff changeset
   137
47580
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
   138
class CLDScanClosure: public CLDClosure {
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
   139
  OopsInClassLoaderDataOrGenClosure*   _scavenge_closure;
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   140
  // true if the the modified oops state should be saved.
47580
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
   141
  bool                                 _accumulate_modified_oops;
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   142
 public:
47580
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
   143
  CLDScanClosure(OopsInClassLoaderDataOrGenClosure* scavenge_closure,
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
   144
                 bool accumulate_modified_oops) :
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
   145
       _scavenge_closure(scavenge_closure), _accumulate_modified_oops(accumulate_modified_oops) {}
96392e113a0a 8186777: Make Klass::_java_mirror an OopHandle
coleenp
parents: 47216
diff changeset
   146
  void do_cld(ClassLoaderData* cld);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   147
};
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   148
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   149
class FilteringClosure: public ExtendedOopClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   150
 private:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   151
  HeapWord*   _boundary;
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   152
  ExtendedOopClosure* _cl;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   153
 protected:
35862
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 33226
diff changeset
   154
  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
   155
 public:
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   156
  FilteringClosure(HeapWord* boundary, ExtendedOopClosure* cl) :
49827
a4672513d6e3 8201646: Introduce ReferenceDiscoverer interface
pliden
parents: 49455
diff changeset
   157
    ExtendedOopClosure(cl->ref_discoverer()), _boundary(boundary),
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
    _cl(cl) {}
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   159
  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
   160
  virtual void do_oop(narrowOop* p);
35862
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 33226
diff changeset
   161
  inline void do_oop_nv(oop* p);
411842d0c882 8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents: 33226
diff changeset
   162
  inline void do_oop_nv(narrowOop* p);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   163
  virtual bool do_metadata()          { return do_metadata_nv(); }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   164
  inline bool do_metadata_nv()        { assert(!_cl->do_metadata(), "assumption broken, must change to 'return _cl->do_metadata()'"); return false; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
49982
9042ffe5b7fe 8200729: Conditional compilation of GCs
stefank
parents: 49827
diff changeset
   167
#if INCLUDE_SERIALGC
9042ffe5b7fe 8200729: Conditional compilation of GCs
stefank
parents: 49827
diff changeset
   168
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
// Closure for scanning DefNewGeneration's weak references.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
// NOTE: very much like ScanClosure but not derived from
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
//  OopsInGenClosure -- weak references are processed all
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
//  at once, with no notion of which generation they were in.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
class ScanWeakRefClosure: public OopClosure {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   174
 protected:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   175
  DefNewGeneration* _g;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   176
  HeapWord*         _boundary;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   177
  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
   178
 public:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
  ScanWeakRefClosure(DefNewGeneration* g);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   180
  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
   181
  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
   182
  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
   183
  inline void do_oop_nv(narrowOop* p);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
49982
9042ffe5b7fe 8200729: Conditional compilation of GCs
stefank
parents: 49827
diff changeset
   186
#endif // INCLUDE_SERIALGC
9042ffe5b7fe 8200729: Conditional compilation of GCs
stefank
parents: 49827
diff changeset
   187
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29084
diff changeset
   188
#endif // SHARE_VM_GC_SHARED_GENOOPCLOSURES_HPP