1056 //------------------------------raise_bottom_type------------------------------
1057 // Get the worst-case Type output for this Node.
1058 void Node::raise_bottom_type(const Type* new_type) {
1059 if (is_Type()) {
1060 TypeNode *n = this->as_Type();
1061 if (VerifyAliases) {
1062 assert(new_type->higher_equal_speculative(n->type()), "new type must refine old type");
1063 }
1064 n->set_type(new_type);
1065 } else if (is_Load()) {
1066 LoadNode *n = this->as_Load();
1067 if (VerifyAliases) {
1068 assert(new_type->higher_equal_speculative(n->type()), "new type must refine old type");
1069 }
1070 n->set_type(new_type);
1071 }
1072 }
1073
1074 //------------------------------Identity---------------------------------------
1075 // Return a node that the given node is equivalent to.
1076 Node *Node::Identity( PhaseTransform * ) {
1077 return this; // Default to no identities
1078 }
1079
1080 //------------------------------Value------------------------------------------
1081 // Compute a new Type for a node using the Type of the inputs.
1082 const Type *Node::Value( PhaseTransform * ) const {
1083 return bottom_type(); // Default to worst-case Type
1084 }
1085
1086 //------------------------------Ideal------------------------------------------
1087 //
1088 // 'Idealize' the graph rooted at this Node.
1089 //
1090 // In order to be efficient and flexible there are some subtle invariants
1091 // these Ideal calls need to hold. Running with '+VerifyIterativeGVN' checks
1092 // these invariants, although its too slow to have on by default. If you are
1093 // hacking an Ideal call, be sure to test with +VerifyIterativeGVN!
1094 //
1095 // The Ideal call almost arbitrarily reshape the graph rooted at the 'this'
1096 // pointer. If ANY change is made, it must return the root of the reshaped
1097 // graph - even if the root is the same Node. Example: swapping the inputs
1098 // to an AddINode gives the same answer and same root, but you still have to
1099 // return the 'this' pointer instead of NULL.
1100 //
1101 // You cannot return an OLD Node, except for the 'this' pointer. Use the
1102 // Identity call to return an old Node; basically if Identity can find
2441 uint TypeNode::size_of() const { return sizeof(*this); }
2442 #ifndef PRODUCT
2443 void TypeNode::dump_spec(outputStream *st) const {
2444 if( !Verbose && !WizardMode ) {
2445 // standard dump does this in Verbose and WizardMode
2446 st->print(" #"); _type->dump_on(st);
2447 }
2448 }
2449
2450 void TypeNode::dump_compact_spec(outputStream *st) const {
2451 st->print("#");
2452 _type->dump_on(st);
2453 }
2454 #endif
2455 uint TypeNode::hash() const {
2456 return Node::hash() + _type->hash();
2457 }
2458 uint TypeNode::cmp( const Node &n ) const
2459 { return !Type::cmp( _type, ((TypeNode&)n)._type ); }
2460 const Type *TypeNode::bottom_type() const { return _type; }
2461 const Type *TypeNode::Value( PhaseTransform * ) const { return _type; }
2462
2463 //------------------------------ideal_reg--------------------------------------
2464 uint TypeNode::ideal_reg() const {
2465 return _type->ideal_reg();
2466 }
|
1056 //------------------------------raise_bottom_type------------------------------
1057 // Get the worst-case Type output for this Node.
1058 void Node::raise_bottom_type(const Type* new_type) {
1059 if (is_Type()) {
1060 TypeNode *n = this->as_Type();
1061 if (VerifyAliases) {
1062 assert(new_type->higher_equal_speculative(n->type()), "new type must refine old type");
1063 }
1064 n->set_type(new_type);
1065 } else if (is_Load()) {
1066 LoadNode *n = this->as_Load();
1067 if (VerifyAliases) {
1068 assert(new_type->higher_equal_speculative(n->type()), "new type must refine old type");
1069 }
1070 n->set_type(new_type);
1071 }
1072 }
1073
1074 //------------------------------Identity---------------------------------------
1075 // Return a node that the given node is equivalent to.
1076 Node* Node::Identity(PhaseGVN* phase) {
1077 return this; // Default to no identities
1078 }
1079
1080 //------------------------------Value------------------------------------------
1081 // Compute a new Type for a node using the Type of the inputs.
1082 const Type* Node::Value(PhaseGVN* phase) const {
1083 return bottom_type(); // Default to worst-case Type
1084 }
1085
1086 //------------------------------Ideal------------------------------------------
1087 //
1088 // 'Idealize' the graph rooted at this Node.
1089 //
1090 // In order to be efficient and flexible there are some subtle invariants
1091 // these Ideal calls need to hold. Running with '+VerifyIterativeGVN' checks
1092 // these invariants, although its too slow to have on by default. If you are
1093 // hacking an Ideal call, be sure to test with +VerifyIterativeGVN!
1094 //
1095 // The Ideal call almost arbitrarily reshape the graph rooted at the 'this'
1096 // pointer. If ANY change is made, it must return the root of the reshaped
1097 // graph - even if the root is the same Node. Example: swapping the inputs
1098 // to an AddINode gives the same answer and same root, but you still have to
1099 // return the 'this' pointer instead of NULL.
1100 //
1101 // You cannot return an OLD Node, except for the 'this' pointer. Use the
1102 // Identity call to return an old Node; basically if Identity can find
2441 uint TypeNode::size_of() const { return sizeof(*this); }
2442 #ifndef PRODUCT
2443 void TypeNode::dump_spec(outputStream *st) const {
2444 if( !Verbose && !WizardMode ) {
2445 // standard dump does this in Verbose and WizardMode
2446 st->print(" #"); _type->dump_on(st);
2447 }
2448 }
2449
2450 void TypeNode::dump_compact_spec(outputStream *st) const {
2451 st->print("#");
2452 _type->dump_on(st);
2453 }
2454 #endif
2455 uint TypeNode::hash() const {
2456 return Node::hash() + _type->hash();
2457 }
2458 uint TypeNode::cmp( const Node &n ) const
2459 { return !Type::cmp( _type, ((TypeNode&)n)._type ); }
2460 const Type *TypeNode::bottom_type() const { return _type; }
2461 const Type* TypeNode::Value(PhaseGVN* phase) const { return _type; }
2462
2463 //------------------------------ideal_reg--------------------------------------
2464 uint TypeNode::ideal_reg() const {
2465 return _type->ideal_reg();
2466 }
|