equal
deleted
inserted
replaced
434 |
434 |
435 void InstanceKlass::eager_initialize_impl() { |
435 void InstanceKlass::eager_initialize_impl() { |
436 EXCEPTION_MARK; |
436 EXCEPTION_MARK; |
437 HandleMark hm(THREAD); |
437 HandleMark hm(THREAD); |
438 Handle h_init_lock(THREAD, init_lock()); |
438 Handle h_init_lock(THREAD, init_lock()); |
439 ObjectLocker ol(h_init_lock, THREAD, init_lock() != NULL); |
439 ObjectLocker ol(h_init_lock, THREAD, h_init_lock() != NULL); |
440 |
440 |
441 // abort if someone beat us to the initialization |
441 // abort if someone beat us to the initialization |
442 if (!is_not_initialized()) return; // note: not equivalent to is_initialized() |
442 if (!is_not_initialized()) return; // note: not equivalent to is_initialized() |
443 |
443 |
444 ClassState old_state = init_state(); |
444 ClassState old_state = init_state(); |
582 |
582 |
583 // verification & rewriting |
583 // verification & rewriting |
584 { |
584 { |
585 HandleMark hm(THREAD); |
585 HandleMark hm(THREAD); |
586 Handle h_init_lock(THREAD, init_lock()); |
586 Handle h_init_lock(THREAD, init_lock()); |
587 ObjectLocker ol(h_init_lock, THREAD, init_lock() != NULL); |
587 ObjectLocker ol(h_init_lock, THREAD, h_init_lock() != NULL); |
588 // rewritten will have been set if loader constraint error found |
588 // rewritten will have been set if loader constraint error found |
589 // on an earlier link attempt |
589 // on an earlier link attempt |
590 // don't verify or rewrite if already rewritten |
590 // don't verify or rewrite if already rewritten |
591 // |
591 // |
592 |
592 |
708 |
708 |
709 // refer to the JVM book page 47 for description of steps |
709 // refer to the JVM book page 47 for description of steps |
710 // Step 1 |
710 // Step 1 |
711 { |
711 { |
712 Handle h_init_lock(THREAD, init_lock()); |
712 Handle h_init_lock(THREAD, init_lock()); |
713 ObjectLocker ol(h_init_lock, THREAD, init_lock() != NULL); |
713 ObjectLocker ol(h_init_lock, THREAD, h_init_lock() != NULL); |
714 |
714 |
715 Thread *self = THREAD; // it's passed the current thread |
715 Thread *self = THREAD; // it's passed the current thread |
716 |
716 |
717 // Step 2 |
717 // Step 2 |
718 // If we were to use wait() instead of waitInterruptibly() then |
718 // If we were to use wait() instead of waitInterruptibly() then |
844 } |
844 } |
845 |
845 |
846 |
846 |
847 void InstanceKlass::set_initialization_state_and_notify(ClassState state, TRAPS) { |
847 void InstanceKlass::set_initialization_state_and_notify(ClassState state, TRAPS) { |
848 Handle h_init_lock(THREAD, init_lock()); |
848 Handle h_init_lock(THREAD, init_lock()); |
849 if (init_lock() != NULL) { |
849 if (h_init_lock() != NULL) { |
850 ObjectLocker ol(h_init_lock, THREAD); |
850 ObjectLocker ol(h_init_lock, THREAD); |
851 set_init_state(state); |
851 set_init_state(state); |
852 fence_and_clear_init_lock(); |
852 fence_and_clear_init_lock(); |
853 ol.notify_all(CHECK); |
853 ol.notify_all(CHECK); |
854 } else { |
854 } else { |
855 assert(init_lock() != NULL, "The initialization state should never be set twice"); |
855 assert(h_init_lock() != NULL, "The initialization state should never be set twice"); |
856 set_init_state(state); |
856 set_init_state(state); |
857 } |
857 } |
858 } |
858 } |
859 |
859 |
860 // The embedded _implementor field can only record one implementor. |
860 // The embedded _implementor field can only record one implementor. |