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

src/share/vm/opto/live.cpp

Print this page




  84   for( uint j=_cfg._num_blocks; j>0; j-- ) {
  85     Block *b = _cfg._blocks[j-1];
  86 
  87     // Compute the local live-in set.  Start with any new live-out bits.
  88     IndexSet *use = getset( b );
  89     IndexSet *def = &_defs[b->_pre_order-1];
  90     DEBUG_ONLY(IndexSet *def_outside = getfreeset();)
  91     uint i;
  92     for( i=b->_nodes.size(); i>1; i-- ) {
  93       Node *n = b->_nodes[i-1];
  94       if( n->is_Phi() ) break;
  95 
  96       uint r = _names[n->_idx];
  97       assert(!def_outside->member(r), "Use of external LRG overlaps the same LRG defined in this block");
  98       def->insert( r );
  99       use->remove( r );
 100       uint cnt = n->req();
 101       for( uint k=1; k<cnt; k++ ) {
 102         Node *nk = n->in(k);
 103         uint nkidx = nk->_idx;
 104         if( _cfg._bbs[nkidx] != b ) {
 105           uint u = _names[nkidx];
 106           use->insert( u );
 107           DEBUG_ONLY(def_outside->insert( u );)
 108         }
 109       }
 110     }
 111 #ifdef ASSERT
 112     def_outside->set_next(_free_IndexSet);
 113     _free_IndexSet = def_outside;     // Drop onto free list
 114 #endif
 115     // Remove anything defined by Phis and the block start instruction
 116     for( uint k=i; k>0; k-- ) {
 117       uint r = _names[b->_nodes[k-1]->_idx];
 118       def->insert( r );
 119       use->remove( r );
 120     }
 121 
 122     // Push these live-in things to predecessors
 123     for( uint l=1; l<b->num_preds(); l++ ) {
 124       Block *p = _cfg._bbs[b->pred(l)->_idx];
 125       add_liveout( p, use, first_pass );
 126 
 127       // PhiNode uses go in the live-out set of prior blocks.
 128       for( uint k=i; k>0; k-- )
 129         add_liveout( p, _names[b->_nodes[k-1]->in(l)->_idx], first_pass );
 130     }
 131     freeset( b );
 132     first_pass.set(b->_pre_order);
 133 
 134     // Inner loop: blocks that picked up new live-out values to be propagated
 135     while( _worklist->size() ) {
 136         // !!!!!
 137 // #ifdef ASSERT
 138       iters++;
 139 // #endif
 140       Block *b = _worklist->pop();
 141       IndexSet *delta = getset(b);
 142       assert( delta->count(), "missing delta set" );
 143 
 144       // Add new-live-in to predecessors live-out sets
 145       for( uint l=1; l<b->num_preds(); l++ )
 146         add_liveout( _cfg._bbs[b->pred(l)->_idx], delta, first_pass );


 147 
 148       freeset(b);
 149     } // End of while-worklist-not-empty
 150 
 151   } // End of for-all-blocks-outer-loop
 152 
 153   // We explicitly clear all of the IndexSets which we are about to release.
 154   // This allows us to recycle their internal memory into IndexSet's free list.
 155 
 156   for( i=0; i<_cfg._num_blocks; i++ ) {
 157     _defs[i].clear();
 158     if (_deltas[i]) {
 159       // Is this always true?
 160       _deltas[i]->clear();
 161     }
 162   }
 163   IndexSet *free = _free_IndexSet;
 164   while (free != NULL) {
 165     IndexSet *temp = free;
 166     free = free->next();




  84   for( uint j=_cfg._num_blocks; j>0; j-- ) {
  85     Block *b = _cfg._blocks[j-1];
  86 
  87     // Compute the local live-in set.  Start with any new live-out bits.
  88     IndexSet *use = getset( b );
  89     IndexSet *def = &_defs[b->_pre_order-1];
  90     DEBUG_ONLY(IndexSet *def_outside = getfreeset();)
  91     uint i;
  92     for( i=b->_nodes.size(); i>1; i-- ) {
  93       Node *n = b->_nodes[i-1];
  94       if( n->is_Phi() ) break;
  95 
  96       uint r = _names[n->_idx];
  97       assert(!def_outside->member(r), "Use of external LRG overlaps the same LRG defined in this block");
  98       def->insert( r );
  99       use->remove( r );
 100       uint cnt = n->req();
 101       for( uint k=1; k<cnt; k++ ) {
 102         Node *nk = n->in(k);
 103         uint nkidx = nk->_idx;
 104         if (_cfg.get_block_for_node(nk) != b) {
 105           uint u = _names[nkidx];
 106           use->insert( u );
 107           DEBUG_ONLY(def_outside->insert( u );)
 108         }
 109       }
 110     }
 111 #ifdef ASSERT
 112     def_outside->set_next(_free_IndexSet);
 113     _free_IndexSet = def_outside;     // Drop onto free list
 114 #endif
 115     // Remove anything defined by Phis and the block start instruction
 116     for( uint k=i; k>0; k-- ) {
 117       uint r = _names[b->_nodes[k-1]->_idx];
 118       def->insert( r );
 119       use->remove( r );
 120     }
 121 
 122     // Push these live-in things to predecessors
 123     for( uint l=1; l<b->num_preds(); l++ ) {
 124       Block *p = _cfg.get_block_for_node(b->pred(l));
 125       add_liveout( p, use, first_pass );
 126 
 127       // PhiNode uses go in the live-out set of prior blocks.
 128       for( uint k=i; k>0; k-- )
 129         add_liveout( p, _names[b->_nodes[k-1]->in(l)->_idx], first_pass );
 130     }
 131     freeset( b );
 132     first_pass.set(b->_pre_order);
 133 
 134     // Inner loop: blocks that picked up new live-out values to be propagated
 135     while( _worklist->size() ) {
 136         // !!!!!
 137 // #ifdef ASSERT
 138       iters++;
 139 // #endif
 140       Block *b = _worklist->pop();
 141       IndexSet *delta = getset(b);
 142       assert( delta->count(), "missing delta set" );
 143 
 144       // Add new-live-in to predecessors live-out sets
 145       for (uint l = 1; l < b->num_preds(); l++) {
 146         Block* block = _cfg.get_block_for_node(b->pred(l));
 147         add_liveout(block, delta, first_pass);
 148       }
 149 
 150       freeset(b);
 151     } // End of while-worklist-not-empty
 152 
 153   } // End of for-all-blocks-outer-loop
 154 
 155   // We explicitly clear all of the IndexSets which we are about to release.
 156   // This allows us to recycle their internal memory into IndexSet's free list.
 157 
 158   for( i=0; i<_cfg._num_blocks; i++ ) {
 159     _defs[i].clear();
 160     if (_deltas[i]) {
 161       // Is this always true?
 162       _deltas[i]->clear();
 163     }
 164   }
 165   IndexSet *free = _free_IndexSet;
 166   while (free != NULL) {
 167     IndexSet *temp = free;
 168     free = free->next();


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