author | kbarrett |
Thu, 23 Apr 2015 11:26:32 -0400 | |
changeset 30558 | baec90a2699f |
parent 30150 | d9c940aa42ef |
child 30764 | fec48bf5a827 |
permissions | -rw-r--r-- |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
1 |
/* |
20282
7f9cbdf89af2
7195622: CheckUnhandledOops has limited usefulness now
hseigel
parents:
15482
diff
changeset
|
2 |
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
4 |
* |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
8 |
* |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
13 |
* accompanied this code). |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
14 |
* |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
18 |
* |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
21 |
* questions. |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
22 |
* |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
23 |
*/ |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
24 |
|
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
25 |
#ifndef SHARE_VM_OOPS_INSTANCEMIRRORKLASS_HPP |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
26 |
#define SHARE_VM_OOPS_INSTANCEMIRRORKLASS_HPP |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
27 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
8878
diff
changeset
|
28 |
#include "classfile/systemDictionary.hpp" |
29688 | 29 |
#include "memory/specialized_oop_closures.hpp" |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
30 |
#include "oops/instanceKlass.hpp" |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
8878
diff
changeset
|
31 |
#include "runtime/handles.hpp" |
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
13738
diff
changeset
|
32 |
#include "utilities/macros.hpp" |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
33 |
|
13738
d67be49a5beb
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
13728
diff
changeset
|
34 |
// An InstanceMirrorKlass is a specialized InstanceKlass for |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
35 |
// java.lang.Class instances. These instances are special because |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
36 |
// they contain the static fields of the class in addition to the |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
37 |
// normal fields of Class. This means they are variable sized |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
38 |
// instances and need special logic for computing their size and for |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
39 |
// iteration of their oops. |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
40 |
|
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
41 |
|
13738
d67be49a5beb
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
13728
diff
changeset
|
42 |
class InstanceMirrorKlass: public InstanceKlass { |
8878
a6283814032c
7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents:
8725
diff
changeset
|
43 |
friend class VMStructs; |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
8878
diff
changeset
|
44 |
friend class InstanceKlass; |
8878
a6283814032c
7031614: jmap -permstat fails with java.lang.InternalError in sun.jvm.hotspot.oops.OopField.getValue
never
parents:
8725
diff
changeset
|
45 |
|
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
46 |
private: |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
47 |
static int _offset_of_static_fields; |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
48 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
8878
diff
changeset
|
49 |
// Constructor |
13738
d67be49a5beb
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
13728
diff
changeset
|
50 |
InstanceMirrorKlass(int vtable_len, int itable_len, int static_field_size, int nonstatic_oop_map_size, ReferenceType rt, AccessFlags access_flags, bool is_anonymous) |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
8878
diff
changeset
|
51 |
: InstanceKlass(vtable_len, itable_len, static_field_size, nonstatic_oop_map_size, rt, access_flags, is_anonymous) {} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
8878
diff
changeset
|
52 |
|
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
53 |
public: |
13738
d67be49a5beb
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
13728
diff
changeset
|
54 |
InstanceMirrorKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); } |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
55 |
// Type testing |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
56 |
bool oop_is_instanceMirror() const { return true; } |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
57 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
8878
diff
changeset
|
58 |
// Casting from Klass* |
13738
d67be49a5beb
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
13728
diff
changeset
|
59 |
static InstanceMirrorKlass* cast(Klass* k) { |
d67be49a5beb
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
13728
diff
changeset
|
60 |
assert(k->oop_is_instanceMirror(), "cast to InstanceMirrorKlass"); |
d67be49a5beb
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
13728
diff
changeset
|
61 |
return (InstanceMirrorKlass*) k; |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
62 |
} |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
63 |
|
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
64 |
// Returns the size of the instance including the extra static fields. |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
65 |
virtual int oop_size(oop obj) const; |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
66 |
|
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
67 |
// Static field offset is an offset into the Heap, should be converted by |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
68 |
// based on UseCompressedOop for traversal |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
69 |
static HeapWord* start_of_static_fields(oop obj) { |
20282
7f9cbdf89af2
7195622: CheckUnhandledOops has limited usefulness now
hseigel
parents:
15482
diff
changeset
|
70 |
return (HeapWord*)(cast_from_oop<intptr_t>(obj) + offset_of_static_fields()); |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
71 |
} |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
72 |
|
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
73 |
static void init_offset_of_static_fields() { |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
74 |
// Cache the offset of the static fields in the Class instance |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
75 |
assert(_offset_of_static_fields == 0, "once"); |
13738
d67be49a5beb
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
13728
diff
changeset
|
76 |
_offset_of_static_fields = InstanceMirrorKlass::cast(SystemDictionary::Class_klass())->size_helper() << LogHeapWordSize; |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
77 |
} |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
78 |
|
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
79 |
static int offset_of_static_fields() { |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
80 |
return _offset_of_static_fields; |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
81 |
} |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
82 |
|
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
83 |
int compute_static_oop_field_count(oop obj); |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
84 |
|
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
85 |
// Given a Klass return the size of the instance |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
86 |
int instance_size(KlassHandle k); |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
87 |
|
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
88 |
// allocation |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
89 |
instanceOop allocate_instance(KlassHandle k, TRAPS); |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
90 |
|
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
91 |
// 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
|
92 |
// |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
93 |
// Mark Sweep |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
94 |
void oop_ms_follow_contents(oop obj); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
95 |
int oop_ms_adjust_pointers(oop obj); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
96 |
#if INCLUDE_ALL_GCS |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
97 |
// Parallel Scavenge |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
98 |
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
|
99 |
// Parallel Compact |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
100 |
void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
101 |
void oop_pc_update_pointers(oop obj); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
102 |
#endif |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
103 |
|
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
104 |
// 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
|
105 |
// [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:
29688
diff
changeset
|
106 |
// [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:
29688
diff
changeset
|
107 |
// |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
108 |
// The InstanceMirrorKlass iterators also visit the hidden Klass pointer. |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
109 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
110 |
public: |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
111 |
// Iterate over the static fields. |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
112 |
template <bool nv, class OopClosureType> |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
113 |
inline void oop_oop_iterate_statics(oop obj, OopClosureType* closure); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
114 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
115 |
private: |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
116 |
// Iterate over the static fields. |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
117 |
// 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:
29688
diff
changeset
|
118 |
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:
29688
diff
changeset
|
119 |
inline void oop_oop_iterate_statics_specialized(oop obj, OopClosureType* closure); |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
120 |
|
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
121 |
// Forward iteration |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
122 |
// Iterate over the oop fields and metadata. |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
123 |
template <bool nv, class OopClosureType> |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
124 |
inline int oop_oop_iterate(oop obj, OopClosureType* closure); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
125 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
126 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
127 |
// Reverse iteration |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
128 |
#if INCLUDE_ALL_GCS |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
129 |
// Iterate over the oop fields and metadata. |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
130 |
template <bool nv, class OopClosureType> |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
131 |
inline int oop_oop_iterate_reverse(oop obj, OopClosureType* closure); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
132 |
#endif |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
133 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
134 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
135 |
// Bounded range iteration |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
136 |
// Iterate over the oop fields and metadata. |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
137 |
template <bool nv, class OopClosureType> |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
138 |
inline int oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
139 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
140 |
// Iterate over the static fields. |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
141 |
template <bool nv, class OopClosureType> |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
142 |
inline void oop_oop_iterate_statics_bounded(oop obj, OopClosureType* closure, MemRegion mr); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
143 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
144 |
// Iterate over the static fields. |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
145 |
// 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:
29688
diff
changeset
|
146 |
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:
29688
diff
changeset
|
147 |
inline void oop_oop_iterate_statics_specialized_bounded(oop obj, OopClosureType* closure, MemRegion mr); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
148 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
149 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29688
diff
changeset
|
150 |
public: |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
151 |
|
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
152 |
#define InstanceMirrorKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
153 |
int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* blk); \ |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
154 |
int oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* blk, MemRegion mr); |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
155 |
|
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
156 |
ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceMirrorKlass_OOP_OOP_ITERATE_DECL) |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
157 |
ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_DECL) |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
158 |
|
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
13738
diff
changeset
|
159 |
#if INCLUDE_ALL_GCS |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
160 |
#define InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
161 |
int oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* blk); |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
162 |
|
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
163 |
ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DECL) |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
164 |
ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DECL) |
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
13738
diff
changeset
|
165 |
#endif // INCLUDE_ALL_GCS |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
166 |
}; |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
167 |
|
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
168 |
#endif // SHARE_VM_OOPS_INSTANCEMIRRORKLASS_HPP |