< prev index next >

src/hotspot/share/memory/universe.cpp

Print this page




 429     objArrayOop    naked_array = oopFactory::new_objArray(SystemDictionary::Object_klass(), size, CHECK);
 430     objArrayHandle dummy_array(THREAD, naked_array);
 431     int i = 0;
 432     while (i < size) {
 433         // Allocate dummy in old generation
 434       oop dummy = SystemDictionary::Object_klass()->allocate_instance(CHECK);
 435       dummy_array->obj_at_put(i++, dummy);
 436     }
 437     {
 438       // Only modify the global variable inside the mutex.
 439       // If we had a race to here, the other dummy_array instances
 440       // and their elements just get dropped on the floor, which is fine.
 441       MutexLocker ml(FullGCALot_lock);
 442       if (_fullgc_alot_dummy_array == NULL) {
 443         _fullgc_alot_dummy_array = dummy_array();
 444       }
 445     }
 446     assert(i == _fullgc_alot_dummy_array->length(), "just checking");
 447   }
 448   #endif
 449 
 450   // Initialize dependency array for null class loader
 451   ClassLoaderData::the_null_class_loader_data()->init_dependencies(CHECK);
 452 
 453 }
 454 
 455 void Universe::initialize_basic_type_mirrors(TRAPS) {
 456     assert(_int_mirror==NULL, "basic type mirrors already initialized");
 457     _int_mirror     =
 458       java_lang_Class::create_basic_type_mirror("int",    T_INT, CHECK);
 459     _float_mirror   =
 460       java_lang_Class::create_basic_type_mirror("float",  T_FLOAT,   CHECK);
 461     _double_mirror  =
 462       java_lang_Class::create_basic_type_mirror("double", T_DOUBLE,  CHECK);
 463     _byte_mirror    =
 464       java_lang_Class::create_basic_type_mirror("byte",   T_BYTE, CHECK);
 465     _bool_mirror    =
 466       java_lang_Class::create_basic_type_mirror("boolean",T_BOOLEAN, CHECK);
 467     _char_mirror    =
 468       java_lang_Class::create_basic_type_mirror("char",   T_CHAR, CHECK);
 469     _long_mirror    =
 470       java_lang_Class::create_basic_type_mirror("long",   T_LONG, CHECK);
 471     _short_mirror   =
 472       java_lang_Class::create_basic_type_mirror("short",  T_SHORT,   CHECK);




 429     objArrayOop    naked_array = oopFactory::new_objArray(SystemDictionary::Object_klass(), size, CHECK);
 430     objArrayHandle dummy_array(THREAD, naked_array);
 431     int i = 0;
 432     while (i < size) {
 433         // Allocate dummy in old generation
 434       oop dummy = SystemDictionary::Object_klass()->allocate_instance(CHECK);
 435       dummy_array->obj_at_put(i++, dummy);
 436     }
 437     {
 438       // Only modify the global variable inside the mutex.
 439       // If we had a race to here, the other dummy_array instances
 440       // and their elements just get dropped on the floor, which is fine.
 441       MutexLocker ml(FullGCALot_lock);
 442       if (_fullgc_alot_dummy_array == NULL) {
 443         _fullgc_alot_dummy_array = dummy_array();
 444       }
 445     }
 446     assert(i == _fullgc_alot_dummy_array->length(), "just checking");
 447   }
 448   #endif




 449 }
 450 
 451 void Universe::initialize_basic_type_mirrors(TRAPS) {
 452     assert(_int_mirror==NULL, "basic type mirrors already initialized");
 453     _int_mirror     =
 454       java_lang_Class::create_basic_type_mirror("int",    T_INT, CHECK);
 455     _float_mirror   =
 456       java_lang_Class::create_basic_type_mirror("float",  T_FLOAT,   CHECK);
 457     _double_mirror  =
 458       java_lang_Class::create_basic_type_mirror("double", T_DOUBLE,  CHECK);
 459     _byte_mirror    =
 460       java_lang_Class::create_basic_type_mirror("byte",   T_BYTE, CHECK);
 461     _bool_mirror    =
 462       java_lang_Class::create_basic_type_mirror("boolean",T_BOOLEAN, CHECK);
 463     _char_mirror    =
 464       java_lang_Class::create_basic_type_mirror("char",   T_CHAR, CHECK);
 465     _long_mirror    =
 466       java_lang_Class::create_basic_type_mirror("long",   T_LONG, CHECK);
 467     _short_mirror   =
 468       java_lang_Class::create_basic_type_mirror("short",  T_SHORT,   CHECK);


< prev index next >