--- a/src/hotspot/share/oops/constantPool.cpp Wed Sep 27 17:55:20 2017 -0400
+++ b/src/hotspot/share/oops/constantPool.cpp Wed Sep 27 20:40:33 2017 -0400
@@ -294,6 +294,28 @@
set_resolved_references(NULL);
}
}
+
+void 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; // 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);
+ }
+ }
+ }
+}
#endif
// CDS support. Create a new resolved_references array.
@@ -722,22 +744,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);