2637 break; 2638 default: 2639 assert(n->Opcode() == Op_LoopLimit || 2640 n->Opcode() == Op_Opaque1 || 2641 n->Opcode() == Op_Opaque2 || 2642 n->Opcode() == Op_Opaque3, "unknown node type in macro list"); 2643 } 2644 assert(success == (C->macro_count() < old_macro_count), "elimination reduces macro count"); 2645 progress = progress || success; 2646 } 2647 } 2648 } 2649 2650 //------------------------------expand_macro_nodes---------------------- 2651 // Returns true if a failure occurred. 2652 bool PhaseMacroExpand::expand_macro_nodes() { 2653 // Last attempt to eliminate macro nodes. 2654 eliminate_macro_nodes(); 2655 2656 // Make sure expansion will not cause node limit to be exceeded. 2657 // Worst case is a macro node gets expanded into about 50 nodes. 2658 // Allow 50% more for optimization. 2659 if (C->check_node_count(C->macro_count() * 75, "out of nodes before macro expansion" ) ) 2660 return true; 2661 2662 // Eliminate Opaque and LoopLimit nodes. Do it after all loop optimizations. 2663 bool progress = true; 2664 while (progress) { 2665 progress = false; 2666 for (int i = C->macro_count(); i > 0; i--) { 2667 Node * n = C->macro_node(i-1); 2668 bool success = false; 2669 debug_only(int old_macro_count = C->macro_count();); 2670 if (n->Opcode() == Op_LoopLimit) { 2671 // Remove it from macro list and put on IGVN worklist to optimize. 2672 C->remove_macro_node(n); 2673 _igvn._worklist.push(n); 2674 success = true; 2675 } else if (n->Opcode() == Op_CallStaticJava) { 2676 // Remove it from macro list and put on IGVN worklist to optimize. 2677 C->remove_macro_node(n); 2678 _igvn._worklist.push(n); 2679 success = true; | 2637 break; 2638 default: 2639 assert(n->Opcode() == Op_LoopLimit || 2640 n->Opcode() == Op_Opaque1 || 2641 n->Opcode() == Op_Opaque2 || 2642 n->Opcode() == Op_Opaque3, "unknown node type in macro list"); 2643 } 2644 assert(success == (C->macro_count() < old_macro_count), "elimination reduces macro count"); 2645 progress = progress || success; 2646 } 2647 } 2648 } 2649 2650 //------------------------------expand_macro_nodes---------------------- 2651 // Returns true if a failure occurred. 2652 bool PhaseMacroExpand::expand_macro_nodes() { 2653 // Last attempt to eliminate macro nodes. 2654 eliminate_macro_nodes(); 2655 2656 // Make sure expansion will not cause node limit to be exceeded. 2657 // Worst case is a macro node gets expanded into about 200 nodes. 2658 // Allow 50% more for optimization. 2659 if (C->check_node_count(C->macro_count() * 300, "out of nodes before macro expansion" ) ) 2660 return true; 2661 2662 // Eliminate Opaque and LoopLimit nodes. Do it after all loop optimizations. 2663 bool progress = true; 2664 while (progress) { 2665 progress = false; 2666 for (int i = C->macro_count(); i > 0; i--) { 2667 Node * n = C->macro_node(i-1); 2668 bool success = false; 2669 debug_only(int old_macro_count = C->macro_count();); 2670 if (n->Opcode() == Op_LoopLimit) { 2671 // Remove it from macro list and put on IGVN worklist to optimize. 2672 C->remove_macro_node(n); 2673 _igvn._worklist.push(n); 2674 success = true; 2675 } else if (n->Opcode() == Op_CallStaticJava) { 2676 // Remove it from macro list and put on IGVN worklist to optimize. 2677 C->remove_macro_node(n); 2678 _igvn._worklist.push(n); 2679 success = true; |