author | coleenp |
Wed, 24 Jul 2019 10:22:11 -0400 | |
changeset 57511 | 00ae3b739184 |
parent 53244 | 9807daeb47c4 |
child 59247 | 56bf71d64d51 |
permissions | -rw-r--r-- |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52188
diff
changeset
|
2 |
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
4 |
* |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
8 |
* |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
13 |
* accompanied this code). |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
14 |
* |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
18 |
* |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
21 |
* questions. |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
22 |
* |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
23 |
*/ |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
24 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52188
diff
changeset
|
25 |
#ifndef SHARE_OOPS_INSTANCEKLASS_INLINE_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52188
diff
changeset
|
26 |
#define SHARE_OOPS_INSTANCEKLASS_INLINE_HPP |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
27 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
28 |
#include "memory/iterator.hpp" |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
29 |
#include "oops/instanceKlass.hpp" |
30880
efe35e08179f
8080746: Refactor oop iteration macros to be more general
sjohanss
parents:
30151
diff
changeset
|
30 |
#include "oops/klass.hpp" |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
31 |
#include "oops/oop.inline.hpp" |
50429
83aec1d357d4
8204301: Make OrderAccess functions available to hpp rather than inline.hpp files
coleenp
parents:
49982
diff
changeset
|
32 |
#include "runtime/orderAccess.hpp" |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
33 |
#include "utilities/debug.hpp" |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
34 |
#include "utilities/globalDefinitions.hpp" |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
35 |
#include "utilities/macros.hpp" |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
36 |
|
40887
8d35e19f5548
8158854: Ensure release_store is paired with load_acquire in lock-free code
dholmes
parents:
37092
diff
changeset
|
37 |
inline Klass* InstanceKlass::array_klasses_acquire() const { |
47634
6a0c42c40cd1
8188220: Remove Atomic::*_ptr() uses and overloads from hotspot
coleenp
parents:
47216
diff
changeset
|
38 |
return OrderAccess::load_acquire(&_array_klasses); |
40887
8d35e19f5548
8158854: Ensure release_store is paired with load_acquire in lock-free code
dholmes
parents:
37092
diff
changeset
|
39 |
} |
8d35e19f5548
8158854: Ensure release_store is paired with load_acquire in lock-free code
dholmes
parents:
37092
diff
changeset
|
40 |
|
8d35e19f5548
8158854: Ensure release_store is paired with load_acquire in lock-free code
dholmes
parents:
37092
diff
changeset
|
41 |
inline void InstanceKlass::release_set_array_klasses(Klass* k) { |
47634
6a0c42c40cd1
8188220: Remove Atomic::*_ptr() uses and overloads from hotspot
coleenp
parents:
47216
diff
changeset
|
42 |
OrderAccess::release_store(&_array_klasses, k); |
40887
8d35e19f5548
8158854: Ensure release_store is paired with load_acquire in lock-free code
dholmes
parents:
37092
diff
changeset
|
43 |
} |
8d35e19f5548
8158854: Ensure release_store is paired with load_acquire in lock-free code
dholmes
parents:
37092
diff
changeset
|
44 |
|
8d35e19f5548
8158854: Ensure release_store is paired with load_acquire in lock-free code
dholmes
parents:
37092
diff
changeset
|
45 |
inline jmethodID* InstanceKlass::methods_jmethod_ids_acquire() const { |
47634
6a0c42c40cd1
8188220: Remove Atomic::*_ptr() uses and overloads from hotspot
coleenp
parents:
47216
diff
changeset
|
46 |
return OrderAccess::load_acquire(&_methods_jmethod_ids); |
40887
8d35e19f5548
8158854: Ensure release_store is paired with load_acquire in lock-free code
dholmes
parents:
37092
diff
changeset
|
47 |
} |
8d35e19f5548
8158854: Ensure release_store is paired with load_acquire in lock-free code
dholmes
parents:
37092
diff
changeset
|
48 |
|
8d35e19f5548
8158854: Ensure release_store is paired with load_acquire in lock-free code
dholmes
parents:
37092
diff
changeset
|
49 |
inline void InstanceKlass::release_set_methods_jmethod_ids(jmethodID* jmeths) { |
47634
6a0c42c40cd1
8188220: Remove Atomic::*_ptr() uses and overloads from hotspot
coleenp
parents:
47216
diff
changeset
|
50 |
OrderAccess::release_store(&_methods_jmethod_ids, jmeths); |
40887
8d35e19f5548
8158854: Ensure release_store is paired with load_acquire in lock-free code
dholmes
parents:
37092
diff
changeset
|
51 |
} |
8d35e19f5548
8158854: Ensure release_store is paired with load_acquire in lock-free code
dholmes
parents:
37092
diff
changeset
|
52 |
|
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
53 |
// The iteration over the oops in objects is a hot path in the GC code. |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
54 |
// By force inlining the following functions, we get similar GC performance |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
55 |
// as the previous macro based implementation. |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
56 |
|
50752 | 57 |
template <typename T, class OopClosureType> |
37092
0e56e3c9d545
8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
simonis
parents:
32606
diff
changeset
|
58 |
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_map(OopMapBlock* map, oop obj, OopClosureType* closure) { |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47634
diff
changeset
|
59 |
T* p = (T*)obj->obj_field_addr_raw<T>(map->offset()); |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
60 |
T* const end = p + map->count(); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
61 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
62 |
for (; p < end; ++p) { |
50752 | 63 |
Devirtualizer::do_oop(closure, p); |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
64 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
65 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
66 |
|
50752 | 67 |
template <typename T, class OopClosureType> |
37092
0e56e3c9d545
8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
simonis
parents:
32606
diff
changeset
|
68 |
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_map_reverse(OopMapBlock* map, oop obj, OopClosureType* closure) { |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47634
diff
changeset
|
69 |
T* const start = (T*)obj->obj_field_addr_raw<T>(map->offset()); |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
70 |
T* p = start + map->count(); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
71 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
72 |
while (start < p) { |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
73 |
--p; |
50752 | 74 |
Devirtualizer::do_oop(closure, p); |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
75 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
76 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
77 |
|
50752 | 78 |
template <typename T, class OopClosureType> |
37092
0e56e3c9d545
8151593: Cleanup definition/usage of INLINE/NOINLINE macros and add xlC support
simonis
parents:
32606
diff
changeset
|
79 |
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_map_bounded(OopMapBlock* map, oop obj, OopClosureType* closure, MemRegion mr) { |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47634
diff
changeset
|
80 |
T* p = (T*)obj->obj_field_addr_raw<T>(map->offset()); |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
81 |
T* end = p + map->count(); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
82 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
83 |
T* const l = (T*)mr.start(); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
84 |
T* const h = (T*)mr.end(); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
85 |
assert(mask_bits((intptr_t)l, sizeof(T)-1) == 0 && |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
86 |
mask_bits((intptr_t)h, sizeof(T)-1) == 0, |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
87 |
"bounded region must be properly aligned"); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
88 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
89 |
if (p < l) { |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
90 |
p = l; |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
91 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
92 |
if (end > h) { |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
93 |
end = h; |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
94 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
95 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
96 |
for (;p < end; ++p) { |
50752 | 97 |
Devirtualizer::do_oop(closure, p); |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
98 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
99 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
100 |
|
50752 | 101 |
template <typename T, class OopClosureType> |
102 |
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps(oop obj, OopClosureType* closure) { |
|
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
103 |
OopMapBlock* map = start_of_nonstatic_oop_maps(); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
104 |
OopMapBlock* const end_map = map + nonstatic_oop_map_count(); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
105 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
106 |
for (; map < end_map; ++map) { |
50752 | 107 |
oop_oop_iterate_oop_map<T>(map, obj, closure); |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
108 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
109 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
110 |
|
50752 | 111 |
template <typename T, class OopClosureType> |
112 |
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_reverse(oop obj, OopClosureType* closure) { |
|
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
113 |
OopMapBlock* const start_map = start_of_nonstatic_oop_maps(); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
114 |
OopMapBlock* map = start_map + nonstatic_oop_map_count(); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
115 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
116 |
while (start_map < map) { |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
117 |
--map; |
50752 | 118 |
oop_oop_iterate_oop_map_reverse<T>(map, obj, closure); |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
119 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
120 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
121 |
|
50752 | 122 |
template <typename T, class OopClosureType> |
123 |
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_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:
diff
changeset
|
124 |
OopMapBlock* map = start_of_nonstatic_oop_maps(); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
125 |
OopMapBlock* const end_map = map + nonstatic_oop_map_count(); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
126 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
127 |
for (;map < end_map; ++map) { |
50752 | 128 |
oop_oop_iterate_oop_map_bounded<T>(map, obj, closure, mr); |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
129 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
130 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
131 |
|
50752 | 132 |
template <typename T, class OopClosureType> |
52188
0fcd1285435e
8212595: Remove unused size_helper() in oop_oop_iterate* in instanceKlass.inline.hpp
lkorinth
parents:
50752
diff
changeset
|
133 |
ALWAYSINLINE void InstanceKlass::oop_oop_iterate(oop obj, OopClosureType* closure) { |
50752 | 134 |
if (Devirtualizer::do_metadata(closure)) { |
135 |
Devirtualizer::do_klass(closure, this); |
|
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
136 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
137 |
|
50752 | 138 |
oop_oop_iterate_oop_maps<T>(obj, closure); |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
139 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
140 |
|
50752 | 141 |
template <typename T, class OopClosureType> |
52188
0fcd1285435e
8212595: Remove unused size_helper() in oop_oop_iterate* in instanceKlass.inline.hpp
lkorinth
parents:
50752
diff
changeset
|
142 |
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) { |
50752 | 143 |
assert(!Devirtualizer::do_metadata(closure), |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
144 |
"Code to handle metadata is not implemented"); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
145 |
|
50752 | 146 |
oop_oop_iterate_oop_maps_reverse<T>(obj, closure); |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
147 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
148 |
|
50752 | 149 |
template <typename T, class OopClosureType> |
52188
0fcd1285435e
8212595: Remove unused size_helper() in oop_oop_iterate* in instanceKlass.inline.hpp
lkorinth
parents:
50752
diff
changeset
|
150 |
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) { |
50752 | 151 |
if (Devirtualizer::do_metadata(closure)) { |
152 |
if (mr.contains(obj)) { |
|
153 |
Devirtualizer::do_klass(closure, this); |
|
154 |
} |
|
155 |
} |
|
156 |
||
157 |
oop_oop_iterate_oop_maps_bounded<T>(obj, closure, mr); |
|
158 |
} |
|
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
159 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52188
diff
changeset
|
160 |
#endif // SHARE_OOPS_INSTANCEKLASS_INLINE_HPP |