@@ -243,7 +243,6 @@ void PhaseCFG::schedule_pinned_nodes(VectorSet &visited) {
243243 }
244244}
245245
246- #ifdef ASSERT
247246// Assert that new input b2 is dominated by all previous inputs.
248247// Check this by by seeing that it is dominated by b1, the deepest
249248// input observed until b2.
@@ -255,6 +254,7 @@ static void assert_dom(Block* b1, Block* b2, Node* n, const PhaseCFG* cfg) {
255254 tmp = tmp->_idom ;
256255 }
257256 if (tmp != b1) {
257+ #ifdef ASSERT
258258 // Detected an unschedulable graph. Print some nice stuff and die.
259259 tty->print_cr (" !!! Unschedulable graph !!!" );
260260 for (uint j=0 ; j<n->len (); j++) { // For all inputs
@@ -267,10 +267,11 @@ static void assert_dom(Block* b1, Block* b2, Node* n, const PhaseCFG* cfg) {
267267 }
268268 tty->print (" Failing node: " );
269269 n->dump ();
270- assert (false , " unscheduable graph" );
270+ assert (false , " unschedulable graph" );
271+ #endif
272+ cfg->C ->record_failure (" unschedulable graph" );
271273 }
272274}
273- #endif
274275
275276static Block* find_deepest_input (Node* n, const PhaseCFG* cfg) {
276277 // Find the last input dominated by all other inputs.
@@ -285,7 +286,10 @@ static Block* find_deepest_input(Node* n, const PhaseCFG* cfg) {
285286 // The new inb must be dominated by the previous deepb.
286287 // The various inputs must be linearly ordered in the dom
287288 // tree, or else there will not be a unique deepest block.
288- DEBUG_ONLY (assert_dom (deepb, inb, n, cfg));
289+ assert_dom (deepb, inb, n, cfg);
290+ if (cfg->C ->failing ()) {
291+ return nullptr ;
292+ }
289293 deepb = inb; // Save deepest block
290294 deepb_dom_depth = deepb->_dom_depth ;
291295 }
@@ -372,6 +376,9 @@ bool PhaseCFG::schedule_early(VectorSet &visited, Node_Stack &roots) {
372376 if (!parent_node->pinned ()) {
373377 // Set earliest legal block.
374378 Block* earliest_block = find_deepest_input (parent_node, this );
379+ if (C->failing ()) {
380+ return false ;
381+ }
375382 map_node_to_block (parent_node, earliest_block);
376383 } else {
377384 assert (get_block_for_node (parent_node) == get_block_for_node (parent_node->in (0 )), " Pinned Node should be at the same block as its control edge" );
@@ -523,7 +530,10 @@ static Block* memory_early_block(Node* load, Block* early, const PhaseCFG* cfg)
523530 // The new inb must be dominated by the previous deepb.
524531 // The various inputs must be linearly ordered in the dom
525532 // tree, or else there will not be a unique deepest block.
526- DEBUG_ONLY (assert_dom (deepb, inb, load, cfg));
533+ assert_dom (deepb, inb, load, cfg);
534+ if (cfg->C ->failing ()) {
535+ return nullptr ;
536+ }
527537 deepb = inb; // Save deepest block
528538 deepb_dom_depth = deepb->_dom_depth ;
529539 }
@@ -715,6 +725,9 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) {
715725 // dominator tree, and allow for a broader discovery of anti-dependences.
716726 if (C->subsume_loads ()) {
717727 early = memory_early_block (load, early, this );
728+ if (C->failing ()) {
729+ return nullptr ;
730+ }
718731 }
719732
720733 ResourceArea* area = Thread::current ()->resource_area ();
@@ -1519,6 +1532,9 @@ void PhaseCFG::schedule_late(VectorSet &visited, Node_Stack &stack) {
15191532 // Hoist LCA above possible-defs and insert anti-dependences to
15201533 // defs in new LCA block.
15211534 LCA = insert_anti_dependences (LCA, self);
1535+ if (C->failing ()) {
1536+ return ;
1537+ }
15221538 }
15231539
15241540 if (early->_dom_depth > LCA->_dom_depth ) {
@@ -1611,8 +1627,8 @@ void PhaseCFG::global_code_motion() {
16111627 Node_Stack stack ((C->live_nodes () >> 2 ) + 16 ); // pre-grow
16121628 if (!schedule_early (visited, stack)) {
16131629 // Bailout without retry
1614- assert (false , " early schedule failed" );
1615- C->record_method_not_compilable (" early schedule failed" );
1630+ assert (C-> failure_is_artificial () , " early schedule failed" );
1631+ C->record_method_not_compilable (" early schedule failed" DEBUG_ONLY (COMMA true ) );
16161632 return ;
16171633 }
16181634
@@ -1657,6 +1673,9 @@ void PhaseCFG::global_code_motion() {
16571673 // uncommon trap. Combined with the too_many_traps guards
16581674 // above, this prevents SEGV storms reported in 6366351,
16591675 // by recompiling offending methods without this optimization.
1676+ if (C->failing ()) {
1677+ return ;
1678+ }
16601679 }
16611680 }
16621681
@@ -1726,6 +1745,9 @@ void PhaseCFG::global_code_motion() {
17261745 for (uint i = 0 ; i < number_of_blocks (); i++) {
17271746 Block* block = get_block (i);
17281747 call_catch_cleanup (block);
1748+ if (C->failing ()) {
1749+ return ;
1750+ }
17291751 }
17301752
17311753#ifndef PRODUCT
0 commit comments