Mercurial > hg > truffle
annotate src/share/vm/oops/instanceMirrorKlass.cpp @ 9093:cd22923e7ca7
removed unnecessary code
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 12 Apr 2013 21:35:27 +0200 |
parents | db9981fd3124 |
children | 55a0da3d420b |
rev | line source |
---|---|
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
1 /* |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
2 * Copyright (c) 2011, 2012, 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) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
158 MarkSweep::follow_klass(klass); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
159 } else { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
160 // 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
|
161 // 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
|
162 // roots in Universe::oops_do. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
163 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
|
164 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
165 |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
166 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
167 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
|
168 MarkSweep::mark_and_push(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
169 assert_is_in_closed_subset) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
170 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
171 |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
172 #if INCLUDE_ALL_GCS |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
173 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
|
174 oop obj) { |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
175 InstanceKlass::oop_follow_contents(cm, obj); |
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 // Follow the klass field in the mirror. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
178 Klass* klass = java_lang_Class::as_Klass(obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
179 if (klass != NULL) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
180 PSParallelCompact::follow_klass(cm, klass); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
181 } else { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
182 // 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
|
183 // 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
|
184 // roots in Universe::oops_do. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
185 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
|
186 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
187 |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
188 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
189 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
|
190 PSParallelCompact::mark_and_push(cm, p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
191 assert_is_in) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
192 } |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
193 #endif // INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
194 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
195 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
|
196 int size = oop_size(obj); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
197 InstanceKlass::oop_adjust_pointers(obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
198 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
199 // Follow the klass field in the mirror. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
200 Klass* klass = java_lang_Class::as_Klass(obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
201 if (klass != NULL) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
202 MarkSweep::adjust_klass(klass); |
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 MarkSweep::adjust_pointer(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
213 assert_nothing) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
214 return size; |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
215 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
216 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
217 #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
|
218 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
219 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
|
220 (closure)->do_oop##nv_suffix(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
221 assert_is_in_closed_subset) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
222 return oop_size(obj); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
223 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
224 #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
|
225 InstanceMirrorKlass_BOUNDED_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
226 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
|
227 mr.start(), mr.end(), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
228 (closure)->do_oop##nv_suffix(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
229 assert_is_in_closed_subset) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
230 return oop_size(obj); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
231 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
232 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
233 #define if_do_metadata_checked(closure, nv_suffix) \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
234 /* 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
|
235 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
|
236 "Inconsistency in do_metadata"); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
237 if (closure->do_metadata##nv_suffix()) |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
238 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
239 // 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
|
240 // 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
|
241 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
242 #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
|
243 \ |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
244 int InstanceMirrorKlass:: \ |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
245 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
|
246 /* Get size before changing pointers */ \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
247 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
|
248 \ |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
249 InstanceKlass::oop_oop_iterate##nv_suffix(obj, closure); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
250 \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
251 if_do_metadata_checked(closure, nv_suffix) { \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
252 Klass* klass = java_lang_Class::as_Klass(obj); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
253 /* We'll get NULL for primitive mirrors. */ \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
254 if (klass != NULL) { \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
255 closure->do_klass##nv_suffix(klass); \ |
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 } \ |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
258 \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
259 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
260 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
|
261 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
262 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
|
263 } \ |
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 |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
266 #if INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
267 #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
|
268 \ |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
269 int InstanceMirrorKlass:: \ |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
270 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
|
271 /* Get size before changing pointers */ \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
272 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
|
273 \ |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
274 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
|
275 \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
276 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
277 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
|
278 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
279 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
|
280 } \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
281 } |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
282 #endif // INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
283 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
284 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
285 #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
|
286 \ |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
287 int InstanceMirrorKlass:: \ |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
288 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
|
289 OopClosureType* closure, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
290 MemRegion mr) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
291 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
|
292 \ |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
293 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
|
294 \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
295 if_do_metadata_checked(closure, nv_suffix) { \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
296 if (mr.contains(obj)) { \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
297 Klass* klass = java_lang_Class::as_Klass(obj); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
298 /* We'll get NULL for primitive mirrors. */ \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
299 if (klass != NULL) { \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
300 closure->do_klass##nv_suffix(klass); \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
301 } \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
302 } \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
303 } \ |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
304 \ |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
305 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
306 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
|
307 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
308 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
|
309 } \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
310 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
311 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
312 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
|
313 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
|
314 #if INCLUDE_ALL_GCS |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
315 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
|
316 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
|
317 #endif // INCLUDE_ALL_GCS |
2376
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_m) |
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_m) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
320 |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
6735
diff
changeset
|
321 #if INCLUDE_ALL_GCS |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
322 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
|
323 // 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
|
324 // 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
|
325 // ClassLoaderData objects. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
326 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
327 InstanceKlass::oop_push_contents(pm, obj); |
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
328 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
329 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
|
330 if (PSScavenge::should_scavenge(p)) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
331 pm->claim_or_forward_depth(p); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
332 }, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
333 assert_nothing ) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
334 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
335 |
6735
aed758eda82a
7195833: NPG: Rename instanceClassLoaderKlass, instanceRefKlass and instanceMirrorKlass
coleenp
parents:
6725
diff
changeset
|
336 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
|
337 int size = oop_size(obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
338 InstanceKlass::oop_update_pointers(cm, obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
339 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
340 // Follow the klass field in the mirror. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
341 Klass* klass = java_lang_Class::as_Klass(obj); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
342 if (klass != NULL) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
343 PSParallelCompact::adjust_klass(cm, klass); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
344 } else { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
345 // 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
|
346 // 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
|
347 // roots in Universe::oops_do. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4009
diff
changeset
|
348 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
|
349 } |
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 } |