src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp
changeset 58366 222a91b9438a
parent 58219 bc0648405d67
child 58471 bada0782842a
--- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp	Fri Sep 27 09:55:35 2019 +0100
+++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp	Thu Sep 26 17:49:44 2019 +0200
@@ -1272,6 +1272,18 @@
     }
     if ((ctrl->is_Proj() && ctrl->in(0)->is_CallJava()) || ctrl->is_CallJava()) {
       CallNode* call = ctrl->is_Proj() ? ctrl->in(0)->as_CallJava() : ctrl->as_CallJava();
+      if (call->entry_point() == OptoRuntime::rethrow_stub()) {
+        // The rethrow call may have too many projections to be
+        // properly handled here. Given there's no reason for a
+        // barrier to depend on the call, move it above the call
+        if (phase->get_ctrl(val) == ctrl) {
+          assert(val->Opcode() == Op_DecodeN, "unexpected node");
+          assert(phase->is_dominator(phase->get_ctrl(val->in(1)), call->in(0)), "Load is too low");
+          phase->set_ctrl(val, call->in(0));
+        }
+        phase->set_ctrl(lrb, call->in(0));
+        continue;
+      }
       CallProjections projs;
       call->extract_projections(&projs, false, false);