src/hotspot/share/oops/objArrayKlass.hpp
author ccheung
Wed, 02 May 2018 09:26:10 -0700
changeset 49948 ff8dbb56740a
parent 47216 71c04702a3d5
child 49982 9042ffe5b7fe
permissions -rw-r--r--
8200466: Revisit the setting of _transitive_interfaces in InstanceKlass Summary: Delay the setting of _transitive_interfaces until after initialize_supers() in fill_instance_klass(). Reviewed-by: iklam, coleenp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
46329
53ccc37bda19 8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents: 38094
diff changeset
     2
 * Copyright (c) 1997, 2017, 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
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#ifndef SHARE_VM_OOPS_OBJARRAYKLASS_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#define SHARE_VM_OOPS_OBJARRAYKLASS_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    28
#include "classfile/classLoaderData.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "oops/arrayKlass.hpp"
15482
470d0b0c09f1 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 14488
diff changeset
    30
#include "utilities/macros.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    32
// ObjArrayKlass is the klass for objArrays
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    34
class ObjArrayKlass : public ArrayKlass {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
  friend class VMStructs;
35123
b0b89d83bcf5 8134994: use separate VMStructs databases for SA and JVMCI
twisti
parents: 33611
diff changeset
    36
  friend class JVMCIVMStructs;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
 private:
46746
ea379ebb9447 8072061: Automatically determine optimal sizes for the CDS regions
iklam
parents: 46415
diff changeset
    38
  // 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: 46415
diff changeset
    39
  // must add this field to ObjArrayKlass::metaspace_pointers_do().
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    40
  Klass* _element_klass;            // The klass of the elements of this array type
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    41
  Klass* _bottom_klass;             // The one-dimensional type (InstanceKlass or TypeArrayKlass)
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    42
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    43
  // Constructor
46329
53ccc37bda19 8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents: 38094
diff changeset
    44
  ObjArrayKlass(int n, Klass* element_klass, Symbol* name);
53ccc37bda19 8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents: 38094
diff changeset
    45
  static ObjArrayKlass* allocate(ClassLoaderData* loader_data, int n, Klass* k, Symbol* name, TRAPS);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
 public:
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    47
  // For dummy objects
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    48
  ObjArrayKlass() {}
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    49
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  // Instance variables
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    51
  Klass* element_klass() const      { return _element_klass; }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    52
  void set_element_klass(Klass* k)  { _element_klass = k; }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    53
  Klass** element_klass_addr()      { return &_element_klass; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    55
  Klass* bottom_klass() const       { return _bottom_klass; }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    56
  void set_bottom_klass(Klass* k)   { _bottom_klass = k; }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    57
  Klass** bottom_klass_addr()       { return &_bottom_klass; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
38094
46977cd73d86 8152844: JVM InstanceKlass Methods For Obtaining Package/Module Should Be Moved to Klass
rprotacio
parents: 35898
diff changeset
    59
  ModuleEntry* module() const;
46977cd73d86 8152844: JVM InstanceKlass Methods For Obtaining Package/Module Should Be Moved to Klass
rprotacio
parents: 35898
diff changeset
    60
  PackageEntry* package() const;
46977cd73d86 8152844: JVM InstanceKlass Methods For Obtaining Package/Module Should Be Moved to Klass
rprotacio
parents: 35898
diff changeset
    61
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  // Compiler/Interpreter offset
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    63
  static ByteSize element_klass_offset() { return in_ByteSize(offset_of(ObjArrayKlass, _element_klass)); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  // Dispatched operation
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  bool can_be_primary_super_slow() const;
49948
ff8dbb56740a 8200466: Revisit the setting of _transitive_interfaces in InstanceKlass
ccheung
parents: 47216
diff changeset
    67
  GrowableArray<Klass*>* compute_secondary_supers(int num_extra_slots,
ff8dbb56740a 8200466: Revisit the setting of _transitive_interfaces in InstanceKlass
ccheung
parents: 47216
diff changeset
    68
                                                  Array<Klass*>* transitive_interfaces);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    69
  bool compute_is_subtype_of(Klass* k);
33611
9abd65805e19 8139203: Consistent naming for klass type predicates
coleenp
parents: 32606
diff changeset
    70
  DEBUG_ONLY(bool is_objArray_klass_slow()  const  { return true; })
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  int oop_size(oop obj) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  // Allocation
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    74
  static Klass* allocate_objArray_klass(ClassLoaderData* loader_data,
46329
53ccc37bda19 8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents: 38094
diff changeset
    75
                                          int n, Klass* element_klass, TRAPS);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    76
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  objArrayOop allocate(int length, TRAPS);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  oop multi_allocate(int rank, jint* sizes, TRAPS);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
  // Copying
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  void  copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  // Compute protection domain
17826
9ad5cd464a75 8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents: 15482
diff changeset
    84
  oop protection_domain() const { return bottom_klass()->protection_domain(); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
46746
ea379ebb9447 8072061: Automatically determine optimal sizes for the CDS regions
iklam
parents: 46415
diff changeset
    86
  virtual void metaspace_pointers_do(MetaspaceClosure* iter);
ea379ebb9447 8072061: Automatically determine optimal sizes for the CDS regions
iklam
parents: 46415
diff changeset
    87
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    88
 private:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    89
  // Either oop or narrowOop depending on UseCompressedOops.
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    90
  // must be called from within ObjArrayKlass.cpp
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    91
  template <class T> void do_copy(arrayOop s, T* src, arrayOop d,
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    92
                                  T* dst, int length, TRAPS);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
 protected:
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
    94
  // Returns the ObjArrayKlass for n'th dimension.
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    95
  virtual Klass* array_klass_impl(bool or_null, int n, TRAPS);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  // Returns the array class with this class as element type.
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
    98
  virtual Klass* array_klass_impl(bool or_null, TRAPS);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
 public:
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 33611
diff changeset
   101
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   102
  static ObjArrayKlass* cast(Klass* k) {
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 33611
diff changeset
   103
    return const_cast<ObjArrayKlass*>(cast(const_cast<const Klass*>(k)));
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 33611
diff changeset
   104
  }
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 33611
diff changeset
   105
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 33611
diff changeset
   106
  static const ObjArrayKlass* cast(const Klass* k) {
33611
9abd65805e19 8139203: Consistent naming for klass type predicates
coleenp
parents: 32606
diff changeset
   107
    assert(k->is_objArray_klass(), "cast to ObjArrayKlass");
34666
1c7168ea0034 8140485: Class load and creation cleanup
mgronlun
parents: 33611
diff changeset
   108
    return static_cast<const ObjArrayKlass*>(k);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  // Sizing
35898
ddc274f0052f 8145628: hotspot metadata classes shouldn't use HeapWordSize or heap related macros like align_object_size
coleenp
parents: 35877
diff changeset
   112
  static int header_size()                { return sizeof(ObjArrayKlass)/wordSize; }
13952
e3cf184080bc 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 13728
diff changeset
   113
  int size() const                        { return ArrayKlass::static_size(header_size()); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  // Initialization (virtual from Klass)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  void initialize(TRAPS);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   118
  // GC specific object visitors
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   119
  //
15482
470d0b0c09f1 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 14488
diff changeset
   120
#if INCLUDE_ALL_GCS
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   121
  // Parallel Scavenge
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   122
  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: 22794
diff changeset
   123
  // Parallel Compact
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   124
  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: 35135
diff changeset
   125
  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: 22794
diff changeset
   126
#endif
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   127
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   128
  // Oop fields (and metadata) iterators
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   129
  //  [nv = true]  Use non-virtual calls to do_oop_nv.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   130
  //  [nv = false] Use virtual calls to do_oop.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   131
  //
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   132
  // The ObjArrayKlass iterators also visits the Object's klass.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   133
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   134
 private:
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   135
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   136
  // Iterate over oop elements and metadata.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   137
  template <bool nv, typename OopClosureType>
32606
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
   138
  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: 22794
diff changeset
   139
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   140
  // Iterate over oop elements within mr, and metadata.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   141
  template <bool nv, typename OopClosureType>
32606
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
   142
  inline void oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr);
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   143
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   144
  // Iterate over oop elements with indices within [start, end), and metadata.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   145
  template <bool nv, class OopClosureType>
32606
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 30880
diff changeset
   146
  inline void oop_oop_iterate_range(oop obj, OopClosureType* closure, int start, int end);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   148
  // Iterate over oop elements within [start, end), and metadata.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   149
  // Specialized for [T = oop] or [T = narrowOop].
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   150
  template <bool nv, typename T, class OopClosureType>
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   151
  inline void oop_oop_iterate_range_specialized(objArrayOop a, OopClosureType* closure, int start, int end);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   152
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   153
 public:
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   154
  // Iterate over all oop elements.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   155
  template <bool nv, class OopClosureType>
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   156
  inline void oop_oop_iterate_elements(objArrayOop a, OopClosureType* closure);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   157
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   158
 private:
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   159
  // Iterate over all oop elements.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   160
  // Specialized for [T = oop] or [T = narrowOop].
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   161
  template <bool nv, typename T, class OopClosureType>
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   162
  inline void oop_oop_iterate_elements_specialized(objArrayOop a, OopClosureType* closure);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   163
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   164
  // Iterate over all oop elements with indices within mr.
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   165
  template <bool nv, class OopClosureType>
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   166
  inline void oop_oop_iterate_elements_bounded(objArrayOop a, OopClosureType* closure, MemRegion mr);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   167
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   168
  // Iterate over oop elements within [low, high)..
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   169
  // Specialized for [T = oop] or [T = narrowOop].
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   170
  template <bool nv, typename T, class OopClosureType>
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   171
  inline void oop_oop_iterate_elements_specialized_bounded(objArrayOop a, OopClosureType* closure, void* low, void* high);
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   172
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   173
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   174
 public:
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   175
30880
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 30150
diff changeset
   176
  ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL)
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 30150
diff changeset
   177
  ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL)
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 30150
diff changeset
   178
  ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_RANGE)
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 30150
diff changeset
   179
  ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_RANGE)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   181
#if INCLUDE_ALL_GCS
30880
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 30150
diff changeset
   182
  ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_NO_BACKWARDS)
efe35e08179f 8080746: Refactor oop iteration macros to be more general
sjohanss
parents: 30150
diff changeset
   183
  ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_NO_BACKWARDS)
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   184
#endif // INCLUDE_ALL_GCS
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 22794
diff changeset
   185
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  // JVM support
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
  jint compute_modifier_flags(TRAPS) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
  // Printing
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   191
  void print_on(outputStream* st) const;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   192
  void print_value_on(outputStream* st) const;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   193
4584
e2a449e8cc6f 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 1388
diff changeset
   194
  void oop_print_value_on(oop obj, outputStream* st);
e2a449e8cc6f 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 1388
diff changeset
   195
#ifndef PRODUCT
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
  void oop_print_on      (oop obj, outputStream* st);
4584
e2a449e8cc6f 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 1388
diff changeset
   197
#endif //PRODUCT
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   199
  const char* internal_name() const;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   200
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
  // Verification
22794
f1c014ad3754 8027146: Class loading verification failure if GC occurs in Universe::flush_dependents_on
coleenp
parents: 22234
diff changeset
   202
  void verify_on(outputStream* st);
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 12379
diff changeset
   203
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  void oop_verify_on(oop obj, outputStream* st);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   206
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   207
#endif // SHARE_VM_OOPS_OBJARRAYKLASS_HPP