Mercurial > hg > graal-compiler
comparison src/share/vm/oops/instanceMirrorKlass.cpp @ 8002:8391fdd36e1f
Merge
author | dlong |
---|---|
date | Sun, 27 Jan 2013 01:07:09 -0800 |
parents | db9981fd3124 |
children | 55a0da3d420b |
comparison
equal
deleted
inserted
replaced
7946:6fbe8a57549d | 8002:8391fdd36e1f |
---|---|
33 #include "oops/instanceMirrorKlass.hpp" | 33 #include "oops/instanceMirrorKlass.hpp" |
34 #include "oops/instanceOop.hpp" | 34 #include "oops/instanceOop.hpp" |
35 #include "oops/oop.inline.hpp" | 35 #include "oops/oop.inline.hpp" |
36 #include "oops/symbol.hpp" | 36 #include "oops/symbol.hpp" |
37 #include "runtime/handles.inline.hpp" | 37 #include "runtime/handles.inline.hpp" |
38 #ifndef SERIALGC | 38 #include "utilities/macros.hpp" |
39 #if INCLUDE_ALL_GCS | |
39 #include "gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp" | 40 #include "gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp" |
40 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" | 41 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" |
41 #include "gc_implementation/g1/g1OopClosures.inline.hpp" | 42 #include "gc_implementation/g1/g1OopClosures.inline.hpp" |
42 #include "gc_implementation/g1/g1RemSet.inline.hpp" | 43 #include "gc_implementation/g1/g1RemSet.inline.hpp" |
43 #include "gc_implementation/g1/heapRegionSeq.inline.hpp" | 44 #include "gc_implementation/g1/heapRegionSeq.inline.hpp" |
44 #include "gc_implementation/parNew/parOopClosures.inline.hpp" | 45 #include "gc_implementation/parNew/parOopClosures.inline.hpp" |
45 #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" | 46 #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" |
46 #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" | 47 #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" |
47 #include "oops/oop.pcgc.inline.hpp" | 48 #include "oops/oop.pcgc.inline.hpp" |
48 #endif | 49 #endif // INCLUDE_ALL_GCS |
49 | 50 |
50 int InstanceMirrorKlass::_offset_of_static_fields = 0; | 51 int InstanceMirrorKlass::_offset_of_static_fields = 0; |
51 | 52 |
52 #ifdef ASSERT | 53 #ifdef ASSERT |
53 template <class T> void assert_is_in(T *p) { | 54 template <class T> void assert_is_in(T *p) { |
166 start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj), \ | 167 start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj), \ |
167 MarkSweep::mark_and_push(p), \ | 168 MarkSweep::mark_and_push(p), \ |
168 assert_is_in_closed_subset) | 169 assert_is_in_closed_subset) |
169 } | 170 } |
170 | 171 |
171 #ifndef SERIALGC | 172 #if INCLUDE_ALL_GCS |
172 void InstanceMirrorKlass::oop_follow_contents(ParCompactionManager* cm, | 173 void InstanceMirrorKlass::oop_follow_contents(ParCompactionManager* cm, |
173 oop obj) { | 174 oop obj) { |
174 InstanceKlass::oop_follow_contents(cm, obj); | 175 InstanceKlass::oop_follow_contents(cm, obj); |
175 | 176 |
176 // Follow the klass field in the mirror. | 177 // Follow the klass field in the mirror. |
187 InstanceMirrorKlass_OOP_ITERATE( \ | 188 InstanceMirrorKlass_OOP_ITERATE( \ |
188 start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj), \ | 189 start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj), \ |
189 PSParallelCompact::mark_and_push(cm, p), \ | 190 PSParallelCompact::mark_and_push(cm, p), \ |
190 assert_is_in) | 191 assert_is_in) |
191 } | 192 } |
192 #endif // SERIALGC | 193 #endif // INCLUDE_ALL_GCS |
193 | 194 |
194 int InstanceMirrorKlass::oop_adjust_pointers(oop obj) { | 195 int InstanceMirrorKlass::oop_adjust_pointers(oop obj) { |
195 int size = oop_size(obj); | 196 int size = oop_size(obj); |
196 InstanceKlass::oop_adjust_pointers(obj); | 197 InstanceKlass::oop_adjust_pointers(obj); |
197 | 198 |
260 } else { \ | 261 } else { \ |
261 InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE_DEFN(oop, nv_suffix); \ | 262 InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE_DEFN(oop, nv_suffix); \ |
262 } \ | 263 } \ |
263 } | 264 } |
264 | 265 |
265 #ifndef SERIALGC | 266 #if INCLUDE_ALL_GCS |
266 #define InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ | 267 #define InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ |
267 \ | 268 \ |
268 int InstanceMirrorKlass:: \ | 269 int InstanceMirrorKlass:: \ |
269 oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \ | 270 oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \ |
270 /* Get size before changing pointers */ \ | 271 /* Get size before changing pointers */ \ |
276 InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE_DEFN(narrowOop, nv_suffix); \ | 277 InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE_DEFN(narrowOop, nv_suffix); \ |
277 } else { \ | 278 } else { \ |
278 InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE_DEFN(oop, nv_suffix); \ | 279 InstanceMirrorKlass_SPECIALIZED_OOP_ITERATE_DEFN(oop, nv_suffix); \ |
279 } \ | 280 } \ |
280 } | 281 } |
281 #endif // !SERIALGC | 282 #endif // INCLUDE_ALL_GCS |
282 | 283 |
283 | 284 |
284 #define InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \ | 285 #define InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \ |
285 \ | 286 \ |
286 int InstanceMirrorKlass:: \ | 287 int InstanceMirrorKlass:: \ |
308 } \ | 309 } \ |
309 } | 310 } |
310 | 311 |
311 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN) | 312 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN) |
312 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN) | 313 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN) |
313 #ifndef SERIALGC | 314 #if INCLUDE_ALL_GCS |
314 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN) | 315 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN) |
315 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN) | 316 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN) |
316 #endif // SERIALGC | 317 #endif // INCLUDE_ALL_GCS |
317 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m) | 318 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m) |
318 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m) | 319 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceMirrorKlass_OOP_OOP_ITERATE_DEFN_m) |
319 | 320 |
320 #ifndef SERIALGC | 321 #if INCLUDE_ALL_GCS |
321 void InstanceMirrorKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { | 322 void InstanceMirrorKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { |
322 // Note that we don't have to follow the mirror -> klass pointer, since all | 323 // Note that we don't have to follow the mirror -> klass pointer, since all |
323 // klasses that are dirty will be scavenged when we iterate over the | 324 // klasses that are dirty will be scavenged when we iterate over the |
324 // ClassLoaderData objects. | 325 // ClassLoaderData objects. |
325 | 326 |
351 start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj),\ | 352 start_of_static_fields(obj), java_lang_Class::static_oop_field_count(obj),\ |
352 PSParallelCompact::adjust_pointer(p), \ | 353 PSParallelCompact::adjust_pointer(p), \ |
353 assert_nothing) | 354 assert_nothing) |
354 return size; | 355 return size; |
355 } | 356 } |
356 #endif // SERIALGC | 357 #endif // INCLUDE_ALL_GCS |
357 | 358 |
358 int InstanceMirrorKlass::instance_size(KlassHandle k) { | 359 int InstanceMirrorKlass::instance_size(KlassHandle k) { |
359 if (k() != NULL && k->oop_is_instance()) { | 360 if (k() != NULL && k->oop_is_instance()) { |
360 return align_object_size(size_helper() + InstanceKlass::cast(k())->static_field_size()); | 361 return align_object_size(size_helper() + InstanceKlass::cast(k())->static_field_size()); |
361 } | 362 } |