502 } |
502 } |
503 |
503 |
504 oop InstanceKlass::init_lock() const { |
504 oop InstanceKlass::init_lock() const { |
505 // return the init lock from the mirror |
505 // return the init lock from the mirror |
506 oop lock = java_lang_Class::init_lock(java_mirror()); |
506 oop lock = java_lang_Class::init_lock(java_mirror()); |
|
507 // Prevent reordering with any access of initialization state |
|
508 OrderAccess::loadload(); |
507 assert((oop)lock != NULL || !is_not_initialized(), // initialized or in_error state |
509 assert((oop)lock != NULL || !is_not_initialized(), // initialized or in_error state |
508 "only fully initialized state can have a null lock"); |
510 "only fully initialized state can have a null lock"); |
509 return lock; |
511 return lock; |
510 } |
512 } |
511 |
513 |