1370 if( (int)n->_idx == node_idx
1371 debug_only(|| n->debug_idx() == node_idx) ) {
1372 if (result != NULL)
1373 tty->print("find: " INTPTR_FORMAT " and " INTPTR_FORMAT " both have idx==%d\n",
1374 (uintptr_t)result, (uintptr_t)n, node_idx);
1375 result = n;
1376 }
1377 v->set(n->_idx);
1378 for( uint i=0; i<n->len(); i++ ) {
1379 if( only_ctrl && !(n->is_Region()) && (n->Opcode() != Op_Root) && (i != TypeFunc::Control) ) continue;
1380 find_recur( result, n->in(i), idx, only_ctrl, old_space, new_space );
1381 }
1382 // Search along forward edges also:
1383 if (idx < 0 && !only_ctrl) {
1384 for( uint j=0; j<n->outcnt(); j++ ) {
1385 find_recur( result, n->raw_out(j), idx, only_ctrl, old_space, new_space );
1386 }
1387 }
1388 #ifdef ASSERT
1389 // Search along debug_orig edges last:
1390 for (Node* orig = n->debug_orig(); orig != NULL; orig = orig->debug_orig()) {
1391 if (NotANode(orig)) break;
1392 find_recur( result, orig, idx, only_ctrl, old_space, new_space );
1393 }
1394 #endif //ASSERT
1395 }
1396
1397 // call this from debugger:
1398 Node* find_node(Node* n, int idx) {
1399 return n->find(idx);
1400 }
1401
1402 //------------------------------find-------------------------------------------
1403 Node* Node::find(int idx) const {
1404 ResourceArea *area = Thread::current()->resource_area();
1405 VectorSet old_space(area), new_space(area);
1406 Node* result = NULL;
1407 find_recur( result, (Node*) this, idx, false, old_space, new_space );
1408 return result;
1409 }
1410
|
1370 if( (int)n->_idx == node_idx
1371 debug_only(|| n->debug_idx() == node_idx) ) {
1372 if (result != NULL)
1373 tty->print("find: " INTPTR_FORMAT " and " INTPTR_FORMAT " both have idx==%d\n",
1374 (uintptr_t)result, (uintptr_t)n, node_idx);
1375 result = n;
1376 }
1377 v->set(n->_idx);
1378 for( uint i=0; i<n->len(); i++ ) {
1379 if( only_ctrl && !(n->is_Region()) && (n->Opcode() != Op_Root) && (i != TypeFunc::Control) ) continue;
1380 find_recur( result, n->in(i), idx, only_ctrl, old_space, new_space );
1381 }
1382 // Search along forward edges also:
1383 if (idx < 0 && !only_ctrl) {
1384 for( uint j=0; j<n->outcnt(); j++ ) {
1385 find_recur( result, n->raw_out(j), idx, only_ctrl, old_space, new_space );
1386 }
1387 }
1388 #ifdef ASSERT
1389 // Search along debug_orig edges last:
1390 for (Node* orig = n->debug_orig(); orig != NULL && n != orig; orig = orig->debug_orig()) {
1391 if (NotANode(orig)) break;
1392 find_recur( result, orig, idx, only_ctrl, old_space, new_space );
1393 }
1394 #endif //ASSERT
1395 }
1396
1397 // call this from debugger:
1398 Node* find_node(Node* n, int idx) {
1399 return n->find(idx);
1400 }
1401
1402 //------------------------------find-------------------------------------------
1403 Node* Node::find(int idx) const {
1404 ResourceArea *area = Thread::current()->resource_area();
1405 VectorSet old_space(area), new_space(area);
1406 Node* result = NULL;
1407 find_recur( result, (Node*) this, idx, false, old_space, new_space );
1408 return result;
1409 }
1410
|