src/share/vm/oops/constantPoolKlass.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7105305 Sdiff src/share/vm/oops

src/share/vm/oops/constantPoolKlass.cpp

Print this page




 515 
 516 
 517 void constantPoolKlass::oop_set_partially_loaded(oop obj) {
 518   assert(obj->is_constantPool(), "object must be constant pool");
 519   constantPoolOop cp = constantPoolOop(obj);
 520   assert(cp->pool_holder() == NULL, "just checking");
 521   cp->set_pool_holder((klassOop) cp);   // Temporarily set pool holder to point to self
 522 }
 523 
 524 #ifndef PRODUCT
 525 // CompileTheWorld support. Preload all classes loaded references in the passed in constantpool
 526 void constantPoolKlass::preload_and_initialize_all_classes(oop obj, TRAPS) {
 527   guarantee(obj->is_constantPool(), "object must be constant pool");
 528   constantPoolHandle cp(THREAD, (constantPoolOop)obj);
 529   guarantee(!cp->partially_loaded(), "must be fully loaded");
 530 
 531   for (int i = 0; i< cp->length();  i++) {
 532     if (cp->tag_at(i).is_unresolved_klass()) {
 533       // This will force loading of the class
 534       klassOop klass = cp->klass_at(i, CHECK);
 535       if (klass->is_instance()) {
 536         // Force initialization of class
 537         instanceKlass::cast(klass)->initialize(CHECK);
 538       }
 539     }
 540   }
 541 }
 542 
 543 #endif


 515 
 516 
 517 void constantPoolKlass::oop_set_partially_loaded(oop obj) {
 518   assert(obj->is_constantPool(), "object must be constant pool");
 519   constantPoolOop cp = constantPoolOop(obj);
 520   assert(cp->pool_holder() == NULL, "just checking");
 521   cp->set_pool_holder((klassOop) cp);   // Temporarily set pool holder to point to self
 522 }
 523 
 524 #ifndef PRODUCT
 525 // CompileTheWorld support. Preload all classes loaded references in the passed in constantpool
 526 void constantPoolKlass::preload_and_initialize_all_classes(oop obj, TRAPS) {
 527   guarantee(obj->is_constantPool(), "object must be constant pool");
 528   constantPoolHandle cp(THREAD, (constantPoolOop)obj);
 529   guarantee(!cp->partially_loaded(), "must be fully loaded");
 530 
 531   for (int i = 0; i< cp->length();  i++) {
 532     if (cp->tag_at(i).is_unresolved_klass()) {
 533       // This will force loading of the class
 534       klassOop klass = cp->klass_at(i, CHECK);
 535       if (klass->klass_part()->oop_is_instance()) {
 536         // Force initialization of class
 537         instanceKlass::cast(klass)->initialize(CHECK);
 538       }
 539     }
 540   }
 541 }
 542 
 543 #endif
src/share/vm/oops/constantPoolKlass.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File