--- old/src/share/vm/oops/constantPool.cpp 2017-09-01 15:10:21.305676443 -0400 +++ new/src/share/vm/oops/constantPool.cpp 2017-09-01 15:10:20.001601425 -0400 @@ -284,6 +284,29 @@ set_resolved_references(NULL); } } + +bool ConstantPool::resolve_class_constants(TRAPS) { + assert(DumpSharedSpaces, "used during dump time only"); + // The _cache may be NULL if the _pool_holder klass fails verification + // at dump time due to missing dependencies. + if (cache() == NULL || reference_map() == NULL) { + return true; // nothing to do + } + + constantPoolHandle cp(THREAD, this); + for (int index = 1; index < length(); index++) { // Index 0 is unused + if (tag_at(index).is_string()) { + Symbol* sym = cp->unresolved_string_at(index); + // Look up only. Only resolve references to already interned strings. + oop str = StringTable::lookup(sym); + if (str != NULL) { + int cache_index = cp->cp_to_object_index(index); + cp->string_at_put(index, cache_index, str); + } + } + } + return true; +} #endif // CDS support. Create a new resolved_references array. @@ -712,22 +735,6 @@ } } -bool ConstantPool::resolve_class_constants(TRAPS) { - constantPoolHandle cp(THREAD, this); - for (int index = 1; index < length(); index++) { // Index 0 is unused - if (tag_at(index).is_string()) { - Symbol* sym = cp->unresolved_string_at(index); - // Look up only. Only resolve references to already interned strings. - oop str = StringTable::lookup(sym); - if (str != NULL) { - int cache_index = cp->cp_to_object_index(index); - cp->string_at_put(index, cache_index, str); - } - } - } - return true; -} - Symbol* ConstantPool::exception_message(const constantPoolHandle& this_cp, int which, constantTag tag, oop pending_exception) { // Dig out the detailed message to reuse if possible Symbol* message = java_lang_Throwable::detail_message(pending_exception);