Mercurial > hg > truffle
annotate src/share/vm/oops/instanceMirrorKlass.cpp @ 17546:46fa2940e686 jdk8u5-b07
Merge
author | asaha |
---|---|
date | Sun, 02 Feb 2014 22:45:03 -0800 |
parents | 55fb97c4c58d |
children | 4ca6dc0799b6 9428a0b94204 |
rev | line source |
---|---|
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
1 /* |
17467
55fb97c4c58d
8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
mikael
parents:
13438
diff
changeset
|
2 * Copyright (c) 2011, 2013, 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" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
31 #include "memory/oopFactory.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
32 #include "oops/instanceKlass.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
33 #include "oops/instanceMirrorKlass.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
34 #include "oops/instanceOop.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
35 #include "oops/oop.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
36 #include "oops/symbol.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
37 #include "runtime/handles.inline.hpp" |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
38 #include "utilities/macros.hpp" |
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
39 #if INCLUDE_ALL_GCS |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
40 #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
|
41 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
42 #include "gc_implementation/g1/g1OopClosures.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
43 #include "gc_implementation/g1/g1RemSet.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
44 #include "gc_implementation/g1/heapRegionSeq.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
45 #include "gc_implementation/parNew/parOopClosures.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
46 #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
47 #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
48 #include "oops/oop.pcgc.inline.hpp" |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
49 #endif // INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
50 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
51 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
|
52 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
53 #ifdef ASSERT |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
54 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
|
55 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
|
56 if (!oopDesc::is_null(heap_oop)) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
57 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
|
58 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
|
59 } |
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 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
|
62 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
|
63 if (!oopDesc::is_null(heap_oop)) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
64 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
|
65 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
|
66 } |
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 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
|
69 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
|
70 if (!oopDesc::is_null(heap_oop)) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
71 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
|
72 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
|
73 } |
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 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
|
76 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
77 #else |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
78 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
|
79 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
|
80 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
|
81 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
|
82 #endif // ASSERT |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
83 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
84 #define InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
85 T, start_p, count, do_oop, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
86 assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
87 { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
88 T* p = (T*)(start_p); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
89 T* const end = p + (count); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
90 while (p < end) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
91 (assert_fn)(p); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
92 do_oop; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
93 ++p; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
94 } \ |
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 #define InstanceMirrorKlass_SPECIALIZED_BOUNDED_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
98 T, start_p, count, low, high, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
99 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
100 { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
101 T* const l = (T*)(low); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
102 T* const h = (T*)(high); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
103 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
|
104 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
|
105 "bounded region must be properly aligned"); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
106 T* p = (T*)(start_p); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
107 T* end = p + (count); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
108 if (p < l) p = l; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
109 if (end > h) end = h; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
110 while (p < end) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
111 (assert_fn)(p); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
112 do_oop; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
113 ++p; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
114 } \ |
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 #define InstanceMirrorKlass_OOP_ITERATE(start_p, count, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
119 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
120 { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
121 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
122 InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE(narrowOop, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
123 start_p, count, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
124 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
125 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
126 InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE(oop, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
127 start_p, count, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
128 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
129 } \ |
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 // 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
|
133 // 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
|
134 // flag. |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
135 #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
|
136 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
137 { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
138 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
139 InstanceMirrorKlass_SPECIALIZED_BOUNDED_OOP_ITERATE(narrowOop, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
140 start_p, count, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
141 low, high, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
142 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
143 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
144 InstanceMirrorKlass_SPECIALIZED_BOUNDED_OOP_ITERATE(oop, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
145 start_p, count, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
146 low, high, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
147 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
148 } \ |
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 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
152 void InstanceMirrorKlass::oop_follow_contents(oop obj) { |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
153 InstanceKlass::oop_follow_contents(obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
154 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
155 // Follow the klass field in the mirror. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
156 Klass* klass = java_lang_Class::as_Klass(obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
157 if (klass != NULL) { |
13438
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
158 // 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
|
159 // 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
|
160 // 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
|
161 // 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
|
162 // 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
|
163 // 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
|
164 // is handled. |
13417
55a0da3d420b
8027675: Full collections with Serial slower in JDK 8 compared to 7u40
sjohanss
parents:
8001
diff
changeset
|
165 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
|
166 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
|
167 } else { |
55a0da3d420b
8027675: Full collections with Serial slower in JDK 8 compared to 7u40
sjohanss
parents:
8001
diff
changeset
|
168 MarkSweep::follow_klass(klass); |
55a0da3d420b
8027675: Full collections with Serial slower in JDK 8 compared to 7u40
sjohanss
parents:
8001
diff
changeset
|
169 } |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
170 } else { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
171 // 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
|
172 // 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
|
173 // roots in Universe::oops_do. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
174 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
|
175 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
176 |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
177 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
178 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
|
179 MarkSweep::mark_and_push(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
180 assert_is_in_closed_subset) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
181 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
182 |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
183 #if INCLUDE_ALL_GCS |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
184 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
|
185 oop obj) { |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
186 InstanceKlass::oop_follow_contents(cm, obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
187 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
188 // Follow the klass field in the mirror. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
189 Klass* klass = java_lang_Class::as_Klass(obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
190 if (klass != NULL) { |
13438
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
191 // 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
|
192 // 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
|
193 // 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
|
194 // 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
|
195 // 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
|
196 // 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
|
197 // is handled. |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
198 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
|
199 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
|
200 } else { |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
201 PSParallelCompact::follow_klass(cm, klass); |
ad72068ac41e
8028993: Full collections with ParallelScavenge slower in JDK 8 compared to 7u40
sjohanss
parents:
13417
diff
changeset
|
202 } |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
203 } else { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
204 // 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
|
205 // 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
|
206 // roots in Universe::oops_do. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
207 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
|
208 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
209 |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
210 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
211 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
|
212 PSParallelCompact::mark_and_push(cm, p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
213 assert_is_in) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
214 } |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
215 #endif // INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
216 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
217 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
|
218 int size = oop_size(obj); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
219 InstanceKlass::oop_adjust_pointers(obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
220 |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
221 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
222 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
|
223 MarkSweep::adjust_pointer(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
224 assert_nothing) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
225 return size; |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
226 } |
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 #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
|
229 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
230 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
|
231 (closure)->do_oop##nv_suffix(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
232 assert_is_in_closed_subset) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
233 return oop_size(obj); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
234 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
235 #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
|
236 InstanceMirrorKlass_BOUNDED_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
237 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
|
238 mr.start(), mr.end(), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
239 (closure)->do_oop##nv_suffix(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
240 assert_is_in_closed_subset) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
241 return oop_size(obj); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
242 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
243 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
244 #define if_do_metadata_checked(closure, nv_suffix) \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
245 /* Make sure the non-virtual and the virtual versions match. */ \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
246 assert(closure->do_metadata##nv_suffix() == closure->do_metadata(), \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
247 "Inconsistency in do_metadata"); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
248 if (closure->do_metadata##nv_suffix()) |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
249 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
250 // 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
|
251 // 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
|
252 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
253 #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
|
254 \ |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
255 int InstanceMirrorKlass:: \ |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
256 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
|
257 /* Get size before changing pointers */ \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
258 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
|
259 \ |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
260 InstanceKlass::oop_oop_iterate##nv_suffix(obj, closure); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
261 \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
262 if_do_metadata_checked(closure, nv_suffix) { \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
263 Klass* klass = java_lang_Class::as_Klass(obj); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
264 /* We'll get NULL for primitive mirrors. */ \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
265 if (klass != NULL) { \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
266 closure->do_klass##nv_suffix(klass); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
267 } \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
268 } \ |
2376
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 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
271 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
|
272 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
273 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
|
274 } \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
275 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
276 |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
277 #if INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
278 #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
|
279 \ |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
280 int InstanceMirrorKlass:: \ |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
281 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
|
282 /* Get size before changing pointers */ \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
283 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
|
284 \ |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
285 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
|
286 \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
287 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
288 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
|
289 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
290 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
|
291 } \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
292 } |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
293 #endif // INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
294 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
295 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
296 #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
|
297 \ |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
298 int InstanceMirrorKlass:: \ |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
299 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
|
300 OopClosureType* closure, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
301 MemRegion mr) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
302 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
|
303 \ |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
304 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
|
305 \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
306 if_do_metadata_checked(closure, nv_suffix) { \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
307 if (mr.contains(obj)) { \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
308 Klass* klass = java_lang_Class::as_Klass(obj); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
309 /* We'll get NULL for primitive mirrors. */ \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
310 if (klass != NULL) { \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
311 closure->do_klass##nv_suffix(klass); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
312 } \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
313 } \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
314 } \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
315 \ |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
316 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
317 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
|
318 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
319 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
|
320 } \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
321 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
322 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
323 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
|
324 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
|
325 #if INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
326 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
|
327 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
|
328 #endif // INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
329 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
|
330 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
|
331 |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
332 #if INCLUDE_ALL_GCS |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
333 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
|
334 // 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
|
335 // 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
|
336 // ClassLoaderData objects. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
337 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
338 InstanceKlass::oop_push_contents(pm, obj); |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
339 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
340 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
|
341 if (PSScavenge::should_scavenge(p)) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
342 pm->claim_or_forward_depth(p); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
343 }, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
344 assert_nothing ) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
345 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
346 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
347 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
|
348 int size = oop_size(obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
349 InstanceKlass::oop_update_pointers(cm, obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
350 |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
351 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
352 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
|
353 PSParallelCompact::adjust_pointer(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
354 assert_nothing) |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
355 return size; |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
356 } |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
357 #endif // INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
358 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
359 int InstanceMirrorKlass::instance_size(KlassHandle k) { |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
360 if (k() != NULL && k->oop_is_instance()) { |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
361 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
|
362 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
363 return size_helper(); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
364 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
365 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
366 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
|
367 // Query before forming handle. |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
368 int size = instance_size(k); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
369 KlassHandle h_k(THREAD, this); |
4009 | 370 instanceOop i = (instanceOop) CollectedHeap::Class_obj_allocate(h_k, size, k, CHECK_NULL); |
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 } |