8181823: [AOT] jaotc doesn't work with Graal
Add new flag to indicate when to calculate class fingerprint
Reviewed-by: iklam, iveresov
diff --git a/hotspot/src/jdk.internal.vm.compiler/share/classes/module-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/module-info.java
index a3f266d..3410829 100644
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/module-info.java
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/module-info.java
@@ -39,6 +39,7 @@
uses org.graalvm.compiler.debug.TTYStreamProvider;
uses org.graalvm.compiler.hotspot.CompilerConfigurationFactory;
uses org.graalvm.compiler.hotspot.HotSpotBackendFactory;
+ uses org.graalvm.compiler.hotspot.HotSpotCodeCacheListener;
uses org.graalvm.compiler.options.OptionValuesAccess;
uses org.graalvm.compiler.nodes.graphbuilderconf.NodeIntrinsicPluginFactory;
diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp
index db7498c..520f914 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp
@@ -1954,7 +1954,7 @@
bool InstanceKlass::should_store_fingerprint() {
#if INCLUDE_AOT
// We store the fingerprint into the InstanceKlass only in the following 2 cases:
- if (EnableJVMCI && !UseJVMCICompiler) {
+ if (CalculateClassFingerprint) {
// (1) We are running AOT to generate a shared library.
return true;
}
diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp
index a17ee5b..08954ff 100644
--- a/hotspot/src/share/vm/runtime/globals.hpp
+++ b/hotspot/src/share/vm/runtime/globals.hpp
@@ -3387,6 +3387,9 @@
diagnostic(bool, UseAOTStrictLoading, false, \
"Exit the VM if any of the AOT libraries has invalid config") \
\
+ product(bool, CalculateClassFingerprint, false, \
+ "Calculate class fingerprint") \
+ \
/* interpreter debugging */ \
develop(intx, BinarySwitchThreshold, 5, \
"Minimal number of lookupswitch entries for rewriting to binary " \
diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp
index 9810363..aa0fb1d 100644
--- a/hotspot/src/share/vm/runtime/java.cpp
+++ b/hotspot/src/share/vm/runtime/java.cpp
@@ -437,6 +437,7 @@
Thread* THREAD = thread;
JVMCIRuntime::shutdown(THREAD);
if (HAS_PENDING_EXCEPTION) {
+ HandleMark hm(THREAD);
Handle exception(THREAD, PENDING_EXCEPTION);
CLEAR_PENDING_EXCEPTION;
java_lang_Throwable::java_printStackTrace(exception, THREAD);