Mercurial > hg > truffle
comparison src/share/vm/opto/gcm.cpp @ 12171:4b078f877b56
8023988: Move local scheduling of nodes to the CFG creation and code motion phase (PhaseCFG)
Summary: Moved local scheduling code from class Block to class PhaseCFG
Reviewed-by: kvn, roland
author | adlertz |
---|---|
date | Sun, 01 Sep 2013 19:21:05 +0200 |
parents | 650868c062a9 |
children | de6a9e811145 2b8e28fdf503 |
comparison
equal
deleted
inserted
replaced
12169:29aa8936f03c | 12171:4b078f877b56 |
---|---|
1340 // for( int i=0; i < (int)matcher._null_check_tests.size(); i+=2 ) { | 1340 // for( int i=0; i < (int)matcher._null_check_tests.size(); i+=2 ) { |
1341 for (int i = _matcher._null_check_tests.size() - 2; i >= 0; i -= 2) { | 1341 for (int i = _matcher._null_check_tests.size() - 2; i >= 0; i -= 2) { |
1342 Node* proj = _matcher._null_check_tests[i]; | 1342 Node* proj = _matcher._null_check_tests[i]; |
1343 Node* val = _matcher._null_check_tests[i + 1]; | 1343 Node* val = _matcher._null_check_tests[i + 1]; |
1344 Block* block = get_block_for_node(proj); | 1344 Block* block = get_block_for_node(proj); |
1345 block->implicit_null_check(this, proj, val, allowed_reasons); | 1345 implicit_null_check(block, proj, val, allowed_reasons); |
1346 // The implicit_null_check will only perform the transformation | 1346 // The implicit_null_check will only perform the transformation |
1347 // if the null branch is truly uncommon, *and* it leads to an | 1347 // if the null branch is truly uncommon, *and* it leads to an |
1348 // uncommon trap. Combined with the too_many_traps guards | 1348 // uncommon trap. Combined with the too_many_traps guards |
1349 // above, this prevents SEGV storms reported in 6366351, | 1349 // above, this prevents SEGV storms reported in 6366351, |
1350 // by recompiling offending methods without this optimization. | 1350 // by recompiling offending methods without this optimization. |
1361 // Later, do a real latency aware scheduler. | 1361 // Later, do a real latency aware scheduler. |
1362 GrowableArray<int> ready_cnt(C->unique(), C->unique(), -1); | 1362 GrowableArray<int> ready_cnt(C->unique(), C->unique(), -1); |
1363 visited.Clear(); | 1363 visited.Clear(); |
1364 for (uint i = 0; i < number_of_blocks(); i++) { | 1364 for (uint i = 0; i < number_of_blocks(); i++) { |
1365 Block* block = get_block(i); | 1365 Block* block = get_block(i); |
1366 if (!block->schedule_local(this, _matcher, ready_cnt, visited)) { | 1366 if (!schedule_local(block, ready_cnt, visited)) { |
1367 if (!C->failure_reason_is(C2Compiler::retry_no_subsuming_loads())) { | 1367 if (!C->failure_reason_is(C2Compiler::retry_no_subsuming_loads())) { |
1368 C->record_method_not_compilable("local schedule failed"); | 1368 C->record_method_not_compilable("local schedule failed"); |
1369 } | 1369 } |
1370 return; | 1370 return; |
1371 } | 1371 } |
1373 | 1373 |
1374 // If we inserted any instructions between a Call and his CatchNode, | 1374 // If we inserted any instructions between a Call and his CatchNode, |
1375 // clone the instructions on all paths below the Catch. | 1375 // clone the instructions on all paths below the Catch. |
1376 for (uint i = 0; i < number_of_blocks(); i++) { | 1376 for (uint i = 0; i < number_of_blocks(); i++) { |
1377 Block* block = get_block(i); | 1377 Block* block = get_block(i); |
1378 block->call_catch_cleanup(this, C); | 1378 call_catch_cleanup(block); |
1379 } | 1379 } |
1380 | 1380 |
1381 #ifndef PRODUCT | 1381 #ifndef PRODUCT |
1382 if (trace_opto_pipelining()) { | 1382 if (trace_opto_pipelining()) { |
1383 tty->print("\n---- After GlobalCodeMotion ----\n"); | 1383 tty->print("\n---- After GlobalCodeMotion ----\n"); |