src/share/vm/opto/subnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/opto

src/share/vm/opto/subnode.cpp

Print this page
rev 7347 : reviews


1130     // Match low order 2 bits
1131     int tmp = ((ti->get_con()&3) == (_test&3)) ? 1 : 0;
1132     if( _test & 4 ) tmp = 1-tmp;     // Optionally complement result
1133     return TypeInt::make(tmp);       // Boolean result
1134   }
1135 
1136   if( CC == TypeInt::CC_GE ) {
1137     if( _test == ge ) return TypeInt::ONE;
1138     if( _test == lt ) return TypeInt::ZERO;
1139   }
1140   if( CC == TypeInt::CC_LE ) {
1141     if( _test == le ) return TypeInt::ONE;
1142     if( _test == gt ) return TypeInt::ZERO;
1143   }
1144 
1145   return TypeInt::BOOL;
1146 }
1147 
1148 //------------------------------dump_spec-------------------------------------
1149 // Print special per-node info
1150 #ifndef PRODUCT
1151 void BoolTest::dump_on(outputStream *st) const {
1152   const char *msg[] = {"eq","gt","of","lt","ne","le","nof","ge"};
1153   st->print("%s", msg[_test]);
1154 }
1155 #endif
1156 
1157 //=============================================================================
1158 uint BoolNode::hash() const { return (Node::hash() << 3)|(_test._test+1); }
1159 uint BoolNode::size_of() const { return sizeof(BoolNode); }
1160 
1161 //------------------------------operator==-------------------------------------
1162 uint BoolNode::cmp( const Node &n ) const {
1163   const BoolNode *b = (const BoolNode *)&n; // Cast up
1164   return (_test._test == b->_test._test);
1165 }
1166 
1167 //-------------------------------make_predicate--------------------------------
1168 Node* BoolNode::make_predicate(Node* test_value, PhaseGVN* phase) {
1169   if (test_value->is_Con())   return test_value;
1170   if (test_value->is_Bool())  return test_value;
1171   if (test_value->is_CMove() &&
1172       test_value->in(CMoveNode::Condition)->is_Bool()) {
1173     BoolNode*   bol   = test_value->in(CMoveNode::Condition)->as_Bool();
1174     const Type* ftype = phase->type(test_value->in(CMoveNode::IfFalse));
1175     const Type* ttype = phase->type(test_value->in(CMoveNode::IfTrue));




1130     // Match low order 2 bits
1131     int tmp = ((ti->get_con()&3) == (_test&3)) ? 1 : 0;
1132     if( _test & 4 ) tmp = 1-tmp;     // Optionally complement result
1133     return TypeInt::make(tmp);       // Boolean result
1134   }
1135 
1136   if( CC == TypeInt::CC_GE ) {
1137     if( _test == ge ) return TypeInt::ONE;
1138     if( _test == lt ) return TypeInt::ZERO;
1139   }
1140   if( CC == TypeInt::CC_LE ) {
1141     if( _test == le ) return TypeInt::ONE;
1142     if( _test == gt ) return TypeInt::ZERO;
1143   }
1144 
1145   return TypeInt::BOOL;
1146 }
1147 
1148 //------------------------------dump_spec-------------------------------------
1149 // Print special per-node info

1150 void BoolTest::dump_on(outputStream *st) const {
1151   const char *msg[] = {"eq","gt","of","lt","ne","le","nof","ge"};
1152   st->print("%s", msg[_test]);
1153 }

1154 
1155 //=============================================================================
1156 uint BoolNode::hash() const { return (Node::hash() << 3)|(_test._test+1); }
1157 uint BoolNode::size_of() const { return sizeof(BoolNode); }
1158 
1159 //------------------------------operator==-------------------------------------
1160 uint BoolNode::cmp( const Node &n ) const {
1161   const BoolNode *b = (const BoolNode *)&n; // Cast up
1162   return (_test._test == b->_test._test);
1163 }
1164 
1165 //-------------------------------make_predicate--------------------------------
1166 Node* BoolNode::make_predicate(Node* test_value, PhaseGVN* phase) {
1167   if (test_value->is_Con())   return test_value;
1168   if (test_value->is_Bool())  return test_value;
1169   if (test_value->is_CMove() &&
1170       test_value->in(CMoveNode::Condition)->is_Bool()) {
1171     BoolNode*   bol   = test_value->in(CMoveNode::Condition)->as_Bool();
1172     const Type* ftype = phase->type(test_value->in(CMoveNode::IfFalse));
1173     const Type* ttype = phase->type(test_value->in(CMoveNode::IfTrue));


src/share/vm/opto/subnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File