< prev index next >

src/share/vm/oops/klass.cpp

Print this page




 471       ik->clean_weak_instanceklass_links(is_alive);
 472 
 473       // JVMTI RedefineClasses creates previous versions that are not in
 474       // the class hierarchy, so process them here.
 475       while ((ik = ik->previous_versions()) != NULL) {
 476         ik->clean_weak_instanceklass_links(is_alive);
 477       }
 478     }
 479   }
 480 }
 481 
 482 void Klass::klass_update_barrier_set(oop v) {
 483   record_modified_oops();
 484 }
 485 
 486 // This barrier is used by G1 to remember the old oop values, so
 487 // that we don't forget any objects that were live at the snapshot at
 488 // the beginning. This function is only used when we write oops into Klasses.
 489 void Klass::klass_update_barrier_set_pre(oop* p, oop v) {
 490 #if INCLUDE_ALL_GCS
 491   if (UseG1GC) {
 492     oop obj = *p;
 493     if (obj != NULL) {
 494       G1SATBCardTableModRefBS::enqueue(obj);
 495     }
 496   }
 497 #endif
 498 }
 499 
 500 void Klass::klass_oop_store(oop* p, oop v) {
 501   assert(!Universe::heap()->is_in_reserved((void*)p), "Should store pointer into metadata");
 502   assert(v == NULL || Universe::heap()->is_in_reserved((void*)v), "Should store pointer to an object");
 503 
 504   // do the store
 505   if (always_do_update_barrier) {
 506     klass_oop_store((volatile oop*)p, v);
 507   } else {
 508     klass_update_barrier_set_pre(p, v);
 509     *p = v;
 510     klass_update_barrier_set(v);
 511   }




 471       ik->clean_weak_instanceklass_links(is_alive);
 472 
 473       // JVMTI RedefineClasses creates previous versions that are not in
 474       // the class hierarchy, so process them here.
 475       while ((ik = ik->previous_versions()) != NULL) {
 476         ik->clean_weak_instanceklass_links(is_alive);
 477       }
 478     }
 479   }
 480 }
 481 
 482 void Klass::klass_update_barrier_set(oop v) {
 483   record_modified_oops();
 484 }
 485 
 486 // This barrier is used by G1 to remember the old oop values, so
 487 // that we don't forget any objects that were live at the snapshot at
 488 // the beginning. This function is only used when we write oops into Klasses.
 489 void Klass::klass_update_barrier_set_pre(oop* p, oop v) {
 490 #if INCLUDE_ALL_GCS
 491   if (UseG1GC || (UseShenandoahGC && ShenandoahSATBBarrier)) {
 492     oop obj = *p;
 493     if (obj != NULL) {
 494       G1SATBCardTableModRefBS::enqueue(obj);
 495     }
 496   }
 497 #endif
 498 }
 499 
 500 void Klass::klass_oop_store(oop* p, oop v) {
 501   assert(!Universe::heap()->is_in_reserved((void*)p), "Should store pointer into metadata");
 502   assert(v == NULL || Universe::heap()->is_in_reserved((void*)v), "Should store pointer to an object");
 503 
 504   // do the store
 505   if (always_do_update_barrier) {
 506     klass_oop_store((volatile oop*)p, v);
 507   } else {
 508     klass_update_barrier_set_pre(p, v);
 509     *p = v;
 510     klass_update_barrier_set(v);
 511   }


< prev index next >