1 /* |
1 /* |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
351 |
351 |
352 klassKlass::oop_update_pointers(cm, obj); |
352 klassKlass::oop_update_pointers(cm, obj); |
353 return ik->object_size(); |
353 return ik->object_size(); |
354 } |
354 } |
355 |
355 |
356 int instanceKlassKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, |
|
357 HeapWord* beg_addr, |
|
358 HeapWord* end_addr) { |
|
359 assert(obj->is_klass(),"must be a klass"); |
|
360 assert(klassOop(obj)->klass_part()->oop_is_instance_slow(), |
|
361 "must be instance klass"); |
|
362 |
|
363 instanceKlass* ik = instanceKlass::cast(klassOop(obj)); |
|
364 ik->update_static_fields(beg_addr, end_addr); |
|
365 ik->vtable()->oop_update_pointers(cm, beg_addr, end_addr); |
|
366 ik->itable()->oop_update_pointers(cm, beg_addr, end_addr); |
|
367 |
|
368 oop* const beg_oop = MAX2((oop*)beg_addr, ik->oop_block_beg()); |
|
369 oop* const end_oop = MIN2((oop*)end_addr, ik->oop_block_end()); |
|
370 for (oop* cur_oop = beg_oop; cur_oop < end_oop; ++cur_oop) { |
|
371 PSParallelCompact::adjust_pointer(cur_oop); |
|
372 } |
|
373 |
|
374 // The oop_map_cache, jni_ids and jni_id_map are allocated from the C heap, |
|
375 // and so don't lie within any 'Chunk' boundaries. Update them when the |
|
376 // lowest addressed oop in the instanceKlass 'oop_block' is updated. |
|
377 if (beg_oop == ik->oop_block_beg()) { |
|
378 OopClosure* closure = PSParallelCompact::adjust_root_pointer_closure(); |
|
379 iterate_c_heap_oops(ik, closure); |
|
380 } |
|
381 |
|
382 klassKlass::oop_update_pointers(cm, obj, beg_addr, end_addr); |
|
383 return ik->object_size(); |
|
384 } |
|
385 #endif // SERIALGC |
356 #endif // SERIALGC |
386 |
357 |
387 klassOop |
358 klassOop |
388 instanceKlassKlass::allocate_instance_klass(int vtable_len, int itable_len, |
359 instanceKlassKlass::allocate_instance_klass(int vtable_len, int itable_len, |
389 int static_field_size, |
360 int static_field_size, |