src/share/vm/opto/loopTransform.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/loopTransform.cpp	Wed Nov 19 23:23:52 2014
--- new/src/share/vm/opto/loopTransform.cpp	Wed Nov 19 23:23:52 2014

*** 270,283 **** --- 270,282 ---- // Return TRUE or FALSE if the loop should be peeled or not. Peel if we can // make some loop-invariant test (usually a null-check) happen before the loop. bool IdealLoopTree::policy_peeling( PhaseIdealLoop *phase ) const { Node *test = ((IdealLoopTree*)this)->tail(); int body_size = ((IdealLoopTree*)this)->_body.size(); int live_node_count = phase->C->live_nodes(); // Peeling does loop cloning which can result in O(N^2) node construction if( body_size > 255 /* Prevent overflow for large body_size */ ! || (body_size * body_size + live_node_count > MaxNodeLimit) ) { ! || (body_size * body_size + phase->C->live_nodes()) > phase->C->max_node_limit() ) { return false; // too large to safely clone } while( test != _head ) { // Scan till run off top of loop if( test->is_If() ) { // Test? Node *ctrl = phase->get_ctrl(test->in(1));
*** 602,612 **** --- 601,611 ---- uint tst_body_size = (new_body_size - EMPTY_LOOP_SIZE) / trip_count + EMPTY_LOOP_SIZE; if (body_size != tst_body_size) // Check for int overflow return false; if (new_body_size > unroll_limit || // Unrolling can result in a large amount of node construction ! new_body_size >= MaxNodeLimit - (uint) phase->C->live_nodes()) { ! new_body_size >= phase->C->max_node_limit() - phase->C->live_nodes()) { return false; } // Do not unroll a loop with String intrinsics code. // String intrinsics are large and have loops.
*** 2279,2290 **** --- 2278,2289 ---- } } // Skip next optimizations if running low on nodes. Note that // policy_unswitching and policy_maximally_unroll have this check. ! uint nodes_left = MaxNodeLimit - (uint) phase->C->live_nodes(); ! if ((2 * _body.size()) > nodes_left) { ! int nodes_left = phase->C->max_node_limit() - phase->C->live_nodes(); ! if ((int)(2 * _body.size()) > nodes_left) { return true; } // Counted loops may be peeled, may need some iterations run up // front for RCE, and may want to align loop refs to a cache

src/share/vm/opto/loopTransform.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File