8213259: [AOT] AOTing java.base fails with "java.lang.AssertionError: no fingerprint for Ljdk/internal/event/Event"
authordlong
Mon, 26 Nov 2018 22:49:57 -0800
changeset 52692 bffef37beacb
parent 52691 d9f6a700fec9
child 52693 0037ea3c7322
8213259: [AOT] AOTing java.base fails with "java.lang.AssertionError: no fingerprint for Ljdk/internal/event/Event" Reviewed-by: iklam, kvn
src/hotspot/share/classfile/classFileParser.cpp
src/hotspot/share/classfile/klassFactory.cpp
--- a/src/hotspot/share/classfile/classFileParser.cpp	Tue Nov 27 07:54:06 2018 +0100
+++ b/src/hotspot/share/classfile/classFileParser.cpp	Mon Nov 26 22:49:57 2018 -0800
@@ -5521,10 +5521,16 @@
 
   assert(_klass == ik, "invariant");
 
+
+  if (ik->should_store_fingerprint()) {
+    ik->store_fingerprint(_stream->compute_fingerprint());
+  }
+
   ik->set_has_passed_fingerprint_check(false);
   if (UseAOT && ik->supers_have_passed_fingerprint_checks()) {
     uint64_t aot_fp = AOTLoader::get_saved_fingerprint(ik);
-    if (aot_fp != 0 && aot_fp == _stream->compute_fingerprint()) {
+    uint64_t fp = ik->has_stored_fingerprint() ? ik->get_stored_fingerprint() : _stream->compute_fingerprint();
+    if (aot_fp != 0 && aot_fp == fp) {
       // This class matches with a class saved in an AOT library
       ik->set_has_passed_fingerprint_check(true);
     } else {
--- a/src/hotspot/share/classfile/klassFactory.cpp	Tue Nov 27 07:54:06 2018 +0100
+++ b/src/hotspot/share/classfile/klassFactory.cpp	Mon Nov 26 22:49:57 2018 -0800
@@ -231,10 +231,6 @@
     result->set_cached_class_file(cached_class_file);
   }
 
-  if (result->should_store_fingerprint()) {
-    result->store_fingerprint(stream->compute_fingerprint());
-  }
-
   JFR_ONLY(ON_KLASS_CREATION(result, parser, THREAD);)
 
 #if INCLUDE_CDS