diff src/share/vm/opto/chaitin.cpp @ 6632:a1c7f6472621

7148109: C2 compiler consumes too much heap resources Summary: Add split_arena to allocate temporary arrays in PhaseChaitin::Split() and free them on method's exit. Reviewed-by: twisti
author kvn
date Mon, 27 Aug 2012 09:46:38 -0700
parents f7cd53cedd78
children e626685e9f6c
line wrap: on
line diff
--- a/src/share/vm/opto/chaitin.cpp	Fri Aug 24 16:23:59 2012 -0700
+++ b/src/share/vm/opto/chaitin.cpp	Mon Aug 27 09:46:38 2012 -0700
@@ -222,6 +222,7 @@
   _alternate = 0;
   _matcher._allocation_started = true;
 
+  ResourceArea split_arena;     // Arena for Split local resources
   ResourceArea live_arena;      // Arena for liveness & IFG info
   ResourceMark rm(&live_arena);
 
@@ -324,7 +325,7 @@
     // Bail out if unique gets too large (ie - unique > MaxNodeLimit)
     C->check_node_count(10*must_spill, "out of nodes before split");
     if (C->failing())  return;
-    _maxlrg = Split( _maxlrg );        // Split spilling LRG everywhere
+    _maxlrg = Split(_maxlrg, &split_arena);  // Split spilling LRG everywhere
     // Bail out if unique gets too large (ie - unique > MaxNodeLimit - 2*NodeLimitFudgeFactor)
     // or we failed to split
     C->check_node_count(2*NodeLimitFudgeFactor, "out of nodes after physical split");
@@ -390,7 +391,7 @@
     }
 
     if( !_maxlrg ) return;
-    _maxlrg = Split( _maxlrg );        // Split spilling LRG everywhere
+    _maxlrg = Split(_maxlrg, &split_arena);  // Split spilling LRG everywhere
     // Bail out if unique gets too large (ie - unique > MaxNodeLimit - 2*NodeLimitFudgeFactor)
     C->check_node_count(2*NodeLimitFudgeFactor, "out of nodes after split");
     if (C->failing())  return;