8159720: Failure of C2 compilation with tiered prevents some C1 compilations.
authorcvarming
Mon, 20 Jun 2016 08:11:22 -0400
changeset 39431 cb1b2538c4b2
parent 39430 ab7acda033f4
child 39432 4daabc709a27
8159720: Failure of C2 compilation with tiered prevents some C1 compilations. Summary: If C2 fails to compile a method with tiered compilation, then it should mark the method as not compileable on the C2 tier only. Reviewed-by: twisti, thartmann
hotspot/src/share/vm/opto/compile.cpp
hotspot/src/share/vm/opto/compile.hpp
hotspot/src/share/vm/opto/matcher.cpp
hotspot/src/share/vm/opto/parse1.cpp
--- a/hotspot/src/share/vm/opto/compile.cpp	Wed Jun 15 09:46:15 2016 +0200
+++ b/hotspot/src/share/vm/opto/compile.cpp	Mon Jun 20 08:11:22 2016 -0400
@@ -778,7 +778,7 @@
     }
     if (failing())  return;
     if (cg == NULL) {
-      record_method_not_compilable_all_tiers("cannot parse method");
+      record_method_not_compilable("cannot parse method");
       return;
     }
     JVMState* jvms = build_start_state(start(), tf());
--- a/hotspot/src/share/vm/opto/compile.hpp	Wed Jun 15 09:46:15 2016 +0200
+++ b/hotspot/src/share/vm/opto/compile.hpp	Mon Jun 20 08:11:22 2016 -0400
@@ -823,16 +823,12 @@
   }
 
   void record_failure(const char* reason);
-  void record_method_not_compilable(const char* reason, bool all_tiers = false) {
-    // All bailouts cover "all_tiers" when TieredCompilation is off.
-    if (!TieredCompilation) all_tiers = true;
-    env()->record_method_not_compilable(reason, all_tiers);
+  void record_method_not_compilable(const char* reason) {
+    // Bailouts cover "all_tiers" when TieredCompilation is off.
+    env()->record_method_not_compilable(reason, !TieredCompilation);
     // Record failure reason.
     record_failure(reason);
   }
-  void record_method_not_compilable_all_tiers(const char* reason) {
-    record_method_not_compilable(reason, true);
-  }
   bool check_node_count(uint margin, const char* reason) {
     if (live_nodes() + margin > max_node_limit()) {
       record_method_not_compilable(reason);
--- a/hotspot/src/share/vm/opto/matcher.cpp	Wed Jun 15 09:46:15 2016 +0200
+++ b/hotspot/src/share/vm/opto/matcher.cpp	Mon Jun 20 08:11:22 2016 -0400
@@ -124,7 +124,7 @@
       _in_arg_limit = OptoReg::add(warped, 1); // Bump max stack slot seen
     if (!RegMask::can_represent_arg(warped)) {
       // the compiler cannot represent this method's calling sequence
-      C->record_method_not_compilable_all_tiers("unsupported incoming calling sequence");
+      C->record_method_not_compilable("unsupported incoming calling sequence");
       return OptoReg::Bad;
     }
     return warped;
@@ -1120,7 +1120,7 @@
     if( warped >= out_arg_limit_per_call )
       out_arg_limit_per_call = OptoReg::add(warped,1);
     if (!RegMask::can_represent_arg(warped)) {
-      C->record_method_not_compilable_all_tiers("unsupported calling sequence");
+      C->record_method_not_compilable("unsupported calling sequence");
       return OptoReg::Bad;
     }
     return warped;
@@ -1300,7 +1300,7 @@
     uint r_cnt = mcall->tf()->range()->cnt();
     MachProjNode *proj = new MachProjNode( mcall, r_cnt+10000, RegMask::Empty, MachProjNode::fat_proj );
     if (!RegMask::can_represent_arg(OptoReg::Name(out_arg_limit_per_call-1))) {
-      C->record_method_not_compilable_all_tiers("unsupported outgoing calling sequence");
+      C->record_method_not_compilable("unsupported outgoing calling sequence");
     } else {
       for (int i = begin_out_arg_area; i < out_arg_limit_per_call; i++)
         proj->_rout.Insert(OptoReg::Name(i));
@@ -1488,7 +1488,7 @@
   // out of stack space.  See bugs 6272980 & 6227033 for more info.
   LabelRootDepth++;
   if (LabelRootDepth > MaxLabelRootDepth) {
-    C->record_method_not_compilable_all_tiers("Out of stack space, increase MaxLabelRootDepth");
+    C->record_method_not_compilable("Out of stack space, increase MaxLabelRootDepth");
     return NULL;
   }
   uint care = 0;                // Edges matcher cares about
--- a/hotspot/src/share/vm/opto/parse1.cpp	Wed Jun 15 09:46:15 2016 +0200
+++ b/hotspot/src/share/vm/opto/parse1.cpp	Mon Jun 20 08:11:22 2016 -0400
@@ -425,7 +425,7 @@
   _iter.reset_to_method(method());
   _flow = method()->get_flow_analysis();
   if (_flow->failing()) {
-    C->record_method_not_compilable_all_tiers(_flow->failure_reason());
+    C->record_method_not_compilable(_flow->failure_reason());
   }
 
 #ifndef PRODUCT
@@ -1118,7 +1118,7 @@
   // Check for really stupid bail-out cases.
   uint len = TypeFunc::Parms + method()->max_locals() + method()->max_stack();
   if (len >= 32760) {
-    C->record_method_not_compilable_all_tiers("too many local variables");
+    C->record_method_not_compilable("too many local variables");
     return NULL;
   }