515 return is_linked(); |
515 return is_linked(); |
516 } |
516 } |
517 |
517 |
518 bool InstanceKlass::link_class_impl( |
518 bool InstanceKlass::link_class_impl( |
519 instanceKlassHandle this_k, bool throw_verifyerror, TRAPS) { |
519 instanceKlassHandle this_k, bool throw_verifyerror, TRAPS) { |
520 // check for error state. |
520 if (DumpSharedSpaces && this_k->is_in_error_state()) { |
521 // This is checking for the wrong state. If the state is initialization_error, |
521 // This is for CDS dumping phase only -- we use the in_error_state to indicate that |
522 // then this class *was* linked. The CDS code does a try_link_class and uses |
522 // the class has failed verification. Throwing the NoClassDefFoundError here is just |
523 // initialization_error to mark classes to not include in the archive during |
523 // a convenient way to stop repeat attempts to verify the same (bad) class. |
524 // DumpSharedSpaces. This should be removed when the CDS bug is fixed. |
524 // |
525 if (this_k->is_in_error_state()) { |
525 // Note that the NoClassDefFoundError is not part of the JLS, and should not be thrown |
|
526 // if we are executing Java code. This is not a problem for CDS dumping phase since |
|
527 // it doesn't execute any Java code. |
526 ResourceMark rm(THREAD); |
528 ResourceMark rm(THREAD); |
527 THROW_MSG_(vmSymbols::java_lang_NoClassDefFoundError(), |
529 THROW_MSG_(vmSymbols::java_lang_NoClassDefFoundError(), |
528 this_k->external_name(), false); |
530 this_k->external_name(), false); |
529 } |
531 } |
530 // return if already verified |
532 // return if already verified |