src/hotspot/share/memory/iterator.hpp
author coleenp
Thu, 10 Jan 2019 15:13:51 -0500
changeset 53244 9807daeb47c4
parent 52141 de6dc206a92b
child 53889 6a84ea153af0
permissions -rw-r--r--
8216167: Update include guards to reflect correct directories Summary: Use script and some manual fixup to fix directores names in include guards. Reviewed-by: lfoltan, eosterlund, kbarrett
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52141
diff changeset
     2
 * Copyright (c) 1997, 2019, 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: 4738
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4738
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: 4738
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
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52141
diff changeset
    25
#ifndef SHARE_MEMORY_ITERATOR_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52141
diff changeset
    26
#define SHARE_MEMORY_ITERATOR_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/allocation.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "memory/memRegion.hpp"
37466
287c4ebd11b0 8153967: Remove top.hpp
stefank
parents: 37106
diff changeset
    30
#include "oops/oopsHierarchy.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
3908
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1388
diff changeset
    32
class CodeBlob;
3913
e049e6b81e11 6885169: merge of 4957990 and 6863023 causes conflict on do_nmethods
jrose
parents: 3912
diff changeset
    33
class nmethod;
49827
a4672513d6e3 8201646: Introduce ReferenceDiscoverer interface
pliden
parents: 49329
diff changeset
    34
class ReferenceDiscoverer;
3696
9e5d9b5e1049 4957990: Perm heap bloat in JVM
ysr
parents: 3690
diff changeset
    35
class DataLayout;
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
    36
class KlassClosure;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
    37
class ClassLoaderData;
37466
287c4ebd11b0 8153967: Remove top.hpp
stefank
parents: 37106
diff changeset
    38
class Symbol;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
23538
2518569e1e01 8038628: Remove unused Closure::abort()
stefank
parents: 23535
diff changeset
    40
// The following classes are C++ `closures` for iterating over objects, roots and spaces
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
    41
23538
2518569e1e01 8038628: Remove unused Closure::abort()
stefank
parents: 23535
diff changeset
    42
class Closure : public StackObj { };
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
    43
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
    44
// OopClosure is used for iterating through references to Java objects.
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
    45
class OopClosure : public Closure {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  virtual void do_oop(oop* o) = 0;
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    48
  virtual void do_oop(narrowOop* o) = 0;
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
    49
};
3690
dba50b88bd50 6798898: CMS: bugs related to class unloading
jmasa
parents: 1388
diff changeset
    50
47676
b1c020fc35a3 8189748: More precise closures for WeakProcessor::weak_oops_do calls
stefank
parents: 47580
diff changeset
    51
class DoNothingClosure : public OopClosure {
b1c020fc35a3 8189748: More precise closures for WeakProcessor::weak_oops_do calls
stefank
parents: 47580
diff changeset
    52
 public:
b1c020fc35a3 8189748: More precise closures for WeakProcessor::weak_oops_do calls
stefank
parents: 47580
diff changeset
    53
  virtual void do_oop(oop* p)       {}
b1c020fc35a3 8189748: More precise closures for WeakProcessor::weak_oops_do calls
stefank
parents: 47580
diff changeset
    54
  virtual void do_oop(narrowOop* p) {}
b1c020fc35a3 8189748: More precise closures for WeakProcessor::weak_oops_do calls
stefank
parents: 47580
diff changeset
    55
};
b1c020fc35a3 8189748: More precise closures for WeakProcessor::weak_oops_do calls
stefank
parents: 47580
diff changeset
    56
extern DoNothingClosure do_nothing_cl;
b1c020fc35a3 8189748: More precise closures for WeakProcessor::weak_oops_do calls
stefank
parents: 47580
diff changeset
    57
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
    58
// OopIterateClosure adds extra code to be run during oop iterations.
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
    59
// This is needed by the GC and is extracted to a separate type to not
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
    60
// pollute the OopClosure interface.
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
    61
class OopIterateClosure : public OopClosure {
33226
19cb9b844190 8139341: Hide ExtendedOopClosure::_ref_processor
kbarrett
parents: 32606
diff changeset
    62
 private:
49827
a4672513d6e3 8201646: Introduce ReferenceDiscoverer interface
pliden
parents: 49329
diff changeset
    63
  ReferenceDiscoverer* _ref_discoverer;
33226
19cb9b844190 8139341: Hide ExtendedOopClosure::_ref_processor
kbarrett
parents: 32606
diff changeset
    64
19cb9b844190 8139341: Hide ExtendedOopClosure::_ref_processor
kbarrett
parents: 32606
diff changeset
    65
 protected:
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
    66
  OopIterateClosure(ReferenceDiscoverer* rd) : _ref_discoverer(rd) { }
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
    67
  OopIterateClosure() : _ref_discoverer(NULL) { }
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
    68
  ~OopIterateClosure() { }
33226
19cb9b844190 8139341: Hide ExtendedOopClosure::_ref_processor
kbarrett
parents: 32606
diff changeset
    69
49827
a4672513d6e3 8201646: Introduce ReferenceDiscoverer interface
pliden
parents: 49329
diff changeset
    70
  void set_ref_discoverer_internal(ReferenceDiscoverer* rd) { _ref_discoverer = rd; }
33226
19cb9b844190 8139341: Hide ExtendedOopClosure::_ref_processor
kbarrett
parents: 32606
diff changeset
    71
19cb9b844190 8139341: Hide ExtendedOopClosure::_ref_processor
kbarrett
parents: 32606
diff changeset
    72
 public:
49827
a4672513d6e3 8201646: Introduce ReferenceDiscoverer interface
pliden
parents: 49329
diff changeset
    73
  ReferenceDiscoverer* ref_discoverer() const { return _ref_discoverer; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
46415
7d5a286cdf89 8138737: Remove oop_ms_adjust_pointers and use oop_iterate instead
sjohanss
parents: 37995
diff changeset
    75
  // Iteration of InstanceRefKlasses differ depending on the closure,
7d5a286cdf89 8138737: Remove oop_ms_adjust_pointers and use oop_iterate instead
sjohanss
parents: 37995
diff changeset
    76
  // the below enum describes the different alternatives.
7d5a286cdf89 8138737: Remove oop_ms_adjust_pointers and use oop_iterate instead
sjohanss
parents: 37995
diff changeset
    77
  enum ReferenceIterationMode {
46445
825b002e05ae 8138888: Remove ExtendedOopClosure::apply_to_weak_ref_discovered_field
sjohanss
parents: 46415
diff changeset
    78
    DO_DISCOVERY,                // Apply closure and discover references
825b002e05ae 8138888: Remove ExtendedOopClosure::apply_to_weak_ref_discovered_field
sjohanss
parents: 46415
diff changeset
    79
    DO_DISCOVERED_AND_DISCOVERY, // Apply closure to discovered field and do discovery
50870
830b05ca7f58 8205923: ZGC: Verification applies load barrier before verification
stefank
parents: 50801
diff changeset
    80
    DO_FIELDS,                   // Apply closure to all fields
830b05ca7f58 8205923: ZGC: Verification applies load barrier before verification
stefank
parents: 50801
diff changeset
    81
    DO_FIELDS_EXCEPT_REFERENT    // Apply closure to all fields except the referent field
46415
7d5a286cdf89 8138737: Remove oop_ms_adjust_pointers and use oop_iterate instead
sjohanss
parents: 37995
diff changeset
    82
  };
7d5a286cdf89 8138737: Remove oop_ms_adjust_pointers and use oop_iterate instead
sjohanss
parents: 37995
diff changeset
    83
7d5a286cdf89 8138737: Remove oop_ms_adjust_pointers and use oop_iterate instead
sjohanss
parents: 37995
diff changeset
    84
  // The default iteration mode is to do discovery.
7d5a286cdf89 8138737: Remove oop_ms_adjust_pointers and use oop_iterate instead
sjohanss
parents: 37995
diff changeset
    85
  virtual ReferenceIterationMode reference_iteration_mode() { return DO_DISCOVERY; }
7d5a286cdf89 8138737: Remove oop_ms_adjust_pointers and use oop_iterate instead
sjohanss
parents: 37995
diff changeset
    86
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
    87
  // If the do_metadata functions return "true",
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
    88
  // we invoke the following when running oop_iterate():
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
    89
  //
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
    90
  // 1) do_klass on the header klass pointer.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
    91
  // 2) do_klass on the klass pointer in the mirrors.
32606
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
    92
  // 3) do_cld   on the class loader data in class loaders.
3696
9e5d9b5e1049 4957990: Perm heap bloat in JVM
ysr
parents: 3690
diff changeset
    93
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
    94
  virtual bool do_metadata() = 0;
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
    95
  virtual void do_klass(Klass* k) = 0;
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
    96
  virtual void do_cld(ClassLoaderData* cld) = 0;
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
    97
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 25492
diff changeset
    98
#ifdef ASSERT
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 25492
diff changeset
    99
  // Default verification of each visited oop field.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 25492
diff changeset
   100
  template <typename T> void verify(T* p);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 25492
diff changeset
   101
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 25492
diff changeset
   102
  // Can be used by subclasses to turn off the default verification of oop fields.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 25492
diff changeset
   103
  virtual bool should_verify_oops() { return true; }
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 25492
diff changeset
   104
#endif
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
   105
};
3690
dba50b88bd50 6798898: CMS: bugs related to class unloading
jmasa
parents: 1388
diff changeset
   106
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   107
// An OopIterateClosure that can be used when there's no need to visit the Metadata.
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   108
class BasicOopIterateClosure : public OopIterateClosure {
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   109
public:
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   110
  BasicOopIterateClosure(ReferenceDiscoverer* rd = NULL) : OopIterateClosure(rd) {}
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   111
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   112
  virtual bool do_metadata() { return false; }
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   113
  virtual void do_klass(Klass* k) { ShouldNotReachHere(); }
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   114
  virtual void do_cld(ClassLoaderData* cld) { ShouldNotReachHere(); }
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   115
};
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   116
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
   117
class KlassClosure : public Closure {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
   118
 public:
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
   119
  virtual void do_klass(Klass* k) = 0;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
22899
e2a6bf7f343a 8035393: Use CLDClosure instead of CLDToOopClosure in frame::oops_interpreted_do
stefank
parents: 22234
diff changeset
   122
class CLDClosure : public Closure {
e2a6bf7f343a 8035393: Use CLDClosure instead of CLDToOopClosure in frame::oops_interpreted_do
stefank
parents: 22234
diff changeset
   123
 public:
e2a6bf7f343a 8035393: Use CLDClosure instead of CLDToOopClosure in frame::oops_interpreted_do
stefank
parents: 22234
diff changeset
   124
  virtual void do_cld(ClassLoaderData* cld) = 0;
e2a6bf7f343a 8035393: Use CLDClosure instead of CLDToOopClosure in frame::oops_interpreted_do
stefank
parents: 22234
diff changeset
   125
};
e2a6bf7f343a 8035393: Use CLDClosure instead of CLDToOopClosure in frame::oops_interpreted_do
stefank
parents: 22234
diff changeset
   126
13741
e4395deb8597 7197350: NPG: jvmtiHeapReferenceCallback receives incorrect reference_kind for system class roots
stefank
parents: 13728
diff changeset
   127
22899
e2a6bf7f343a 8035393: Use CLDClosure instead of CLDToOopClosure in frame::oops_interpreted_do
stefank
parents: 22234
diff changeset
   128
class CLDToOopClosure : public CLDClosure {
25492
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   129
  OopClosure*       _oop_closure;
52141
de6dc206a92b 8210330: Make CLD claiming allow multiple claim bits
eosterlund
parents: 50870
diff changeset
   130
  int               _cld_claim;
14582
490bb6c0df7c 8003720: NPG: Method in interpreter stack frame can be deallocated
stefank
parents: 13741
diff changeset
   131
490bb6c0df7c 8003720: NPG: Method in interpreter stack frame can be deallocated
stefank
parents: 13741
diff changeset
   132
 public:
52141
de6dc206a92b 8210330: Make CLD claiming allow multiple claim bits
eosterlund
parents: 50870
diff changeset
   133
  CLDToOopClosure(OopClosure* oop_closure,
de6dc206a92b 8210330: Make CLD claiming allow multiple claim bits
eosterlund
parents: 50870
diff changeset
   134
                  int cld_claim) :
14582
490bb6c0df7c 8003720: NPG: Method in interpreter stack frame can be deallocated
stefank
parents: 13741
diff changeset
   135
      _oop_closure(oop_closure),
52141
de6dc206a92b 8210330: Make CLD claiming allow multiple claim bits
eosterlund
parents: 50870
diff changeset
   136
      _cld_claim(cld_claim) {}
14582
490bb6c0df7c 8003720: NPG: Method in interpreter stack frame can be deallocated
stefank
parents: 13741
diff changeset
   137
490bb6c0df7c 8003720: NPG: Method in interpreter stack frame can be deallocated
stefank
parents: 13741
diff changeset
   138
  void do_cld(ClassLoaderData* cld);
490bb6c0df7c 8003720: NPG: Method in interpreter stack frame can be deallocated
stefank
parents: 13741
diff changeset
   139
};
490bb6c0df7c 8003720: NPG: Method in interpreter stack frame can be deallocated
stefank
parents: 13741
diff changeset
   140
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
   141
// The base class for all concurrent marking closures,
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
   142
// that participates in class unloading.
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
   143
// It's used to proxy through the metadata to the oops defined in them.
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   144
class MetadataVisitingOopIterateClosure: public OopIterateClosure {
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
   145
 public:
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   146
  MetadataVisitingOopIterateClosure(ReferenceDiscoverer* rd = NULL) : OopIterateClosure(rd) { }
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
   147
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   148
  virtual bool do_metadata() { return true; }
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   149
  virtual void do_klass(Klass* k);
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   150
  virtual void do_cld(ClassLoaderData* cld);
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
   151
};
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
   152
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
// ObjectClosure is used for iterating through an object space
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 360
diff changeset
   155
class ObjectClosure : public Closure {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  // Called for each object.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  virtual void do_object(oop obj) = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
17625
3e91c67ddece 8014277: Remove ObjectClosure as base class for BoolObjectClosure
ehelin
parents: 14582
diff changeset
   162
class BoolObjectClosure : public Closure {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  virtual bool do_object_b(oop obj) = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
37106
0856b64af754 8151539: Remove duplicate AlwaysTrueClosures
stefank
parents: 36591
diff changeset
   167
class AlwaysTrueClosure: public BoolObjectClosure {
0856b64af754 8151539: Remove duplicate AlwaysTrueClosures
stefank
parents: 36591
diff changeset
   168
 public:
0856b64af754 8151539: Remove duplicate AlwaysTrueClosures
stefank
parents: 36591
diff changeset
   169
  bool do_object_b(oop p) { return true; }
0856b64af754 8151539: Remove duplicate AlwaysTrueClosures
stefank
parents: 36591
diff changeset
   170
};
0856b64af754 8151539: Remove duplicate AlwaysTrueClosures
stefank
parents: 36591
diff changeset
   171
0856b64af754 8151539: Remove duplicate AlwaysTrueClosures
stefank
parents: 36591
diff changeset
   172
class AlwaysFalseClosure : public BoolObjectClosure {
0856b64af754 8151539: Remove duplicate AlwaysTrueClosures
stefank
parents: 36591
diff changeset
   173
 public:
0856b64af754 8151539: Remove duplicate AlwaysTrueClosures
stefank
parents: 36591
diff changeset
   174
  bool do_object_b(oop p) { return false; }
0856b64af754 8151539: Remove duplicate AlwaysTrueClosures
stefank
parents: 36591
diff changeset
   175
};
0856b64af754 8151539: Remove duplicate AlwaysTrueClosures
stefank
parents: 36591
diff changeset
   176
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
// Applies an oop closure to all ref fields in objects iterated over in an
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
// object iteration.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
class ObjectToOopClosure: public ObjectClosure {
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   180
  OopIterateClosure* _cl;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  void do_object(oop obj);
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   183
  ObjectToOopClosure(OopIterateClosure* cl) : _cl(cl) {}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
// A version of ObjectClosure that is expected to be robust
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
// in the face of possibly uninitialized objects.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
class ObjectClosureCareful : public ObjectClosure {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
  virtual size_t do_object_careful_m(oop p, MemRegion mr) = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  virtual size_t do_object_careful(oop p) = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
// The following are used in CompactibleFreeListSpace and
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
// ConcurrentMarkSweepGeneration.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
// Blk closure (abstract class)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
class BlkClosure : public StackObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
  virtual size_t do_blk(HeapWord* addr) = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
// A version of BlkClosure that is expected to be robust
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
// in the face of possibly uninitialized objects.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
class BlkClosureCareful : public BlkClosure {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  size_t do_blk(HeapWord* addr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
    guarantee(false, "call do_blk_careful instead");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
    return 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
  virtual size_t do_blk_careful(HeapWord* addr) = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
// SpaceClosure is used for iterating over spaces
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
class Space;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
class CompactibleSpace;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
class SpaceClosure : public StackObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
  // Called for each space
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
  virtual void do_space(Space* s) = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
class CompactibleSpaceClosure : public StackObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
  // Called for each compactible space
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
  virtual void do_space(CompactibleSpace* s) = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
3908
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1388
diff changeset
   232
// CodeBlobClosure is used for iterating through code blobs
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1388
diff changeset
   233
// in the code cache or on thread stacks
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1388
diff changeset
   234
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1388
diff changeset
   235
class CodeBlobClosure : public Closure {
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1388
diff changeset
   236
 public:
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1388
diff changeset
   237
  // Called for each code blob.
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1388
diff changeset
   238
  virtual void do_code_blob(CodeBlob* cb) = 0;
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1388
diff changeset
   239
};
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1388
diff changeset
   240
25492
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   241
// Applies an oop closure to all ref fields in code blobs
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   242
// iterated over in an object iteration.
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   243
class CodeBlobToOopClosure : public CodeBlobClosure {
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   244
  OopClosure* _cl;
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   245
  bool _fix_relocations;
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   246
 protected:
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   247
  void do_nmethod(nmethod* nm);
3908
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1388
diff changeset
   248
 public:
36591
d0622cab5983 8150013: ParNew: Prune nmethods scavengable list.
cvarming
parents: 33226
diff changeset
   249
  // If fix_relocations(), then cl must copy objects to their new location immediately to avoid
d0622cab5983 8150013: ParNew: Prune nmethods scavengable list.
cvarming
parents: 33226
diff changeset
   250
  // patching nmethods with the old locations.
25492
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   251
  CodeBlobToOopClosure(OopClosure* cl, bool fix_relocations) : _cl(cl), _fix_relocations(fix_relocations) {}
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   252
  virtual void do_code_blob(CodeBlob* cb);
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   253
36591
d0622cab5983 8150013: ParNew: Prune nmethods scavengable list.
cvarming
parents: 33226
diff changeset
   254
  bool fix_relocations() const { return _fix_relocations; }
25492
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   255
  const static bool FixRelocations = true;
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   256
};
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   257
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   258
class MarkingCodeBlobClosure : public CodeBlobToOopClosure {
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   259
 public:
d27050bdfb04 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 25491
diff changeset
   260
  MarkingCodeBlobClosure(OopClosure* cl, bool fix_relocations) : CodeBlobToOopClosure(cl, fix_relocations) {}
3908
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1388
diff changeset
   261
  // Called for each code blob, but at most once per unique blob.
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1388
diff changeset
   262
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1388
diff changeset
   263
  virtual void do_code_blob(CodeBlob* cb);
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1388
diff changeset
   264
};
24b55ad4c228 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 1388
diff changeset
   265
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
// MonitorClosure is used for iterating over monitors in the monitors cache
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
class ObjectMonitor;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
class MonitorClosure : public StackObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
  // called for each monitor in cache
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
  virtual void do_monitor(ObjectMonitor* m) = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
// A closure that is applied without any arguments.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
class VoidClosure : public StackObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
  // I would have liked to declare this a pure virtual, but that breaks
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
  // in mysterious ways, for unknown reasons.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
  virtual void do_void();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
// YieldClosure is intended for use by iteration loops
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
// to incrementalize their work, allowing interleaving
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
// of an interruptable task so as to allow other
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
// threads to run (which may not otherwise be able to access
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
// exclusive resources, for instance). Additionally, the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
// closure also allows for aborting an ongoing iteration
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
// by means of checking the return value from the polling
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
// call.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
class YieldClosure : public StackObj {
50097
ed8a43d83fcc 8201491: G1 support for java.lang.ref.Reference precleaning
tschatzl
parents: 49827
diff changeset
   294
public:
ed8a43d83fcc 8201491: G1 support for java.lang.ref.Reference precleaning
tschatzl
parents: 49827
diff changeset
   295
 virtual bool should_return() = 0;
ed8a43d83fcc 8201491: G1 support for java.lang.ref.Reference precleaning
tschatzl
parents: 49827
diff changeset
   296
ed8a43d83fcc 8201491: G1 support for java.lang.ref.Reference precleaning
tschatzl
parents: 49827
diff changeset
   297
 // Yield on a fine-grain level. The check in case of not yielding should be very fast.
ed8a43d83fcc 8201491: G1 support for java.lang.ref.Reference precleaning
tschatzl
parents: 49827
diff changeset
   298
 virtual bool should_return_fine_grain() { return false; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
// Abstract closure for serializing data (read or write).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 8921
diff changeset
   303
class SerializeClosure : public Closure {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
  // Return bool indicating whether closure implements read or write.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
  virtual bool reading() const = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
  // Read/write the void pointer pointed to by p.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
  virtual void do_ptr(void** p) = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
37995
92aec042a43b 8150607: Clean up CompactHashtable
iklam
parents: 37466
diff changeset
   311
  // Read/write the 32-bit unsigned integer pointed to by p.
92aec042a43b 8150607: Clean up CompactHashtable
iklam
parents: 37466
diff changeset
   312
  virtual void do_u4(u4* p) = 0;
92aec042a43b 8150607: Clean up CompactHashtable
iklam
parents: 37466
diff changeset
   313
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
  // Read/write the region specified.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
  virtual void do_region(u_char* start, size_t size) = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
  // Check/write the tag.  If reading, then compare the tag against
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
  // the passed in value and fail is they don't match.  This allows
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
  // for verification that sections of the serialized data are of the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
  // correct length.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
  virtual void do_tag(int tag) = 0;
37995
92aec042a43b 8150607: Clean up CompactHashtable
iklam
parents: 37466
diff changeset
   322
49329
04ed29f9ef33 8194759: Support caching class mirror objects.
jiangli
parents: 47676
diff changeset
   323
  // Read/write the oop
04ed29f9ef33 8194759: Support caching class mirror objects.
jiangli
parents: 47676
diff changeset
   324
  virtual void do_oop(oop* o) = 0;
04ed29f9ef33 8194759: Support caching class mirror objects.
jiangli
parents: 47676
diff changeset
   325
37995
92aec042a43b 8150607: Clean up CompactHashtable
iklam
parents: 37466
diff changeset
   326
  bool writing() {
92aec042a43b 8150607: Clean up CompactHashtable
iklam
parents: 37466
diff changeset
   327
    return !reading();
92aec042a43b 8150607: Clean up CompactHashtable
iklam
parents: 37466
diff changeset
   328
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
};
3690
dba50b88bd50 6798898: CMS: bugs related to class unloading
jmasa
parents: 1388
diff changeset
   330
8076
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   331
class SymbolClosure : public StackObj {
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   332
 public:
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   333
  virtual void do_symbol(Symbol**) = 0;
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   334
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   335
  // Clear LSB in symbol address; it can be set by CPSlot.
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   336
  static Symbol* load_symbol(Symbol** p) {
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   337
    return (Symbol*)(intptr_t(*p) & ~1);
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   338
  }
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   339
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   340
  // Store symbol, adjusting new pointer if the original pointer was adjusted
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   341
  // (symbol references in constant pool slots have their LSB set to 1).
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   342
  static void store_symbol(Symbol** p, Symbol* sym) {
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   343
    *p = (Symbol*)(intptr_t(sym) | (intptr_t(*p) & 1));
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   344
  }
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   345
};
96d498ec7ae1 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 7397
diff changeset
   346
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   347
// Dispatches to the non-virtual functions if OopClosureType has
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   348
// a concrete implementation, otherwise a virtual call is taken.
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   349
class Devirtualizer {
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 25492
diff changeset
   350
 public:
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   351
  template <typename OopClosureType, typename T> static void do_oop_no_verify(OopClosureType* closure, T* p);
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   352
  template <typename OopClosureType, typename T> static void do_oop(OopClosureType* closure, T* p);
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   353
  template <typename OopClosureType>             static void do_klass(OopClosureType* closure, Klass* k);
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   354
  template <typename OopClosureType>             static void do_cld(OopClosureType* closure, ClassLoaderData* cld);
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   355
  template <typename OopClosureType>             static bool do_metadata(OopClosureType* closure);
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 25492
diff changeset
   356
};
25356
4a4a482298a6 8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents: 23539
diff changeset
   357
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   358
class OopIteratorClosureDispatch {
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 25492
diff changeset
   359
 public:
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   360
  template <typename OopClosureType> static void oop_oop_iterate(OopClosureType* cl, oop obj, Klass* klass);
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   361
  template <typename OopClosureType> static void oop_oop_iterate(OopClosureType* cl, oop obj, Klass* klass, MemRegion mr);
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 50097
diff changeset
   362
  template <typename OopClosureType> static void oop_oop_iterate_backwards(OopClosureType* cl, oop obj, Klass* klass);
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 25492
diff changeset
   363
};
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 25492
diff changeset
   364
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52141
diff changeset
   365
#endif // SHARE_MEMORY_ITERATOR_HPP