diff src/share/vm/c1/c1_LIRGenerator.cpp @ 17925:45e59fae8f2b

8041481: JVM crashes with collect_args_for_profiling Summary: method handle call to c1 intrinsic tries to profile popped argument Reviewed-by: kvn, twisti
author roland
date Fri, 25 Apr 2014 09:22:16 +0200
parents ce9fd31ffd14
children 52b4284cb496 2fd0fd493045
line wrap: on
line diff
--- a/src/share/vm/c1/c1_LIRGenerator.cpp	Mon May 05 15:10:43 2014 +0200
+++ b/src/share/vm/c1/c1_LIRGenerator.cpp	Fri Apr 25 09:22:16 2014 +0200
@@ -2634,8 +2634,10 @@
       // LIR_Assembler::emit_profile_type() from emitting useless code
       profiled_k = ciTypeEntries::with_status(result, profiled_k);
     }
-    if (exact_signature_k != NULL && exact_klass != exact_signature_k) {
-      assert(exact_klass == NULL, "obj and signature disagree?");
+    // exact_klass and exact_signature_k can be both non NULL but
+    // different if exact_klass is loaded after the ciObject for
+    // exact_signature_k is created.
+    if (exact_klass == NULL && exact_signature_k != NULL && exact_klass != exact_signature_k) {
       // sometimes the type of the signature is better than the best type
       // the compiler has
       exact_klass = exact_signature_k;
@@ -2646,8 +2648,7 @@
       if (improved_klass == NULL) {
         improved_klass = comp->cha_exact_type(callee_signature_k);
       }
-      if (improved_klass != NULL && exact_klass != improved_klass) {
-        assert(exact_klass == NULL, "obj and signature disagree?");
+      if (exact_klass == NULL && improved_klass != NULL && exact_klass != improved_klass) {
         exact_klass = exact_signature_k;
       }
     }