< prev index next >
src/share/vm/oops/instanceKlass.cpp
Print this page
rev 9040 : 8225141: Better handling of classes in error state in fast class initialization checks
Reviewed-by: dlong, dholmes
*** 292,301 ****
--- 292,302 ----
set_nonstatic_field_size(0);
set_is_marked_dependent(false);
set_has_unloaded_dependent(false);
set_init_state(InstanceKlass::allocated);
set_init_thread(NULL);
+ set_init_state(allocated);
set_reference_type(rt);
set_oop_map_cache(NULL);
set_jni_ids(NULL);
set_osr_nmethods_head(NULL);
set_breakpoints(NULL);
*** 976,990 ****
--- 977,993 ----
void InstanceKlass::set_initialization_state_and_notify_impl(instanceKlassHandle this_oop, ClassState state, TRAPS) {
oop init_lock = this_oop->init_lock();
if (init_lock != NULL) {
ObjectLocker ol(init_lock, THREAD);
+ this_oop->set_init_thread(NULL); // reset _init_thread before changing _init_state
this_oop->set_init_state(state);
this_oop->fence_and_clear_init_lock();
ol.notify_all(CHECK);
} else {
assert(init_lock != NULL, "The initialization state should never be set twice");
+ this_oop->set_init_thread(NULL); // reset _init_thread before changing _init_state
this_oop->set_init_state(state);
}
}
// The embedded _implementor field can only record one implementor.
*** 3600,3609 ****
--- 3603,3613 ----
#ifdef ASSERT
void InstanceKlass::set_init_state(ClassState state) {
bool good_state = is_shared() ? (_init_state <= state)
: (_init_state < state);
assert(good_state || state == allocated, "illegal state transition");
+ set_initialization_state_and_notify_implassert(_init_thread == NULL, "should be cleared before state change");
_init_state = (u1)state;
}
#endif
< prev index next >