changeset 48671:8604408bc26e

8193323: Crash in "failed dependencies, but counter didn't change" with enabled UseJVMCICompiler Reviewed-by: kvn
author dlong
date Wed, 13 Dec 2017 20:35:09 -0800
parents cf7792800ba9
children be065f758154
files src/hotspot/share/compiler/compileBroker.cpp src/hotspot/share/jvmci/jvmciCompilerToVM.cpp
diffstat 2 files changed, 19 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/compiler/compileBroker.cpp	Wed Dec 13 23:06:59 2017 +0100
+++ b/src/hotspot/share/compiler/compileBroker.cpp	Wed Dec 13 20:35:09 2017 -0800
@@ -1852,18 +1852,24 @@
     TraceTime t1("compilation", &time);
     EventCompilation event;
 
-    JVMCIEnv env(task, system_dictionary_modification_counter);
-    methodHandle method(thread, target_handle);
-    jvmci->compile_method(method, osr_bci, &env);
+    // Skip redefined methods
+    if (target_handle->is_old()) {
+        failure_reason = "redefined method";
+        retry_message = "not retryable";
+        compilable = ciEnv::MethodCompilable_never;
+    } else {
+        JVMCIEnv env(task, system_dictionary_modification_counter);
+        methodHandle method(thread, target_handle);
+        jvmci->compile_method(method, osr_bci, &env);
 
+        failure_reason = env.failure_reason();
+        if (!env.retryable()) {
+          retry_message = "not retryable";
+          compilable = ciEnv::MethodCompilable_not_at_tier;
+        }
+    }
     post_compile(thread, task, event, task->code() != NULL, NULL);
 
-    failure_reason = env.failure_reason();
-    if (!env.retryable()) {
-      retry_message = "not retryable";
-      compilable = ciEnv::MethodCompilable_not_at_tier;
-    }
-
   } else
 #endif // INCLUDE_JVMCI
   {
--- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp	Wed Dec 13 23:06:59 2017 +0100
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp	Wed Dec 13 20:35:09 2017 -0800
@@ -761,6 +761,10 @@
 
 C2V_VMENTRY(jboolean, isCompilable,(JNIEnv *, jobject, jobject jvmci_method))
   methodHandle method = CompilerToVM::asMethod(jvmci_method);
+  // Skip redefined methods
+  if (method->is_old()) {
+    return false;
+  }
   return !method->is_not_compilable(CompLevel_full_optimization);
 C2V_END