src/share/vm/opto/block.cpp

changeset 5639
4b078f877b56
parent 5635
650868c062a9
child 6198
55fb97c4c58d
child 6478
044b28168e20
     1.1 --- a/src/share/vm/opto/block.cpp	Wed Aug 28 11:22:43 2013 +0200
     1.2 +++ b/src/share/vm/opto/block.cpp	Sun Sep 01 19:21:05 2013 +0200
     1.3 @@ -209,15 +209,15 @@
     1.4  
     1.5  // True if block is low enough frequency or guarded by a test which
     1.6  // mostly does not go here.
     1.7 -bool Block::is_uncommon(PhaseCFG* cfg) const {
     1.8 +bool PhaseCFG::is_uncommon(const Block* block) {
     1.9    // Initial blocks must never be moved, so are never uncommon.
    1.10 -  if (head()->is_Root() || head()->is_Start())  return false;
    1.11 +  if (block->head()->is_Root() || block->head()->is_Start())  return false;
    1.12  
    1.13    // Check for way-low freq
    1.14 -  if( _freq < BLOCK_FREQUENCY(0.00001f) ) return true;
    1.15 +  if(block->_freq < BLOCK_FREQUENCY(0.00001f) ) return true;
    1.16  
    1.17    // Look for code shape indicating uncommon_trap or slow path
    1.18 -  if (has_uncommon_code()) return true;
    1.19 +  if (block->has_uncommon_code()) return true;
    1.20  
    1.21    const float epsilon = 0.05f;
    1.22    const float guard_factor = PROB_UNLIKELY_MAG(4) / (1.f - epsilon);
    1.23 @@ -225,8 +225,8 @@
    1.24    uint freq_preds = 0;
    1.25    uint uncommon_for_freq_preds = 0;
    1.26  
    1.27 -  for( uint i=1; i<num_preds(); i++ ) {
    1.28 -    Block* guard = cfg->get_block_for_node(pred(i));
    1.29 +  for( uint i=1; i< block->num_preds(); i++ ) {
    1.30 +    Block* guard = get_block_for_node(block->pred(i));
    1.31      // Check to see if this block follows its guard 1 time out of 10000
    1.32      // or less.
    1.33      //
    1.34 @@ -244,14 +244,14 @@
    1.35        uncommon_preds++;
    1.36      } else {
    1.37        freq_preds++;
    1.38 -      if( _freq < guard->_freq * guard_factor ) {
    1.39 +      if(block->_freq < guard->_freq * guard_factor ) {
    1.40          uncommon_for_freq_preds++;
    1.41        }
    1.42      }
    1.43    }
    1.44 -  if( num_preds() > 1 &&
    1.45 +  if( block->num_preds() > 1 &&
    1.46        // The block is uncommon if all preds are uncommon or
    1.47 -      (uncommon_preds == (num_preds()-1) ||
    1.48 +      (uncommon_preds == (block->num_preds()-1) ||
    1.49        // it is uncommon for all frequent preds.
    1.50         uncommon_for_freq_preds == freq_preds) ) {
    1.51      return true;
    1.52 @@ -669,7 +669,7 @@
    1.53  
    1.54      // Look for uncommon blocks and move to end.
    1.55      if (!C->do_freq_based_layout()) {
    1.56 -      if (block->is_uncommon(this)) {
    1.57 +      if (is_uncommon(block)) {
    1.58          move_to_end(block, i);
    1.59          last--;                   // No longer check for being uncommon!
    1.60          if (no_flip_branch(block)) { // Fall-thru case must follow?

mercurial