Mercurial > hg > graal-compiler
annotate src/share/vm/oops/instanceMirrorKlass.cpp @ 4316:b4b16e4e043f
Fix eager resolving for class constants
author | Peter Hofer <peter.hofer@jku.at> |
---|---|
date | Mon, 23 Jan 2012 14:35:29 +0100 |
parents | e5928e7dab26 |
children | da91efe96a93 |
rev | line source |
---|---|
2376
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
1 /* |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
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 "memory/permGen.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
33 #include "oops/instanceKlass.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
34 #include "oops/instanceMirrorKlass.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
35 #include "oops/instanceOop.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
36 #include "oops/oop.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
37 #include "oops/symbol.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
38 #include "runtime/handles.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
39 #ifndef SERIALGC |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
40 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
41 #include "gc_implementation/g1/g1OopClosures.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
42 #include "gc_implementation/g1/g1RemSet.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
43 #include "gc_implementation/g1/heapRegionSeq.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
44 #include "gc_implementation/parNew/parOopClosures.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
45 #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
46 #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
47 #include "oops/oop.pcgc.inline.hpp" |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
48 #endif |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
49 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
50 int instanceMirrorKlass::_offset_of_static_fields = 0; |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
51 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
52 #ifdef ASSERT |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
53 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
|
54 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
|
55 if (!oopDesc::is_null(heap_oop)) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
56 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
|
57 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
|
58 } |
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 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
|
61 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
|
62 if (!oopDesc::is_null(heap_oop)) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
63 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
|
64 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
|
65 } |
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 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
|
68 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
|
69 if (!oopDesc::is_null(heap_oop)) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
70 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
|
71 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
|
72 } |
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 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
|
75 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
76 #else |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
77 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
|
78 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
|
79 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
|
80 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
|
81 #endif // ASSERT |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
82 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
83 #define InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
84 T, start_p, count, do_oop, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
85 assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
86 { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
87 T* p = (T*)(start_p); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
88 T* const end = p + (count); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
89 while (p < end) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
90 (assert_fn)(p); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
91 do_oop; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
92 ++p; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
93 } \ |
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 #define InstanceMirrorKlass_SPECIALIZED_BOUNDED_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
97 T, start_p, count, low, high, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
98 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
99 { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
100 T* const l = (T*)(low); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
101 T* const h = (T*)(high); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
102 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
|
103 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
|
104 "bounded region must be properly aligned"); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
105 T* p = (T*)(start_p); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
106 T* end = p + (count); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
107 if (p < l) p = l; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
108 if (end > h) end = h; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
109 while (p < end) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
110 (assert_fn)(p); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
111 do_oop; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
112 ++p; \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
113 } \ |
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 #define InstanceMirrorKlass_OOP_ITERATE(start_p, count, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
118 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
119 { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
120 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
121 InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE(narrowOop, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
122 start_p, count, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
123 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
124 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
125 InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE(oop, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
126 start_p, count, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
127 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
128 } \ |
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 // 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
|
132 // 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
|
133 // flag. |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
134 #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
|
135 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
136 { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
137 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
138 InstanceMirrorKlass_SPECIALIZED_BOUNDED_OOP_ITERATE(narrowOop, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
139 start_p, count, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
140 low, high, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
141 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
142 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
143 InstanceMirrorKlass_SPECIALIZED_BOUNDED_OOP_ITERATE(oop, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
144 start_p, count, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
145 low, high, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
146 do_oop, assert_fn) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
147 } \ |
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 void instanceMirrorKlass::oop_follow_contents(oop obj) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
152 instanceKlass::oop_follow_contents(obj); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
153 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
154 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
|
155 MarkSweep::mark_and_push(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
156 assert_is_in_closed_subset) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
157 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
158 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
159 #ifndef SERIALGC |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
160 void instanceMirrorKlass::oop_follow_contents(ParCompactionManager* cm, |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
161 oop obj) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
162 instanceKlass::oop_follow_contents(cm, obj); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
163 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
164 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
|
165 PSParallelCompact::mark_and_push(cm, p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
166 assert_is_in) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
167 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
168 #endif // SERIALGC |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
169 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
170 int instanceMirrorKlass::oop_adjust_pointers(oop obj) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
171 int size = oop_size(obj); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
172 instanceKlass::oop_adjust_pointers(obj); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
173 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
174 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
|
175 MarkSweep::adjust_pointer(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
176 assert_nothing) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
177 return size; |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
178 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
179 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
180 #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
|
181 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
182 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
|
183 (closure)->do_oop##nv_suffix(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
184 assert_is_in_closed_subset) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
185 return oop_size(obj); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
186 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
187 #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
|
188 InstanceMirrorKlass_BOUNDED_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 mr.start(), mr.end(), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
191 (closure)->do_oop##nv_suffix(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
192 assert_is_in_closed_subset) \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
193 return oop_size(obj); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
194 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
195 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
196 // Macro to define instanceMirrorKlass::oop_oop_iterate for virtual/nonvirtual for |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
197 // 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
|
198 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
199 #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
|
200 \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
201 int instanceMirrorKlass:: \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
202 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
|
203 /* Get size before changing pointers */ \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
204 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
|
205 \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
206 instanceKlass::oop_oop_iterate##nv_suffix(obj, closure); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
207 \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
208 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
209 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
|
210 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
211 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
|
212 } \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
213 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
214 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
215 #ifndef SERIALGC |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
216 #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
|
217 \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
218 int instanceMirrorKlass:: \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
219 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
|
220 /* Get size before changing pointers */ \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
221 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
|
222 \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
223 instanceKlass::oop_oop_iterate_backwards##nv_suffix(obj, closure); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
224 \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
225 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
226 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
|
227 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
228 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
|
229 } \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
230 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
231 #endif // !SERIALGC |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
232 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
233 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
234 #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
|
235 \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
236 int instanceMirrorKlass:: \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
237 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
|
238 OopClosureType* closure, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
239 MemRegion mr) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
240 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
|
241 \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
242 instanceKlass::oop_oop_iterate##nv_suffix##_m(obj, closure, mr); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
243 if (UseCompressedOops) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
244 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
|
245 } else { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
246 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
|
247 } \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
248 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
249 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
250 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
|
251 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
252 #ifndef SERIALGC |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
253 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
|
254 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
255 #endif // SERIALGC |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
256 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
|
257 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
|
258 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
259 #ifndef SERIALGC |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
260 void instanceMirrorKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
261 instanceKlass::oop_push_contents(pm, obj); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
262 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
263 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
|
264 if (PSScavenge::should_scavenge(p)) { \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
265 pm->claim_or_forward_depth(p); \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
266 }, \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
267 assert_nothing ) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
268 } |
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 int instanceMirrorKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
271 instanceKlass::oop_update_pointers(cm, obj); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
272 InstanceMirrorKlass_OOP_ITERATE( \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
273 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
|
274 PSParallelCompact::adjust_pointer(p), \ |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
275 assert_nothing) |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
276 return oop_size(obj); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
277 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
278 #endif // SERIALGC |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
279 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
280 int instanceMirrorKlass::instance_size(KlassHandle k) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
281 if (k() != NULL && k->oop_is_instance()) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
282 return align_object_size(size_helper() + instanceKlass::cast(k())->static_field_size()); |
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 return size_helper(); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
285 } |
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 instanceOop instanceMirrorKlass::allocate_instance(KlassHandle k, TRAPS) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
288 // Query before forming handle. |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
289 int size = instance_size(k); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
290 KlassHandle h_k(THREAD, as_klassOop()); |
4009 | 291 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
|
292 return i; |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
293 } |
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 int instanceMirrorKlass::oop_size(oop obj) const { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
296 return java_lang_Class::oop_size(obj); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
297 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
298 |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
299 int instanceMirrorKlass::compute_static_oop_field_count(oop obj) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
300 klassOop k = java_lang_Class::as_klassOop(obj); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
301 if (k != NULL && k->klass_part()->oop_is_instance()) { |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
302 return instanceKlass::cast(k)->static_oop_field_count(); |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
303 } |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
304 return 0; |
c7f3d0b4570f
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
diff
changeset
|
305 } |