423 }
424 current->set_next_sibling(sibling);
425 if (sibling != NULL) {
426 stack.push(sibling);
427 }
428
429 // Clean the implementors list and method data.
430 if (clean_alive_klasses && current->is_instance_klass()) {
431 InstanceKlass* ik = InstanceKlass::cast(current);
432 ik->clean_weak_instanceklass_links(is_alive);
433
434 // JVMTI RedefineClasses creates previous versions that are not in
435 // the class hierarchy, so process them here.
436 while ((ik = ik->previous_versions()) != NULL) {
437 ik->clean_weak_instanceklass_links(is_alive);
438 }
439 }
440 }
441 }
442
443 void Klass::klass_update_barrier_set(oop v) {
444 record_modified_oops();
445 }
446
447 // This barrier is used by G1 to remember the old oop values, so
448 // that we don't forget any objects that were live at the snapshot at
449 // the beginning. This function is only used when we write oops into Klasses.
450 void Klass::klass_update_barrier_set_pre(oop* p, oop v) {
451 #if INCLUDE_ALL_GCS
452 if (UseG1GC) {
453 oop obj = *p;
454 if (obj != NULL) {
455 G1SATBCardTableModRefBS::enqueue(obj);
456 }
457 }
458 #endif
459 }
460
461 void Klass::klass_oop_store(oop* p, oop v) {
462 assert(!Universe::heap()->is_in_reserved((void*)p), "Should store pointer into metadata");
463 assert(v == NULL || Universe::heap()->is_in_reserved((void*)v), "Should store pointer to an object");
464
465 // do the store
466 if (always_do_update_barrier) {
467 klass_oop_store((volatile oop*)p, v);
468 } else {
469 klass_update_barrier_set_pre(p, v);
470 *p = v;
471 klass_update_barrier_set(v);
472 }
473 }
474
475 void Klass::klass_oop_store(volatile oop* p, oop v) {
476 assert(!Universe::heap()->is_in_reserved((void*)p), "Should store pointer into metadata");
477 assert(v == NULL || Universe::heap()->is_in_reserved((void*)v), "Should store pointer to an object");
478
479 klass_update_barrier_set_pre((oop*)p, v); // Cast away volatile.
480 OrderAccess::release_store_ptr(p, v);
481 klass_update_barrier_set(v);
482 }
483
484 void Klass::oops_do(OopClosure* cl) {
485 cl->do_oop(&_java_mirror);
486 }
487
488 void Klass::remove_unshareable_info() {
489 assert (DumpSharedSpaces, "only called for DumpSharedSpaces");
490 TRACE_REMOVE_ID(this);
491
492 set_subklass(NULL);
493 set_next_sibling(NULL);
494 // Clear the java mirror
495 set_java_mirror(NULL);
496 set_next_link(NULL);
497
498 // Null out class_loader_data because we don't share that yet.
499 set_class_loader_data(NULL);
500 }
501
|
423 }
424 current->set_next_sibling(sibling);
425 if (sibling != NULL) {
426 stack.push(sibling);
427 }
428
429 // Clean the implementors list and method data.
430 if (clean_alive_klasses && current->is_instance_klass()) {
431 InstanceKlass* ik = InstanceKlass::cast(current);
432 ik->clean_weak_instanceklass_links(is_alive);
433
434 // JVMTI RedefineClasses creates previous versions that are not in
435 // the class hierarchy, so process them here.
436 while ((ik = ik->previous_versions()) != NULL) {
437 ik->clean_weak_instanceklass_links(is_alive);
438 }
439 }
440 }
441 }
442
443 void Klass::klass_oop_store(oop* p, oop v) {
444 assert(!GC::gc()->heap()->is_in_reserved((void*)p), "Should store pointer into metadata");
445 assert(v == NULL || GC::gc()->heap()->is_in_reserved((void*)v), "Should store pointer to an object");
446
447 // do the store
448 oopDesc::bs()->klass_oop_store(p, v);
449 record_modified_oops();
450 }
451
452 void Klass::klass_oop_store(volatile oop* p, oop v) {
453 assert(!GC::gc()->heap()->is_in_reserved((void*)p), "Should store pointer into metadata");
454 assert(v == NULL || GC::gc()->heap()->is_in_reserved((void*)v), "Should store pointer to an object");
455
456 oopDesc::bs()->klass_oop_store(p, v);
457 record_modified_oops();
458 }
459
460 void Klass::oops_do(OopClosure* cl) {
461 cl->do_oop(&_java_mirror);
462 }
463
464 void Klass::remove_unshareable_info() {
465 assert (DumpSharedSpaces, "only called for DumpSharedSpaces");
466 TRACE_REMOVE_ID(this);
467
468 set_subklass(NULL);
469 set_next_sibling(NULL);
470 // Clear the java mirror
471 set_java_mirror(NULL);
472 set_next_link(NULL);
473
474 // Null out class_loader_data because we don't share that yet.
475 set_class_loader_data(NULL);
476 }
477
|