Mercurial > hg > graal-jvmci-8
comparison 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 |
comparison
equal
deleted
inserted
replaced
6625:153776c4cb6f | 6632:a1c7f6472621 |
---|---|
220 | 220 |
221 _trip_cnt = 0; | 221 _trip_cnt = 0; |
222 _alternate = 0; | 222 _alternate = 0; |
223 _matcher._allocation_started = true; | 223 _matcher._allocation_started = true; |
224 | 224 |
225 ResourceArea split_arena; // Arena for Split local resources | |
225 ResourceArea live_arena; // Arena for liveness & IFG info | 226 ResourceArea live_arena; // Arena for liveness & IFG info |
226 ResourceMark rm(&live_arena); | 227 ResourceMark rm(&live_arena); |
227 | 228 |
228 // Need live-ness for the IFG; need the IFG for coalescing. If the | 229 // Need live-ness for the IFG; need the IFG for coalescing. If the |
229 // liveness is JUST for coalescing, then I can get some mileage by renaming | 230 // liveness is JUST for coalescing, then I can get some mileage by renaming |
322 if( must_spill ) { | 323 if( must_spill ) { |
323 if( !_maxlrg ) return; | 324 if( !_maxlrg ) return; |
324 // Bail out if unique gets too large (ie - unique > MaxNodeLimit) | 325 // Bail out if unique gets too large (ie - unique > MaxNodeLimit) |
325 C->check_node_count(10*must_spill, "out of nodes before split"); | 326 C->check_node_count(10*must_spill, "out of nodes before split"); |
326 if (C->failing()) return; | 327 if (C->failing()) return; |
327 _maxlrg = Split( _maxlrg ); // Split spilling LRG everywhere | 328 _maxlrg = Split(_maxlrg, &split_arena); // Split spilling LRG everywhere |
328 // Bail out if unique gets too large (ie - unique > MaxNodeLimit - 2*NodeLimitFudgeFactor) | 329 // Bail out if unique gets too large (ie - unique > MaxNodeLimit - 2*NodeLimitFudgeFactor) |
329 // or we failed to split | 330 // or we failed to split |
330 C->check_node_count(2*NodeLimitFudgeFactor, "out of nodes after physical split"); | 331 C->check_node_count(2*NodeLimitFudgeFactor, "out of nodes after physical split"); |
331 if (C->failing()) return; | 332 if (C->failing()) return; |
332 | 333 |
388 return; | 389 return; |
389 } | 390 } |
390 } | 391 } |
391 | 392 |
392 if( !_maxlrg ) return; | 393 if( !_maxlrg ) return; |
393 _maxlrg = Split( _maxlrg ); // Split spilling LRG everywhere | 394 _maxlrg = Split(_maxlrg, &split_arena); // Split spilling LRG everywhere |
394 // Bail out if unique gets too large (ie - unique > MaxNodeLimit - 2*NodeLimitFudgeFactor) | 395 // Bail out if unique gets too large (ie - unique > MaxNodeLimit - 2*NodeLimitFudgeFactor) |
395 C->check_node_count(2*NodeLimitFudgeFactor, "out of nodes after split"); | 396 C->check_node_count(2*NodeLimitFudgeFactor, "out of nodes after split"); |
396 if (C->failing()) return; | 397 if (C->failing()) return; |
397 | 398 |
398 compact(); // Compact LRGs; return new lower max lrg | 399 compact(); // Compact LRGs; return new lower max lrg |