< prev index next >

src/share/vm/opto/node.cpp

Print this page




1049 //------------------------------raise_bottom_type------------------------------
1050 // Get the worst-case Type output for this Node.
1051 void Node::raise_bottom_type(const Type* new_type) {
1052   if (is_Type()) {
1053     TypeNode *n = this->as_Type();
1054     if (VerifyAliases) {
1055       assert(new_type->higher_equal_speculative(n->type()), "new type must refine old type");
1056     }
1057     n->set_type(new_type);
1058   } else if (is_Load()) {
1059     LoadNode *n = this->as_Load();
1060     if (VerifyAliases) {
1061       assert(new_type->higher_equal_speculative(n->type()), "new type must refine old type");
1062     }
1063     n->set_type(new_type);
1064   }
1065 }
1066 
1067 //------------------------------Identity---------------------------------------
1068 // Return a node that the given node is equivalent to.
1069 Node *Node::Identity( PhaseTransform * ) {
1070   return this;                  // Default to no identities
1071 }
1072 
1073 //------------------------------Value------------------------------------------
1074 // Compute a new Type for a node using the Type of the inputs.
1075 const Type *Node::Value( PhaseTransform * ) const {
1076   return bottom_type();         // Default to worst-case Type
1077 }
1078 
1079 //------------------------------Ideal------------------------------------------
1080 //
1081 // 'Idealize' the graph rooted at this Node.
1082 //
1083 // In order to be efficient and flexible there are some subtle invariants
1084 // these Ideal calls need to hold.  Running with '+VerifyIterativeGVN' checks
1085 // these invariants, although its too slow to have on by default.  If you are
1086 // hacking an Ideal call, be sure to test with +VerifyIterativeGVN!
1087 //
1088 // The Ideal call almost arbitrarily reshape the graph rooted at the 'this'
1089 // pointer.  If ANY change is made, it must return the root of the reshaped
1090 // graph - even if the root is the same Node.  Example: swapping the inputs
1091 // to an AddINode gives the same answer and same root, but you still have to
1092 // return the 'this' pointer instead of NULL.
1093 //
1094 // You cannot return an OLD Node, except for the 'this' pointer.  Use the
1095 // Identity call to return an old Node; basically if Identity can find


2434 uint TypeNode::size_of() const { return sizeof(*this); }
2435 #ifndef PRODUCT
2436 void TypeNode::dump_spec(outputStream *st) const {
2437   if( !Verbose && !WizardMode ) {
2438     // standard dump does this in Verbose and WizardMode
2439     st->print(" #"); _type->dump_on(st);
2440   }
2441 }
2442 
2443 void TypeNode::dump_compact_spec(outputStream *st) const {
2444   st->print("#");
2445   _type->dump_on(st);
2446 }
2447 #endif
2448 uint TypeNode::hash() const {
2449   return Node::hash() + _type->hash();
2450 }
2451 uint TypeNode::cmp( const Node &n ) const
2452 { return !Type::cmp( _type, ((TypeNode&)n)._type ); }
2453 const Type *TypeNode::bottom_type() const { return _type; }
2454 const Type *TypeNode::Value( PhaseTransform * ) const { return _type; }
2455 
2456 //------------------------------ideal_reg--------------------------------------
2457 uint TypeNode::ideal_reg() const {
2458   return _type->ideal_reg();
2459 }


1049 //------------------------------raise_bottom_type------------------------------
1050 // Get the worst-case Type output for this Node.
1051 void Node::raise_bottom_type(const Type* new_type) {
1052   if (is_Type()) {
1053     TypeNode *n = this->as_Type();
1054     if (VerifyAliases) {
1055       assert(new_type->higher_equal_speculative(n->type()), "new type must refine old type");
1056     }
1057     n->set_type(new_type);
1058   } else if (is_Load()) {
1059     LoadNode *n = this->as_Load();
1060     if (VerifyAliases) {
1061       assert(new_type->higher_equal_speculative(n->type()), "new type must refine old type");
1062     }
1063     n->set_type(new_type);
1064   }
1065 }
1066 
1067 //------------------------------Identity---------------------------------------
1068 // Return a node that the given node is equivalent to.
1069 Node* Node::Identity(PhaseGVN* phase) {
1070   return this;                  // Default to no identities
1071 }
1072 
1073 //------------------------------Value------------------------------------------
1074 // Compute a new Type for a node using the Type of the inputs.
1075 const Type* Node::Value(PhaseGVN* phase) const {
1076   return bottom_type();         // Default to worst-case Type
1077 }
1078 
1079 //------------------------------Ideal------------------------------------------
1080 //
1081 // 'Idealize' the graph rooted at this Node.
1082 //
1083 // In order to be efficient and flexible there are some subtle invariants
1084 // these Ideal calls need to hold.  Running with '+VerifyIterativeGVN' checks
1085 // these invariants, although its too slow to have on by default.  If you are
1086 // hacking an Ideal call, be sure to test with +VerifyIterativeGVN!
1087 //
1088 // The Ideal call almost arbitrarily reshape the graph rooted at the 'this'
1089 // pointer.  If ANY change is made, it must return the root of the reshaped
1090 // graph - even if the root is the same Node.  Example: swapping the inputs
1091 // to an AddINode gives the same answer and same root, but you still have to
1092 // return the 'this' pointer instead of NULL.
1093 //
1094 // You cannot return an OLD Node, except for the 'this' pointer.  Use the
1095 // Identity call to return an old Node; basically if Identity can find


2434 uint TypeNode::size_of() const { return sizeof(*this); }
2435 #ifndef PRODUCT
2436 void TypeNode::dump_spec(outputStream *st) const {
2437   if( !Verbose && !WizardMode ) {
2438     // standard dump does this in Verbose and WizardMode
2439     st->print(" #"); _type->dump_on(st);
2440   }
2441 }
2442 
2443 void TypeNode::dump_compact_spec(outputStream *st) const {
2444   st->print("#");
2445   _type->dump_on(st);
2446 }
2447 #endif
2448 uint TypeNode::hash() const {
2449   return Node::hash() + _type->hash();
2450 }
2451 uint TypeNode::cmp( const Node &n ) const
2452 { return !Type::cmp( _type, ((TypeNode&)n)._type ); }
2453 const Type *TypeNode::bottom_type() const { return _type; }
2454 const Type* TypeNode::Value(PhaseGVN* phase) const { return _type; }
2455 
2456 //------------------------------ideal_reg--------------------------------------
2457 uint TypeNode::ideal_reg() const {
2458   return _type->ideal_reg();
2459 }
< prev index next >