6784930: server jvm fails with assert(!n->is_SpillCopy(),"")
authorkvn
Tue, 13 Jan 2009 11:10:00 -0800
changeset 2016 c1f73fa547fe
parent 2015 580165b3f277
child 2018 32f61adc75db
6784930: server jvm fails with assert(!n->is_SpillCopy(),"") Summary: Set minimum block frequency MIN_BLOCK_FREQUENCY 1.e-35f. Reviewed-by: never, rasbold
hotspot/src/share/vm/opto/gcm.cpp
--- a/hotspot/src/share/vm/opto/gcm.cpp	Wed Jan 07 11:23:28 2009 -0800
+++ b/hotspot/src/share/vm/opto/gcm.cpp	Tue Jan 13 11:10:00 2009 -0800
@@ -29,6 +29,9 @@
 #include "incls/_precompiled.incl"
 #include "incls/_gcm.cpp.incl"
 
+// To avoid float value underflow
+#define MIN_BLOCK_FREQUENCY 1.e-35f
+
 //----------------------------schedule_node_into_block-------------------------
 // Insert node n into block b. Look for projections of n and make sure they
 // are in b also.
@@ -1380,6 +1383,13 @@
     }
   }
 
+#ifdef ASSERT
+  for (uint i = 0; i < _num_blocks; i++ ) {
+    Block *b = _blocks[i];
+    assert(b->_freq >= MIN_BLOCK_FREQUENCY, "Register Allocator requiers meaningful block frequency");
+  }
+#endif
+
 #ifndef PRODUCT
   if (PrintCFGBlockFreq) {
     tty->print_cr("CFG Block Frequencies");
@@ -1877,7 +1887,9 @@
   float loop_freq = _freq * trip_count();
   for (int i = 0; i < _members.length(); i++) {
     CFGElement* s = _members.at(i);
-    s->_freq *= loop_freq;
+    float block_freq = s->_freq * loop_freq;
+    if (block_freq < MIN_BLOCK_FREQUENCY) block_freq = MIN_BLOCK_FREQUENCY;
+    s->_freq = block_freq;
   }
   CFGLoop* ch = _child;
   while (ch != NULL) {