comparison src/share/vm/opto/gcm.cpp @ 552:011517bbcd7b

6784930: server jvm fails with assert(!n->is_SpillCopy(),"") Summary: Set minimum block frequency MIN_BLOCK_FREQUENCY 1.e-35f. Reviewed-by: never, rasbold
author kvn
date Tue, 13 Jan 2009 11:10:00 -0800
parents 72c5366e5d86
children 0fbdb4381b99 523ded093c31
comparison
equal deleted inserted replaced
551:6c4cda924d2e 552:011517bbcd7b
26 26
27 // Optimization - Graph Style 27 // Optimization - Graph Style
28 28
29 #include "incls/_precompiled.incl" 29 #include "incls/_precompiled.incl"
30 #include "incls/_gcm.cpp.incl" 30 #include "incls/_gcm.cpp.incl"
31
32 // To avoid float value underflow
33 #define MIN_BLOCK_FREQUENCY 1.e-35f
31 34
32 //----------------------------schedule_node_into_block------------------------- 35 //----------------------------schedule_node_into_block-------------------------
33 // Insert node n into block b. Look for projections of n and make sure they 36 // Insert node n into block b. Look for projections of n and make sure they
34 // are in b also. 37 // are in b also.
35 void PhaseCFG::schedule_node_into_block( Node *n, Block *b ) { 38 void PhaseCFG::schedule_node_into_block( Node *n, Block *b ) {
1378 } 1381 }
1379 } 1382 }
1380 } 1383 }
1381 } 1384 }
1382 1385
1386 #ifdef ASSERT
1387 for (uint i = 0; i < _num_blocks; i++ ) {
1388 Block *b = _blocks[i];
1389 assert(b->_freq >= MIN_BLOCK_FREQUENCY, "Register Allocator requiers meaningful block frequency");
1390 }
1391 #endif
1392
1383 #ifndef PRODUCT 1393 #ifndef PRODUCT
1384 if (PrintCFGBlockFreq) { 1394 if (PrintCFGBlockFreq) {
1385 tty->print_cr("CFG Block Frequencies"); 1395 tty->print_cr("CFG Block Frequencies");
1386 _root_loop->dump_tree(); 1396 _root_loop->dump_tree();
1387 if (Verbose) { 1397 if (Verbose) {
1875 // Do a top down traversal of loop tree (visit outer loops first.) 1885 // Do a top down traversal of loop tree (visit outer loops first.)
1876 void CFGLoop::scale_freq() { 1886 void CFGLoop::scale_freq() {
1877 float loop_freq = _freq * trip_count(); 1887 float loop_freq = _freq * trip_count();
1878 for (int i = 0; i < _members.length(); i++) { 1888 for (int i = 0; i < _members.length(); i++) {
1879 CFGElement* s = _members.at(i); 1889 CFGElement* s = _members.at(i);
1880 s->_freq *= loop_freq; 1890 float block_freq = s->_freq * loop_freq;
1891 if (block_freq < MIN_BLOCK_FREQUENCY) block_freq = MIN_BLOCK_FREQUENCY;
1892 s->_freq = block_freq;
1881 } 1893 }
1882 CFGLoop* ch = _child; 1894 CFGLoop* ch = _child;
1883 while (ch != NULL) { 1895 while (ch != NULL) {
1884 ch->scale_freq(); 1896 ch->scale_freq();
1885 ch = ch->_sibling; 1897 ch = ch->_sibling;