Ejemplo n.º 1
0
//------------------------------set_next_call----------------------------------
void Block::set_next_call( Node *n, VectorSet &next_call, Block_Array &bbs ) {
  if( next_call.test_set(n->_idx) ) return;
  for( uint i=0; i<n->len(); i++ ) {
    Node *m = n->in(i);
    if( !m ) continue;  // must see all nodes in block that precede call
    if( bbs[m->_idx] == this ) 
      set_next_call( m, next_call, bbs );
  }
}
Ejemplo n.º 2
0
Archivo: lcm.cpp Proyecto: dain/graal
//------------------------------set_next_call----------------------------------
void PhaseCFG::set_next_call(Block* block, Node* n, VectorSet& next_call) {
  if( next_call.test_set(n->_idx) ) return;
  for( uint i=0; i<n->len(); i++ ) {
    Node *m = n->in(i);
    if( !m ) continue;  // must see all nodes in block that precede call
    if (get_block_for_node(m) == block) {
      set_next_call(block, m, next_call);
    }
  }
}
Ejemplo n.º 3
0
 // Put node on worklist if it is (or was) not there.
 inline void add_to_worklist(PointsToNode* pt) {
   PointsToNode* ptf = pt;
   uint pidx_bias = 0;
   if (PointsToNode::is_base_use(pt)) {
     // Create a separate entry in _in_worklist for a marked base edge
     // because _worklist may have an entry for a normal edge pointing
     // to the same node. To separate them use _next_pidx as bias.
     ptf = PointsToNode::get_use_node(pt)->as_Field();
     pidx_bias = _next_pidx;
   }
   if (!_in_worklist.test_set(ptf->pidx() + pidx_bias)) {
     _worklist.append(pt);
   }
 }
Ejemplo n.º 4
0
//------------------------------expand_recur----------------------------
static void expand_recur( Node *n, VectorSet &visited, Node_List &worklist ) {
    if( !n ) return;
    if( visited.test_set(n->_idx) ) return;
    switch (n->class_id()) {
    case Node::Class_Allocate:    // We use millicode instead of inline allocation
    case Node::Class_AllocateArray:
    case Node::Class_Lock:
    case Node::Class_Unlock:
    case Node::Class_SafePoint:
//  case Node::Class_GetKlass:
        worklist.push(n);
    }
    for(uint i=0; i<n->req(); i++)
        expand_recur(n->in(i),visited,worklist);
}
Ejemplo n.º 5
0
void PhaseCFG::_dump_cfg( const Node *end, VectorSet &visited  ) const {
  const Node *x = end->is_block_proj();
  assert( x, "not a CFG" );

  // Do not visit this block again
  if( visited.test_set(x->_idx) ) return;

  // Skip through this block
  const Node *p = x;
  do {
    p = p->in(0);               // Move control forward
    assert( !p->is_block_proj() || p->is_Root(), "not a CFG" );
  } while( !p->is_block_start() );

  // Recursively visit
  for( uint i=1; i<p->req(); i++ )
    _dump_cfg(p->in(i),visited);

  // Dump the block
  _bbs[p->_idx]->dump(&_bbs);
}