comparison src/share/vm/opto/node.cpp @ 8048:8b3da8d14c93

7197327: 40% regression on 8 b41 comp 8 b40 on specjvm2008.mpegaudio on oob Summary: Add support for expensive nodes. Reviewed-by: kvn
author roland
date Tue, 12 Feb 2013 12:56:11 +0100
parents a7114d3d712e
children 6931f425c517
comparison
equal deleted inserted replaced
8047:1e5e28bac299 8048:8b3da8d14c93
491 n->_in[i] = x; 491 n->_in[i] = x;
492 if (x != NULL) x->add_out(n); 492 if (x != NULL) x->add_out(n);
493 } 493 }
494 if (is_macro()) 494 if (is_macro())
495 compile->add_macro_node(n); 495 compile->add_macro_node(n);
496 if (is_expensive())
497 compile->add_expensive_node(n);
496 498
497 n->set_idx(compile->next_unique()); // Get new unique index as well 499 n->set_idx(compile->next_unique()); // Get new unique index as well
498 debug_only( n->verify_construction() ); 500 debug_only( n->verify_construction() );
499 NOT_PRODUCT(nodes_created++); 501 NOT_PRODUCT(nodes_created++);
500 // Do not patch over the debug_idx of a clone, because it makes it 502 // Do not patch over the debug_idx of a clone, because it makes it
614 #endif 616 #endif
615 } 617 }
616 if (is_macro()) { 618 if (is_macro()) {
617 compile->remove_macro_node(this); 619 compile->remove_macro_node(this);
618 } 620 }
621 if (is_expensive()) {
622 compile->remove_expensive_node(this);
623 }
619 #ifdef ASSERT 624 #ifdef ASSERT
620 // We will not actually delete the storage, but we'll make the node unusable. 625 // We will not actually delete the storage, but we'll make the node unusable.
621 *(address*)this = badAddress; // smash the C++ vtbl, probably 626 *(address*)this = badAddress; // smash the C++ vtbl, probably
622 _in = _out = (Node**) badAddress; 627 _in = _out = (Node**) badAddress;
623 _max = _cnt = _outmax = _outcnt = 0; 628 _max = _cnt = _outmax = _outcnt = 0;
686 return false; 691 return false;
687 dump(); 692 dump();
688 return true; 693 return true;
689 } 694 }
690 #endif 695 #endif
696
697
698 //------------------------------is_unreachable---------------------------------
699 bool Node::is_unreachable(PhaseIterGVN &igvn) const {
700 assert(!is_Mach(), "doesn't work with MachNodes");
701 return outcnt() == 0 || igvn.type(this) == Type::TOP || in(0)->is_top();
702 }
691 703
692 //------------------------------add_req---------------------------------------- 704 //------------------------------add_req----------------------------------------
693 // Add a new required input at the end 705 // Add a new required input at the end
694 void Node::add_req( Node *n ) { 706 void Node::add_req( Node *n ) {
695 assert( is_not_dead(n), "can not use dead node"); 707 assert( is_not_dead(n), "can not use dead node");
1244 igvn->_worklist.remove(dead); 1256 igvn->_worklist.remove(dead);
1245 igvn->set_type(dead, Type::TOP); 1257 igvn->set_type(dead, Type::TOP);
1246 if (dead->is_macro()) { 1258 if (dead->is_macro()) {
1247 igvn->C->remove_macro_node(dead); 1259 igvn->C->remove_macro_node(dead);
1248 } 1260 }
1261 if (dead->is_expensive()) {
1262 igvn->C->remove_expensive_node(dead);
1263 }
1249 // Kill all inputs to the dead guy 1264 // Kill all inputs to the dead guy
1250 for (uint i=0; i < dead->req(); i++) { 1265 for (uint i=0; i < dead->req(); i++) {
1251 Node *n = dead->in(i); // Get input to dead guy 1266 Node *n = dead->in(i); // Get input to dead guy
1252 if (n != NULL && !n->is_top()) { // Input is valid? 1267 if (n != NULL && !n->is_top()) { // Input is valid?
1253 dead->set_req(i, top); // Smash input away 1268 dead->set_req(i, top); // Smash input away