src/hotspot/share/oops/instanceClassLoaderKlass.hpp
author stefank
Sat, 26 May 2018 06:59:49 +0200
changeset 50752 9d62da00bf15
parent 49982 9042ffe5b7fe
child 52117 a2edf32cd813
permissions -rw-r--r--
8204540: Automatic oop closure devirtualization Reviewed-by: kbarrett, eosterlund
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
     1
/*
46415
7d5a286cdf89 8138737: Remove oop_ms_adjust_pointers and use oop_iterate instead
sjohanss
parents: 35877
diff changeset
     2
 * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
     4
 *
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
     7
 * published by the Free Software Foundation.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
     8
 *
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    13
 * accompanied this code).
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    14
 *
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    18
 *
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    21
 * questions.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    22
 *
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    23
 */
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    24
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    25
#ifndef SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    26
#define SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    27
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    28
#include "oops/instanceKlass.hpp"
15482
470d0b0c09f1 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 13738
diff changeset
    29
#include "utilities/macros.hpp"
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    30
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 33151
diff changeset
    31
class ClassFileParser;
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 33151
diff changeset
    32
13738
d67be49a5beb 7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents: 13728
diff changeset
    33
// An InstanceClassLoaderKlass is a specialization of the InstanceKlass. It does
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    34
// not add any field.  It is added to walk the dependencies for the class loader
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    35
// key that this class loader points to.  This is how the loader_data graph is
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    36
// walked and dependant class loaders are kept alive.  I thought we walked
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    37
// the list later?
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    38
13738
d67be49a5beb 7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents: 13728
diff changeset
    39
class InstanceClassLoaderKlass: public InstanceKlass {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    40
  friend class VMStructs;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    41
  friend class InstanceKlass;
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 49982
diff changeset
    42
public:
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 49982
diff changeset
    43
  static const KlassID ID = InstanceClassLoaderKlassID;
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 49982
diff changeset
    44
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 49982
diff changeset
    45
private:
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 49982
diff changeset
    46
  InstanceClassLoaderKlass(const ClassFileParser& parser) : InstanceKlass(parser, InstanceKlass::_misc_kind_class_loader, ID) {}
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    47
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    48
public:
13738
d67be49a5beb 7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents: 13728
diff changeset
    49
  InstanceClassLoaderKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    50
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    51
  // GC specific object visitors
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    52
  //
49982
9042ffe5b7fe 8200729: Conditional compilation of GCs
stefank
parents: 47216
diff changeset
    53
#if INCLUDE_PARALLELGC
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    54
  // Parallel Scavenge
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    55
  void oop_ps_push_contents(  oop obj, PSPromotionManager* pm);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    56
  // Parallel Compact
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    57
  void oop_pc_follow_contents(oop obj, ParCompactionManager* cm);
35877
a2a62511d0f8 8146987: Improve Parallel GC Full GC by caching results of live_words_in_range()
tschatzl
parents: 34666
diff changeset
    58
  void oop_pc_update_pointers(oop obj, ParCompactionManager* cm);
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    59
#endif
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    60
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    61
  // Oop fields (and metadata) iterators
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    62
  //
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    63
  // The InstanceClassLoaderKlass iterators also visit the CLD pointer (or mirror of anonymous klasses.)
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    64
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 49982
diff changeset
    65
 public:
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    66
  // Forward iteration
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    67
  // Iterate over the oop fields and metadata.
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 49982
diff changeset
    68
  template <typename T, class OopClosureType>
32606
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
    69
  inline void oop_oop_iterate(oop obj, OopClosureType* closure);
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    70
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    71
  // Reverse iteration
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    72
  // Iterate over the oop fields and metadata.
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 49982
diff changeset
    73
  template <typename T, class OopClosureType>
32606
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
    74
  inline void oop_oop_iterate_reverse(oop obj, OopClosureType* closure);
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    75
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    76
  // Bounded range iteration
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29688
diff changeset
    77
  // Iterate over the oop fields and metadata.
50752
9d62da00bf15 8204540: Automatic oop closure devirtualization
stefank
parents: 49982
diff changeset
    78
  template <typename T, class OopClosureType>
32606
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
    79
  inline void oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    80
};
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    81
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
diff changeset
    82
#endif // SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP