< prev index next >

src/hotspot/share/memory/universe.cpp

Print this page


 496     _mirrors[T_INT]     = _int_mirror;
 497     _mirrors[T_FLOAT]   = _float_mirror;
 498     _mirrors[T_DOUBLE]  = _double_mirror;
 499     _mirrors[T_BYTE]    = _byte_mirror;
 500     _mirrors[T_BOOLEAN] = _bool_mirror;
 501     _mirrors[T_CHAR]    = _char_mirror;
 502     _mirrors[T_LONG]    = _long_mirror;
 503     _mirrors[T_SHORT]   = _short_mirror;
 504     _mirrors[T_VOID]    = _void_mirror;
 505   //_mirrors[T_OBJECT]  = _object_klass->java_mirror();
 506   //_mirrors[T_ARRAY]   = _object_klass->java_mirror();
 507 }
 508 
 509 void Universe::fixup_mirrors(TRAPS) {
 510   // Bootstrap problem: all classes gets a mirror (java.lang.Class instance) assigned eagerly,
 511   // but we cannot do that for classes created before java.lang.Class is loaded. Here we simply
 512   // walk over permanent objects created so far (mostly classes) and fixup their mirrors. Note
 513   // that the number of objects allocated at this point is very small.
 514   assert(SystemDictionary::Class_klass_loaded(), "java.lang.Class should be loaded");
 515   HandleMark hm(THREAD);


 516   // Cache the start of the static fields
 517   InstanceMirrorKlass::init_offset_of_static_fields();

 518 
 519   GrowableArray <Klass*>* list = java_lang_Class::fixup_mirror_list();
 520   int list_length = list->length();
 521   for (int i = 0; i < list_length; i++) {
 522     Klass* k = list->at(i);
 523     assert(k->is_klass(), "List should only hold classes");
 524     EXCEPTION_MARK;
 525     java_lang_Class::fixup_mirror(k, CATCH);
 526   }
 527   delete java_lang_Class::fixup_mirror_list();
 528   java_lang_Class::set_fixup_mirror_list(NULL);
 529 }
 530 
 531 #define assert_pll_locked(test) \
 532   assert(Heap_lock->test(), "Reference pending list access requires lock")
 533 
 534 #define assert_pll_ownership() assert_pll_locked(owned_by_self)
 535 
 536 oop Universe::reference_pending_list() {
 537   if (Thread::current()->is_VM_thread()) {




 496     _mirrors[T_INT]     = _int_mirror;
 497     _mirrors[T_FLOAT]   = _float_mirror;
 498     _mirrors[T_DOUBLE]  = _double_mirror;
 499     _mirrors[T_BYTE]    = _byte_mirror;
 500     _mirrors[T_BOOLEAN] = _bool_mirror;
 501     _mirrors[T_CHAR]    = _char_mirror;
 502     _mirrors[T_LONG]    = _long_mirror;
 503     _mirrors[T_SHORT]   = _short_mirror;
 504     _mirrors[T_VOID]    = _void_mirror;
 505   //_mirrors[T_OBJECT]  = _object_klass->java_mirror();
 506   //_mirrors[T_ARRAY]   = _object_klass->java_mirror();
 507 }
 508 
 509 void Universe::fixup_mirrors(TRAPS) {
 510   // Bootstrap problem: all classes gets a mirror (java.lang.Class instance) assigned eagerly,
 511   // but we cannot do that for classes created before java.lang.Class is loaded. Here we simply
 512   // walk over permanent objects created so far (mostly classes) and fixup their mirrors. Note
 513   // that the number of objects allocated at this point is very small.
 514   assert(SystemDictionary::Class_klass_loaded(), "java.lang.Class should be loaded");
 515   HandleMark hm(THREAD);
 516 
 517   if (!UseSharedSpaces) {
 518     // Cache the start of the static fields
 519     InstanceMirrorKlass::init_offset_of_static_fields();
 520   }
 521 
 522   GrowableArray <Klass*>* list = java_lang_Class::fixup_mirror_list();
 523   int list_length = list->length();
 524   for (int i = 0; i < list_length; i++) {
 525     Klass* k = list->at(i);
 526     assert(k->is_klass(), "List should only hold classes");
 527     EXCEPTION_MARK;
 528     java_lang_Class::fixup_mirror(k, CATCH);
 529   }
 530   delete java_lang_Class::fixup_mirror_list();
 531   java_lang_Class::set_fixup_mirror_list(NULL);
 532 }
 533 
 534 #define assert_pll_locked(test) \
 535   assert(Heap_lock->test(), "Reference pending list access requires lock")
 536 
 537 #define assert_pll_ownership() assert_pll_locked(owned_by_self)
 538 
 539 oop Universe::reference_pending_list() {
 540   if (Thread::current()->is_VM_thread()) {


< prev index next >