author | hseigel |
Fri, 15 Dec 2017 11:23:50 -0500 | |
changeset 48463 | 474cec233fb2 |
parent 47216 | 71c04702a3d5 |
child 50752 | 9d62da00bf15 |
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 |
/* |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
2 |
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
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 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
25 |
#ifndef SHARE_VM_OOPS_TYPEARRAYKLASS_INLINE_HPP |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
26 |
#define SHARE_VM_OOPS_TYPEARRAYKLASS_INLINE_HPP |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
27 |
|
30880
efe35e08179f
8080746: Refactor oop iteration macros to be more general
sjohanss
parents:
30150
diff
changeset
|
28 |
#include "oops/arrayKlass.hpp" |
efe35e08179f
8080746: Refactor oop iteration macros to be more general
sjohanss
parents:
30150
diff
changeset
|
29 |
#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
|
30 |
#include "oops/oop.inline.hpp" |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
31 |
#include "oops/typeArrayKlass.hpp" |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
32 |
#include "oops/typeArrayOop.hpp" |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
33 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
34 |
class ExtendedOopClosure; |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
35 |
|
32606
fdaa30d06ada
8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents:
30880
diff
changeset
|
36 |
inline void TypeArrayKlass::oop_oop_iterate_impl(oop obj, ExtendedOopClosure* closure) { |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
37 |
assert(obj->is_typeArray(),"must be a type array"); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
38 |
// Performance tweak: We skip iterating over the klass pointer since we |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
39 |
// know that Universe::TypeArrayKlass never moves. |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
40 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
41 |
|
30880
efe35e08179f
8080746: Refactor oop iteration macros to be more general
sjohanss
parents:
30150
diff
changeset
|
42 |
template <bool nv, typename OopClosureType> |
32606
fdaa30d06ada
8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents:
30880
diff
changeset
|
43 |
void TypeArrayKlass::oop_oop_iterate(oop obj, OopClosureType* closure) { |
fdaa30d06ada
8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents:
30880
diff
changeset
|
44 |
oop_oop_iterate_impl(obj, closure); |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
45 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
46 |
|
30880
efe35e08179f
8080746: Refactor oop iteration macros to be more general
sjohanss
parents:
30150
diff
changeset
|
47 |
template <bool nv, typename OopClosureType> |
32606
fdaa30d06ada
8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents:
30880
diff
changeset
|
48 |
void TypeArrayKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) { |
fdaa30d06ada
8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents:
30880
diff
changeset
|
49 |
oop_oop_iterate_impl(obj, closure); |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
50 |
} |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
51 |
|
30880
efe35e08179f
8080746: Refactor oop iteration macros to be more general
sjohanss
parents:
30150
diff
changeset
|
52 |
#define ALL_TYPE_ARRAY_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ |
efe35e08179f
8080746: Refactor oop iteration macros to be more general
sjohanss
parents:
30150
diff
changeset
|
53 |
OOP_OOP_ITERATE_DEFN( TypeArrayKlass, OopClosureType, nv_suffix) \ |
efe35e08179f
8080746: Refactor oop iteration macros to be more general
sjohanss
parents:
30150
diff
changeset
|
54 |
OOP_OOP_ITERATE_DEFN_BOUNDED( TypeArrayKlass, OopClosureType, nv_suffix) \ |
efe35e08179f
8080746: Refactor oop iteration macros to be more general
sjohanss
parents:
30150
diff
changeset
|
55 |
OOP_OOP_ITERATE_DEFN_NO_BACKWARDS(TypeArrayKlass, OopClosureType, nv_suffix) |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
56 |
|
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
diff
changeset
|
57 |
#endif // SHARE_VM_OOPS_TYPEARRAYKLASS_INLINE_HPP |