comparison src/share/vm/oops/instanceKlass.cpp @ 4739:52b5d32fbfaf

7117052: instanceKlass::_init_state can be u1 type Summary: Change instanceKlass::_init_state field to u1 type. Reviewed-by: bdelsart, coleenp, dholmes, phh, never Contributed-by: Jiangli Zhou <jiangli.zhou@oracle.com>
author coleenp
date Tue, 06 Dec 2011 18:28:51 -0500
parents 436b4a3231bf
children 33df1aeaebbf a735aec54ea4 f7c4174b33ba
comparison
equal deleted inserted replaced
4738:da4dd142ea01 4739:52b5d32fbfaf
206 ObjectLocker ol(this_oop, THREAD); 206 ObjectLocker ol(this_oop, THREAD);
207 207
208 // abort if someone beat us to the initialization 208 // abort if someone beat us to the initialization
209 if (!this_oop->is_not_initialized()) return; // note: not equivalent to is_initialized() 209 if (!this_oop->is_not_initialized()) return; // note: not equivalent to is_initialized()
210 210
211 ClassState old_state = this_oop->_init_state; 211 ClassState old_state = this_oop->init_state();
212 link_class_impl(this_oop, true, THREAD); 212 link_class_impl(this_oop, true, THREAD);
213 if (HAS_PENDING_EXCEPTION) { 213 if (HAS_PENDING_EXCEPTION) {
214 CLEAR_PENDING_EXCEPTION; 214 CLEAR_PENDING_EXCEPTION;
215 // Abort if linking the class throws an exception. 215 // Abort if linking the class throws an exception.
216 216
2477 #ifdef ASSERT 2477 #ifdef ASSERT
2478 void instanceKlass::set_init_state(ClassState state) { 2478 void instanceKlass::set_init_state(ClassState state) {
2479 bool good_state = as_klassOop()->is_shared() ? (_init_state <= state) 2479 bool good_state = as_klassOop()->is_shared() ? (_init_state <= state)
2480 : (_init_state < state); 2480 : (_init_state < state);
2481 assert(good_state || state == allocated, "illegal state transition"); 2481 assert(good_state || state == allocated, "illegal state transition");
2482 _init_state = state; 2482 _init_state = (u1)state;
2483 } 2483 }
2484 #endif 2484 #endif
2485 2485
2486 2486
2487 // RedefineClasses() support for previous versions: 2487 // RedefineClasses() support for previous versions: