806 // If another thread resolved the reference, this is a race condition. This |
806 // If another thread resolved the reference, this is a race condition. This |
807 // thread may have had a security manager or something temporary. |
807 // thread may have had a security manager or something temporary. |
808 // This doesn't deterministically get an error. So why do we save this? |
808 // This doesn't deterministically get an error. So why do we save this? |
809 // We save this because jvmti can add classes to the bootclass path after |
809 // We save this because jvmti can add classes to the bootclass path after |
810 // this error, so it needs to get the same error if the error is first. |
810 // this error, so it needs to get the same error if the error is first. |
811 jbyte old_tag = Atomic::cmpxchg((jbyte)error_tag, |
811 jbyte old_tag = Atomic::cmpxchg((jbyte*)this_cp->tag_addr_at(which), |
812 (jbyte*)this_cp->tag_addr_at(which), (jbyte)tag.value()); |
812 (jbyte)tag.value(), |
|
813 (jbyte)error_tag); |
813 if (old_tag != error_tag && old_tag != tag.value()) { |
814 if (old_tag != error_tag && old_tag != tag.value()) { |
814 // MethodHandles and MethodType doesn't change to resolved version. |
815 // MethodHandles and MethodType doesn't change to resolved version. |
815 assert(this_cp->tag_at(which).is_klass(), "Wrong tag value"); |
816 assert(this_cp->tag_at(which).is_klass(), "Wrong tag value"); |
816 // Forget the exception and use the resolved class. |
817 // Forget the exception and use the resolved class. |
817 CLEAR_PENDING_EXCEPTION; |
818 CLEAR_PENDING_EXCEPTION; |