Mercurial > hg > truffle
annotate src/share/vm/oops/instanceMirrorKlass.cpp @ 21187:f74b9f898cf2
NodeLIRBuilder: move creation of jump from moveToPhi() to visitEndNode().
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Mon, 20 Apr 2015 11:56:21 +0200 |
parents | 7848fc12602b |
children |
rev | line source |
---|---|
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
1 /* |
17883
9428a0b94204
8028497: SIGSEGV at ClassLoaderData::oops_do(OopClosure*, KlassClosure*, bool)
coleenp
parents:
14223
diff
changeset
|
2 * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. |
2376
c7f3d0b4570f
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. |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
4 * |
c7f3d0b4570f
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 |
c7f3d0b4570f
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 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
8 * |
c7f3d0b4570f
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 |
c7f3d0b4570f
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 |
c7f3d0b4570f
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 |
c7f3d0b4570f
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 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
13 * accompanied this code). |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
14 * |
c7f3d0b4570f
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 |
c7f3d0b4570f
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, |
c7f3d0b4570f
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. |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
18 * |
c7f3d0b4570f
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 |
c7f3d0b4570f
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 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
21 * questions. |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
22 * |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
23 */ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
24 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
25 #include "precompiled.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
26 #include "classfile/javaClasses.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
27 #include "classfile/systemDictionary.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
28 #include "gc_implementation/shared/markSweep.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
29 #include "gc_interface/collectedHeap.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
30 #include "memory/genOopClosures.inline.hpp" |
20268
4c1b88a53c74
8046670: Make CMS metadata aware closures applicable for other collectors
stefank
parents:
17883
diff
changeset
|
31 #include "memory/iterator.inline.hpp" |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
32 #include "memory/oopFactory.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
33 #include "oops/instanceKlass.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
34 #include "oops/instanceMirrorKlass.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
35 #include "oops/instanceOop.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
36 #include "oops/oop.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
37 #include "oops/symbol.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
38 #include "runtime/handles.inline.hpp" |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
39 #include "utilities/macros.hpp" |
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
40 #if INCLUDE_ALL_GCS |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
41 #include "gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp" |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
42 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
43 #include "gc_implementation/g1/g1OopClosures.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
44 #include "gc_implementation/g1/g1RemSet.inline.hpp" |
20377
a8ea2f110d87
8054819: Rename HeapRegionSeq to HeapRegionManager
tschatzl
parents:
20268
diff
changeset
|
45 #include "gc_implementation/g1/heapRegionManager.inline.hpp" |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
46 #include "gc_implementation/parNew/parOopClosures.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
47 #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
48 #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
49 #include "oops/oop.pcgc.inline.hpp" |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
50 #endif // INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
51 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
52 int InstanceMirrorKlass::_offset_of_static_fields = 0; |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
53 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
54 #ifdef ASSERT |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
55 template <class T> void assert_is_in(T *p) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
56 T heap_oop = oopDesc::load_heap_oop(p); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
57 if (!oopDesc::is_null(heap_oop)) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
58 oop o = oopDesc::decode_heap_oop_not_null(heap_oop); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
59 assert(Universe::heap()->is_in(o), "should be in heap"); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
60 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
61 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
62 template <class T> void assert_is_in_closed_subset(T *p) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
63 T heap_oop = oopDesc::load_heap_oop(p); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
64 if (!oopDesc::is_null(heap_oop)) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
65 oop o = oopDesc::decode_heap_oop_not_null(heap_oop); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
66 assert(Universe::heap()->is_in_closed_subset(o), "should be in closed"); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
67 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
68 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
69 template <class T> void assert_is_in_reserved(T *p) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
70 T heap_oop = oopDesc::load_heap_oop(p); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
71 if (!oopDesc::is_null(heap_oop)) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
72 oop o = oopDesc::decode_heap_oop_not_null(heap_oop); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
73 assert(Universe::heap()->is_in_reserved(o), "should be in reserved"); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
74 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
75 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
76 template <class T> void assert_nothing(T *p) {} |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
77 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
78 #else |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
79 template <class T> void assert_is_in(T *p) {} |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
80 template <class T> void assert_is_in_closed_subset(T *p) {} |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
81 template <class T> void assert_is_in_reserved(T *p) {} |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
82 template <class T> void assert_nothing(T *p) {} |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
83 #endif // ASSERT |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
84 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
85 #define InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
86 T, start_p, count, do_oop, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
87 assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
88 { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
89 T* p = (T*)(start_p); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
90 T* const end = p + (count); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
91 while (p < end) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
92 (assert_fn)(p); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
93 do_oop; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
94 ++p; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
95 } \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
96 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
97 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
98 #define InstanceMirrorKlass_SPECIALIZED_BOUNDED_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
99 T, start_p, count, low, high, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
100 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
101 { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
102 T* const l = (T*)(low); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
103 T* const h = (T*)(high); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
104 assert(mask_bits((intptr_t)l, sizeof(T)-1) == 0 && \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
105 mask_bits((intptr_t)h, sizeof(T)-1) == 0, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
106 "bounded region must be properly aligned"); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
107 T* p = (T*)(start_p); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
108 T* end = p + (count); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
109 if (p < l) p = l; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
110 if (end > h) end = h; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
111 while (p < end) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
112 (assert_fn)(p); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
113 do_oop; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
114 ++p; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
115 } \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
116 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
117 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
118 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
119 #define InstanceMirrorKlass_OOP_ITERATE(start_p, count, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
120 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
121 { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
122 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
123 InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE(narrowOop, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
124 start_p, count, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
125 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
126 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
127 InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE(oop, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
128 start_p, count, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
129 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
130 } \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
131 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
132 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
133 // The following macros call specialized macros, passing either oop or |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
134 // narrowOop as the specialization type. These test the UseCompressedOops |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
135 // flag. |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
136 #define InstanceMirrorKlass_BOUNDED_OOP_ITERATE(start_p, count, low, high, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
137 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
138 { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
139 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
140 InstanceMirrorKlass_SPECIALIZED_BOUNDED_OOP_ITERATE(narrowOop, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
141 start_p, count, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
142 low, high, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
143 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
144 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
145 InstanceMirrorKlass_SPECIALIZED_BOUNDED_OOP_ITERATE(oop, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
146 start_p, count, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
147 low, high, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
148 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
149 } \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
150 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
151 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
152 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
153 void InstanceMirrorKlass::oop_follow_contents(oop obj) { |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
154 InstanceKlass::oop_follow_contents(obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
155 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
156 // Follow the klass field in the mirror. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
157 Klass* klass = java_lang_Class::as_Klass(obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
158 if (klass != NULL) { |
13438
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
159 // An anonymous class doesn't have its own class loader, so the call |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
160 // to follow_klass will mark and push its java mirror instead of the |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
161 // class loader. When handling the java mirror for an anonymous class |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
162 // we need to make sure its class loader data is claimed, this is done |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
163 // by calling follow_class_loader explicitly. For non-anonymous classes |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
164 // the call to follow_class_loader is made when the class loader itself |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
165 // is handled. |
13417
55a0da3d420b
8027675: Full collections with Serial slower in JDK 8 compared to 7u40
sjohanss
parents:
8001
diff
changeset
|
166 if (klass->oop_is_instance() && InstanceKlass::cast(klass)->is_anonymous()) { |
55a0da3d420b
8027675: Full collections with Serial slower in JDK 8 compared to 7u40
sjohanss
parents:
8001
diff
changeset
|
167 MarkSweep::follow_class_loader(klass->class_loader_data()); |
55a0da3d420b
8027675: Full collections with Serial slower in JDK 8 compared to 7u40
sjohanss
parents:
8001
diff
changeset
|
168 } else { |
55a0da3d420b
8027675: Full collections with Serial slower in JDK 8 compared to 7u40
sjohanss
parents:
8001
diff
changeset
|
169 MarkSweep::follow_klass(klass); |
55a0da3d420b
8027675: Full collections with Serial slower in JDK 8 compared to 7u40
sjohanss
parents:
8001
diff
changeset
|
170 } |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
171 } else { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
172 // If klass is NULL then this a mirror for a primitive type. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
173 // We don't have to follow them, since they are handled as strong |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
174 // roots in Universe::oops_do. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
175 assert(java_lang_Class::is_primitive(obj), "Sanity check"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
176 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
177 |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
178 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
179 start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
180 MarkSweep::mark_and_push(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
181 assert_is_in_closed_subset) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
182 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
183 |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
184 #if INCLUDE_ALL_GCS |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
185 void InstanceMirrorKlass::oop_follow_contents(ParCompactionManager* cm, |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
186 oop obj) { |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
187 InstanceKlass::oop_follow_contents(cm, obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
188 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
189 // Follow the klass field in the mirror. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
190 Klass* klass = java_lang_Class::as_Klass(obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
191 if (klass != NULL) { |
13438
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
192 // An anonymous class doesn't have its own class loader, so the call |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
193 // to follow_klass will mark and push its java mirror instead of the |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
194 // class loader. When handling the java mirror for an anonymous class |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
195 // we need to make sure its class loader data is claimed, this is done |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
196 // by calling follow_class_loader explicitly. For non-anonymous classes |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
197 // the call to follow_class_loader is made when the class loader itself |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
198 // is handled. |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
199 if (klass->oop_is_instance() && InstanceKlass::cast(klass)->is_anonymous()) { |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
200 PSParallelCompact::follow_class_loader(cm, klass->class_loader_data()); |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
201 } else { |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
202 PSParallelCompact::follow_klass(cm, klass); |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
203 } |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
204 } else { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
205 // If klass is NULL then this a mirror for a primitive type. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
206 // We don't have to follow them, since they are handled as strong |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
207 // roots in Universe::oops_do. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
208 assert(java_lang_Class::is_primitive(obj), "Sanity check"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
209 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
210 |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
211 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
212 start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
213 PSParallelCompact::mark_and_push(cm, p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
214 assert_is_in) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
215 } |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
216 #endif // INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
217 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
218 int InstanceMirrorKlass::oop_adjust_pointers(oop obj) { |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
219 int size = oop_size(obj); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
220 InstanceKlass::oop_adjust_pointers(obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
221 |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
222 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
223 start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
224 MarkSweep::adjust_pointer(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
225 assert_nothing) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
226 return size; |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
227 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
228 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
229 #define InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE_DEFN(T, nv_suffix) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
230 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
231 start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
232 (closure)->do_oop##nv_suffix(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
233 assert_is_in_closed_subset) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
234 return oop_size(obj); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
235 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
236 #define InstanceMirrorKlass_BOUNDED_SPECIALIZED_OOP_ITERATE(T, nv_suffix, mr) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
237 InstanceMirrorKlass_BOUNDED_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
238 start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
239 mr.start(), mr.end(), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
240 (closure)->do_oop##nv_suffix(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
241 assert_is_in_closed_subset) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
242 return oop_size(obj); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
243 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
244 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
245 // Macro to define InstanceMirrorKlass::oop_oop_iterate for virtual/nonvirtual for |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
246 // all closures. Macros calling macros above for each oop size. |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
247 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
248 #define InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
249 \ |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
250 int InstanceMirrorKlass:: \ |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
251 oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
252 /* Get size before changing pointers */ \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
253 SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
254 \ |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
255 InstanceKlass::oop_oop_iterate##nv_suffix(obj, closure); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
256 \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
257 if_do_metadata_checked(closure, nv_suffix) { \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
258 Klass* klass = java_lang_Class::as_Klass(obj); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
259 /* We'll get NULL for primitive mirrors. */ \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
260 if (klass != NULL) { \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
261 closure->do_klass##nv_suffix(klass); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
262 } \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
263 } \ |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
264 \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
265 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
266 InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE_DEFN(narrowOop, nv_suffix); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
267 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
268 InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE_DEFN(oop, nv_suffix); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
269 } \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
270 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
271 |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
272 #if INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
273 #define InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
274 \ |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
275 int InstanceMirrorKlass:: \ |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
276 oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
277 /* Get size before changing pointers */ \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
278 SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
279 \ |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
280 InstanceKlass::oop_oop_iterate_backwards##nv_suffix(obj, closure); \ |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
281 \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
282 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
283 InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE_DEFN(narrowOop, nv_suffix); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
284 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
285 InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE_DEFN(oop, nv_suffix); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
286 } \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
287 } |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
288 #endif // INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
289 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
290 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
291 #define InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
292 \ |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
293 int InstanceMirrorKlass:: \ |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
294 oop_oop_iterate##nv_suffix##_m(oop obj, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
295 OopClosureType* closure, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
296 MemRegion mr) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
297 SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::irk); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
298 \ |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
299 InstanceKlass::oop_oop_iterate##nv_suffix##_m(obj, closure, mr); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
300 \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
301 if_do_metadata_checked(closure, nv_suffix) { \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
302 if (mr.contains(obj)) { \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
303 Klass* klass = java_lang_Class::as_Klass(obj); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
304 /* We'll get NULL for primitive mirrors. */ \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
305 if (klass != NULL) { \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
306 closure->do_klass##nv_suffix(klass); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
307 } \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
308 } \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
309 } \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
310 \ |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
311 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
312 InstanceMirrorKlass_BOUNDED_SPECIALIZED_OOP_ITERATE(narrowOop, nv_suffix, mr); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
313 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
314 InstanceMirrorKlass_BOUNDED_SPECIALIZED_OOP_ITERATE(oop, nv_suffix, mr); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
315 } \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
316 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
317 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
318 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
319 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN) |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
320 #if INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
321 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
322 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN) |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
323 #endif // INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
324 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
325 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
326 |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
327 #if INCLUDE_ALL_GCS |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
328 void InstanceMirrorKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
329 // Note that we don't have to follow the mirror -> klass pointer, since all |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
330 // klasses that are dirty will be scavenged when we iterate over the |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
331 // ClassLoaderData objects. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
332 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
333 InstanceKlass::oop_push_contents(pm, obj); |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
334 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
335 start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj),\ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
336 if (PSScavenge::should_scavenge(p)) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
337 pm->claim_or_forward_depth(p); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
338 }, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
339 assert_nothing ) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
340 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
341 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
342 int InstanceMirrorKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) { |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
343 int size = oop_size(obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
344 InstanceKlass::oop_update_pointers(cm, obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
345 |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
346 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
347 start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj),\ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
348 PSParallelCompact::adjust_pointer(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
349 assert_nothing) |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
350 return size; |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
351 } |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
352 #endif // INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
353 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
354 int InstanceMirrorKlass::instance_size(KlassHandle k) { |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
355 if (k() != NULL && k->oop_is_instance()) { |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
356 return align_object_size(size_helper() + InstanceKlass::cast(k())->static_field_size()); |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
357 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
358 return size_helper(); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
359 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
360 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
361 instanceOop InstanceMirrorKlass::allocate_instance(KlassHandle k, TRAPS) { |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
362 // Query before forming handle. |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
363 int size = instance_size(k); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
364 KlassHandle h_k(THREAD, this); |
17883
9428a0b94204
8028497: SIGSEGV at ClassLoaderData::oops_do(OopClosure*, KlassClosure*, bool)
coleenp
parents:
14223
diff
changeset
|
365 instanceOop i = (instanceOop)CollectedHeap::obj_allocate(h_k, size, CHECK_NULL); |
9428a0b94204
8028497: SIGSEGV at ClassLoaderData::oops_do(OopClosure*, KlassClosure*, bool)
coleenp
parents:
14223
diff
changeset
|
366 |
9428a0b94204
8028497: SIGSEGV at ClassLoaderData::oops_do(OopClosure*, KlassClosure*, bool)
coleenp
parents:
14223
diff
changeset
|
367 // Since mirrors can be variable sized because of the static fields, store |
9428a0b94204
8028497: SIGSEGV at ClassLoaderData::oops_do(OopClosure*, KlassClosure*, bool)
coleenp
parents:
14223
diff
changeset
|
368 // the size in the mirror itself. |
9428a0b94204
8028497: SIGSEGV at ClassLoaderData::oops_do(OopClosure*, KlassClosure*, bool)
coleenp
parents:
14223
diff
changeset
|
369 java_lang_Class::set_oop_size(i, size); |
9428a0b94204
8028497: SIGSEGV at ClassLoaderData::oops_do(OopClosure*, KlassClosure*, bool)
coleenp
parents:
14223
diff
changeset
|
370 |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
371 return i; |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
372 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
373 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
374 int InstanceMirrorKlass::oop_size(oop obj) const { |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
375 return java_lang_Class::oop_size(obj); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
376 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
377 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
378 int InstanceMirrorKlass::compute_static_oop_field_count(oop obj) { |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
379 Klass* k = java_lang_Class::as_Klass(obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
380 if (k != NULL && k->oop_is_instance()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
381 return InstanceKlass::cast(k)->static_oop_field_count(); |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
382 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
383 return 0; |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
384 } |