292 set_nonstatic_field_size(0); |
292 set_nonstatic_field_size(0); |
293 set_is_marked_dependent(false); |
293 set_is_marked_dependent(false); |
294 set_has_unloaded_dependent(false); |
294 set_has_unloaded_dependent(false); |
295 set_init_state(InstanceKlass::allocated); |
295 set_init_state(InstanceKlass::allocated); |
296 set_init_thread(NULL); |
296 set_init_thread(NULL); |
|
297 set_init_state(allocated); |
297 set_reference_type(rt); |
298 set_reference_type(rt); |
298 set_oop_map_cache(NULL); |
299 set_oop_map_cache(NULL); |
299 set_jni_ids(NULL); |
300 set_jni_ids(NULL); |
300 set_osr_nmethods_head(NULL); |
301 set_osr_nmethods_head(NULL); |
301 set_breakpoints(NULL); |
302 set_breakpoints(NULL); |
976 |
977 |
977 void InstanceKlass::set_initialization_state_and_notify_impl(instanceKlassHandle this_oop, ClassState state, TRAPS) { |
978 void InstanceKlass::set_initialization_state_and_notify_impl(instanceKlassHandle this_oop, ClassState state, TRAPS) { |
978 oop init_lock = this_oop->init_lock(); |
979 oop init_lock = this_oop->init_lock(); |
979 if (init_lock != NULL) { |
980 if (init_lock != NULL) { |
980 ObjectLocker ol(init_lock, THREAD); |
981 ObjectLocker ol(init_lock, THREAD); |
|
982 this_oop->set_init_thread(NULL); // reset _init_thread before changing _init_state |
981 this_oop->set_init_state(state); |
983 this_oop->set_init_state(state); |
982 this_oop->fence_and_clear_init_lock(); |
984 this_oop->fence_and_clear_init_lock(); |
983 ol.notify_all(CHECK); |
985 ol.notify_all(CHECK); |
984 } else { |
986 } else { |
985 assert(init_lock != NULL, "The initialization state should never be set twice"); |
987 assert(init_lock != NULL, "The initialization state should never be set twice"); |
|
988 this_oop->set_init_thread(NULL); // reset _init_thread before changing _init_state |
986 this_oop->set_init_state(state); |
989 this_oop->set_init_state(state); |
987 } |
990 } |
988 } |
991 } |
989 |
992 |
990 // The embedded _implementor field can only record one implementor. |
993 // The embedded _implementor field can only record one implementor. |
3600 #ifdef ASSERT |
3603 #ifdef ASSERT |
3601 void InstanceKlass::set_init_state(ClassState state) { |
3604 void InstanceKlass::set_init_state(ClassState state) { |
3602 bool good_state = is_shared() ? (_init_state <= state) |
3605 bool good_state = is_shared() ? (_init_state <= state) |
3603 : (_init_state < state); |
3606 : (_init_state < state); |
3604 assert(good_state || state == allocated, "illegal state transition"); |
3607 assert(good_state || state == allocated, "illegal state transition"); |
|
3608 assert(_init_thread == NULL, "should be cleared before state change"); |
3605 _init_state = (u1)state; |
3609 _init_state = (u1)state; |
3606 } |
3610 } |
3607 #endif |
3611 #endif |
3608 |
3612 |
3609 |
3613 |