src/hotspot/share/oops/arrayKlass.hpp
author dholmes
Sat, 23 Jun 2018 01:32:41 -0400
changeset 50735 2f2af62dfac7
parent 49982 9042ffe5b7fe
child 50752 9d62da00bf15
permissions -rw-r--r--
8010319: Implementation of JEP 181: Nest-Based Access Control Reviewed-by: alanb, psandoz, mchung, coleenp, acorn, mcimadamore, forax, jlahoda, sspitsyn, abuckley Contributed-by: alex.buckley@oracle.com, maurizio.mimadamore@oracle.com, mandy.chung@oracle.com, tobias.hartmann@oracle.com, david.holmes@oracle.com, vladimir.x.ivanov@oracle.com, karen.kinnear@oracle.com, vladimir.kozlov@oracle.com, john.r.rose@oracle.com, daniel.smith@oracle.com, serguei.spitsyn@oracle.com, kumardotsrinivasan@gmail.com, boris.ulasevich@bell-sw.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
50735
2f2af62dfac7 8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents: 49982
diff changeset
     2
 * Copyright (c) 1997, 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: 4571
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4571
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: 4571
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    25
#ifndef SHARE_VM_OOPS_ARRAYKLASS_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    26
#define SHARE_VM_OOPS_ARRAYKLASS_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    28
#include "memory/universe.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    29
#include "oops/klass.hpp"
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
    30
27020
a7c8010446c2 8036805: Correct linker method lookup.
lfoltan
parents: 26412
diff changeset
    31
class fieldDescriptor;
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
    32
class klassVtable;
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
    33
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    34
// ArrayKlass is the abstract baseclass for all array classes
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    36
class ArrayKlass: public Klass {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
  friend class VMStructs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
 private:
46746
ea379ebb9447 8072061: Automatically determine optimal sizes for the CDS regions
iklam
parents: 46329
diff changeset
    39
  // If you add a new field that points to any metaspace object, you
ea379ebb9447 8072061: Automatically determine optimal sizes for the CDS regions
iklam
parents: 46329
diff changeset
    40
  // must add this field to ArrayKlass::metaspace_pointers_do().
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
  int      _dimension;         // This is n'th-dimensional array.
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
    42
  Klass* volatile _higher_dimension;  // Refers the (n+1)'th-dimensional array (if present).
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
    43
  Klass* volatile _lower_dimension;   // Refers the (n-1)'th-dimensional array (if present).
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
    45
 protected:
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
    46
  // Constructors
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
    47
  // The constructor with the Symbol argument does the real array
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
    48
  // initialization, the other is a dummy
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    49
  ArrayKlass(Symbol* name);
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    50
  ArrayKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for cds"); }
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
    51
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  // Testing operation
33611
9abd65805e19 8139203: Consistent naming for klass type predicates
coleenp
parents: 32606
diff changeset
    54
  DEBUG_ONLY(bool is_array_klass_slow() const { return true; })
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  // Instance variables
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  int dimension() const                 { return _dimension;      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  void set_dimension(int dimension)     { _dimension = dimension; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
    60
  Klass* higher_dimension() const     { return _higher_dimension; }
40887
8d35e19f5548 8158854: Ensure release_store is paired with load_acquire in lock-free code
dholmes
parents: 36508
diff changeset
    61
  inline Klass* higher_dimension_acquire() const; // load with acquire semantics
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
    62
  void set_higher_dimension(Klass* k) { _higher_dimension = k; }
40887
8d35e19f5548 8158854: Ensure release_store is paired with load_acquire in lock-free code
dholmes
parents: 36508
diff changeset
    63
  inline void release_set_higher_dimension(Klass* k); // store with release semantics
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
    64
  Klass** adr_higher_dimension()      { return (Klass**)&this->_higher_dimension;}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
    66
  Klass* lower_dimension() const      { return _lower_dimension; }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
    67
  void set_lower_dimension(Klass* k)  { _lower_dimension = k; }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
    68
  Klass** adr_lower_dimension()       { return (Klass**)&this->_lower_dimension;}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  // offset of first element, including any padding for the sake of alignment
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  int  array_header_in_bytes() const    { return layout_helper_header_size(layout_helper()); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  int  log2_element_size() const        { return layout_helper_log2_element_size(layout_helper()); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  // type of elements (T_OBJECT for both oop arrays and array-arrays)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  BasicType element_type() const        { return layout_helper_element_type(layout_helper()); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
    76
  virtual Klass* java_super() const;//{ return SystemDictionary::Object_klass(); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  // Allocation
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  // Sizes points to the first dimension of the array, subsequent dimensions
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
  // are always in higher memory.  The callers of these set that up.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  virtual oop multi_allocate(int rank, jint* sizes, TRAPS);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  objArrayOop allocate_arrayArray(int n, int length, TRAPS);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
27020
a7c8010446c2 8036805: Correct linker method lookup.
lfoltan
parents: 26412
diff changeset
    84
  // find field according to JVM spec 5.4.3.2, returns the klass in which the field is defined
a7c8010446c2 8036805: Correct linker method lookup.
lfoltan
parents: 26412
diff changeset
    85
  Klass* find_field(Symbol* name, Symbol* sig, fieldDescriptor* fd) const;
a7c8010446c2 8036805: Correct linker method lookup.
lfoltan
parents: 26412
diff changeset
    86
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  // Lookup operations
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 33611
diff changeset
    88
  Method* uncached_lookup_method(const Symbol* name,
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 33611
diff changeset
    89
                                 const Symbol* signature,
50735
2f2af62dfac7 8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents: 49982
diff changeset
    90
                                 OverpassLookupMode overpass_mode,
2f2af62dfac7 8010319: Implementation of JEP 181: Nest-Based Access Control
dholmes
parents: 49982
diff changeset
    91
                                 PrivateLookupMode private_mode = find_private) const;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    93
  static ArrayKlass* cast(Klass* k) {
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 33611
diff changeset
    94
    return const_cast<ArrayKlass*>(cast(const_cast<const Klass*>(k)));
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 33611
diff changeset
    95
  }
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 33611
diff changeset
    96
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 33611
diff changeset
    97
  static const ArrayKlass* cast(const Klass* k) {
33611
9abd65805e19 8139203: Consistent naming for klass type predicates
coleenp
parents: 32606
diff changeset
    98
    assert(k->is_array_klass(), "cast to ArrayKlass");
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 33611
diff changeset
    99
    return static_cast<const ArrayKlass*>(k);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
49948
ff8dbb56740a 8200466: Revisit the setting of _transitive_interfaces in InstanceKlass
ccheung
parents: 47216
diff changeset
   102
  GrowableArray<Klass*>* compute_secondary_supers(int num_extra_slots,
ff8dbb56740a 8200466: Revisit the setting of _transitive_interfaces in InstanceKlass
ccheung
parents: 47216
diff changeset
   103
                                                  Array<Klass*>* transitive_interfaces);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
   104
  bool compute_is_subtype_of(Klass* k);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  // Sizing
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
   107
  static int static_size(int header_size);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
46746
ea379ebb9447 8072061: Automatically determine optimal sizes for the CDS regions
iklam
parents: 46329
diff changeset
   109
  virtual void metaspace_pointers_do(MetaspaceClosure* iter);
ea379ebb9447 8072061: Automatically determine optimal sizes for the CDS regions
iklam
parents: 46329
diff changeset
   110
15437
eabd4555d072 6479360: PrintClassHistogram improvements
acorn
parents: 13952
diff changeset
   111
#if INCLUDE_SERVICES
eabd4555d072 6479360: PrintClassHistogram improvements
acorn
parents: 13952
diff changeset
   112
  virtual void collect_statistics(KlassSizeStats *sz) const {
eabd4555d072 6479360: PrintClassHistogram improvements
acorn
parents: 13952
diff changeset
   113
    Klass::collect_statistics(sz);
eabd4555d072 6479360: PrintClassHistogram improvements
acorn
parents: 13952
diff changeset
   114
    // Do nothing for now, but remember to modify if you add new
eabd4555d072 6479360: PrintClassHistogram improvements
acorn
parents: 13952
diff changeset
   115
    // stuff to ArrayKlass.
eabd4555d072 6479360: PrintClassHistogram improvements
acorn
parents: 13952
diff changeset
   116
  }
eabd4555d072 6479360: PrintClassHistogram improvements
acorn
parents: 13952
diff changeset
   117
#endif
eabd4555d072 6479360: PrintClassHistogram improvements
acorn
parents: 13952
diff changeset
   118
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  // Iterators
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
   120
  void array_klasses_do(void f(Klass* k));
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
   121
  void array_klasses_do(void f(Klass* k, TRAPS), TRAPS);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  // Return a handle.
46329
53ccc37bda19 8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents: 40887
diff changeset
   124
  static void     complete_create_array_klass(ArrayKlass* k, Klass* super_klass, ModuleEntry* module, TRAPS);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
   125
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
6176
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   127
  // jvm support
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   128
  jint compute_modifier_flags(TRAPS) const;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
6176
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   130
  // JVMTI support
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   131
  jint jvmti_class_status() const;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
   133
  // CDS support - remove and restore oops from metadata. Oops are not shared.
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
   134
  virtual void remove_unshareable_info();
47103
a993ec29ec75 8186842: Use Java class loaders for creating the CDS archive
ccheung
parents: 46746
diff changeset
   135
  virtual void remove_java_mirror();
26135
82b516c550f7 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 23999
diff changeset
   136
  virtual void restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
   137
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  // Printing
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
   139
  void print_on(outputStream* st) const;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
   140
  void print_value_on(outputStream* st) const;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
   141
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  void oop_print_on(oop obj, outputStream* st);
6176
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   143
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
  // Verification
22794
f1c014ad3754 8027146: Class loading verification failure if GC occurs in Universe::flush_dependents_on
coleenp
parents: 18687
diff changeset
   145
  void verify_on(outputStream* st);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11430
diff changeset
   146
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  void oop_verify_on(oop obj, outputStream* st);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
   149
30880
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   150
// Array oop iteration macros for declarations.
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   151
// Used to generate the declarations in the *ArrayKlass header files.
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   152
32606
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
   153
#define OOP_OOP_ITERATE_DECL_RANGE(OopClosureType, nv_suffix)                                   \
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
   154
  void oop_oop_iterate_range##nv_suffix(oop obj, OopClosureType* closure, int start, int end);
30880
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   155
49982
9042ffe5b7fe 8200729: Conditional compilation of GCs
stefank
parents: 49948
diff changeset
   156
#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
30880
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   157
// Named NO_BACKWARDS because the definition used by *ArrayKlass isn't reversed, see below.
32606
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
   158
#define OOP_OOP_ITERATE_DECL_NO_BACKWARDS(OopClosureType, nv_suffix)            \
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
   159
  void oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure);
49982
9042ffe5b7fe 8200729: Conditional compilation of GCs
stefank
parents: 49948
diff changeset
   160
#endif
30880
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   161
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   162
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   163
// Array oop iteration macros for definitions.
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   164
// Used to generate the definitions in the *ArrayKlass.inline.hpp files.
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   165
32606
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
   166
#define OOP_OOP_ITERATE_DEFN_RANGE(KlassType, OopClosureType, nv_suffix)                                  \
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
   167
                                                                                                          \
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
   168
void KlassType::oop_oop_iterate_range##nv_suffix(oop obj, OopClosureType* closure, int start, int end) {  \
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
   169
  oop_oop_iterate_range<nvs_to_bool(nv_suffix)>(obj, closure, start, end);                                \
30880
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   170
}
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   171
49982
9042ffe5b7fe 8200729: Conditional compilation of GCs
stefank
parents: 49948
diff changeset
   172
#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
32606
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
   173
#define OOP_OOP_ITERATE_DEFN_NO_BACKWARDS(KlassType, OopClosureType, nv_suffix)           \
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
   174
void KlassType::oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) {  \
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
   175
  /* No reverse implementation ATM. */                                                    \
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
   176
  oop_oop_iterate<nvs_to_bool(nv_suffix)>(obj, closure);                                  \
30880
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   177
}
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   178
#else
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   179
#define OOP_OOP_ITERATE_DEFN_NO_BACKWARDS(KlassType, OopClosureType, nv_suffix)
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   180
#endif
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 28731
diff changeset
   181
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6176
diff changeset
   182
#endif // SHARE_VM_OOPS_ARRAYKLASS_HPP