src/share/vm/opto/chaitin.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File JDK-8033260 Sdiff src/share/vm/opto

src/share/vm/opto/chaitin.cpp

Print this page
rev 5903 : 8033260: assert(lrg._area >= 0.0) failed: negative spill area
Summary: Change type from float to double on block frequency, and add check for +Inf - +Inf operation
Reviewed-by:


 193 PhaseChaitin::PhaseChaitin(uint unique, PhaseCFG &cfg, Matcher &matcher)
 194   : PhaseRegAlloc(unique, cfg, matcher,
 195 #ifndef PRODUCT
 196        print_chaitin_statistics
 197 #else
 198        NULL
 199 #endif
 200        )
 201   , _lrg_map(Thread::current()->resource_area(), unique)
 202   , _live(0)
 203   , _spilled_once(Thread::current()->resource_area())
 204   , _spilled_twice(Thread::current()->resource_area())
 205   , _lo_degree(0), _lo_stk_degree(0), _hi_degree(0), _simplified(0)
 206   , _oldphi(unique)
 207 #ifndef PRODUCT
 208   , _trace_spilling(TraceSpilling || C->method_has_option("TraceSpilling"))
 209 #endif
 210 {
 211   NOT_PRODUCT( Compile::TracePhase t3("ctorChaitin", &_t_ctorChaitin, TimeCompiler); )
 212 
 213   _high_frequency_lrg = MIN2(float(OPTO_LRG_HIGH_FREQ), _cfg.get_outer_loop_frequency());
 214 
 215   // Build a list of basic blocks, sorted by frequency
 216   _blks = NEW_RESOURCE_ARRAY(Block *, _cfg.number_of_blocks());
 217   // Experiment with sorting strategies to speed compilation
 218   double  cutoff = BLOCK_FREQUENCY(1.0); // Cutoff for high frequency bucket
 219   Block **buckets[NUMBUCKS];             // Array of buckets
 220   uint    buckcnt[NUMBUCKS];             // Array of bucket counters
 221   double  buckval[NUMBUCKS];             // Array of bucket value cutoffs
 222   for (uint i = 0; i < NUMBUCKS; i++) {
 223     buckets[i] = NEW_RESOURCE_ARRAY(Block *, _cfg.number_of_blocks());
 224     buckcnt[i] = 0;
 225     // Bump by three orders of magnitude each time
 226     cutoff *= 0.001;
 227     buckval[i] = cutoff;
 228     for (uint j = 0; j < _cfg.number_of_blocks(); j++) {
 229       buckets[i][j] = NULL;
 230     }
 231   }
 232   // Sort blocks into buckets
 233   for (uint i = 0; i < _cfg.number_of_blocks(); i++) {




 193 PhaseChaitin::PhaseChaitin(uint unique, PhaseCFG &cfg, Matcher &matcher)
 194   : PhaseRegAlloc(unique, cfg, matcher,
 195 #ifndef PRODUCT
 196        print_chaitin_statistics
 197 #else
 198        NULL
 199 #endif
 200        )
 201   , _lrg_map(Thread::current()->resource_area(), unique)
 202   , _live(0)
 203   , _spilled_once(Thread::current()->resource_area())
 204   , _spilled_twice(Thread::current()->resource_area())
 205   , _lo_degree(0), _lo_stk_degree(0), _hi_degree(0), _simplified(0)
 206   , _oldphi(unique)
 207 #ifndef PRODUCT
 208   , _trace_spilling(TraceSpilling || C->method_has_option("TraceSpilling"))
 209 #endif
 210 {
 211   NOT_PRODUCT( Compile::TracePhase t3("ctorChaitin", &_t_ctorChaitin, TimeCompiler); )
 212 
 213   _high_frequency_lrg = MIN2(double(OPTO_LRG_HIGH_FREQ), _cfg.get_outer_loop_frequency());
 214 
 215   // Build a list of basic blocks, sorted by frequency
 216   _blks = NEW_RESOURCE_ARRAY(Block *, _cfg.number_of_blocks());
 217   // Experiment with sorting strategies to speed compilation
 218   double  cutoff = BLOCK_FREQUENCY(1.0); // Cutoff for high frequency bucket
 219   Block **buckets[NUMBUCKS];             // Array of buckets
 220   uint    buckcnt[NUMBUCKS];             // Array of bucket counters
 221   double  buckval[NUMBUCKS];             // Array of bucket value cutoffs
 222   for (uint i = 0; i < NUMBUCKS; i++) {
 223     buckets[i] = NEW_RESOURCE_ARRAY(Block *, _cfg.number_of_blocks());
 224     buckcnt[i] = 0;
 225     // Bump by three orders of magnitude each time
 226     cutoff *= 0.001;
 227     buckval[i] = cutoff;
 228     for (uint j = 0; j < _cfg.number_of_blocks(); j++) {
 229       buckets[i][j] = NULL;
 230     }
 231   }
 232   // Sort blocks into buckets
 233   for (uint i = 0; i < _cfg.number_of_blocks(); i++) {


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