Index: src/hydrogen-instructions.cc |
=================================================================== |
--- src/hydrogen-instructions.cc (revision 9842) |
+++ src/hydrogen-instructions.cc (working copy) |
@@ -1252,34 +1252,23 @@ |
} |
-Range* HBitAnd::InferRange() { |
+Range* HBitwise::InferRange() { |
+ if (op() == Token::BIT_XOR) return HValue::InferRange(); |
int32_t left_mask = (left()->range() != NULL) |
? left()->range()->Mask() |
: 0xffffffff; |
int32_t right_mask = (right()->range() != NULL) |
? right()->range()->Mask() |
: 0xffffffff; |
- int32_t result_mask = left_mask & right_mask; |
+ int32_t result_mask = (op() == Token::BIT_AND) |
+ ? left_mask & right_mask |
+ : left_mask | right_mask; |
return (result_mask >= 0) |
? new Range(0, result_mask) |
: HValue::InferRange(); |
} |
-Range* HBitOr::InferRange() { |
- int32_t left_mask = (left()->range() != NULL) |
- ? left()->range()->Mask() |
- : 0xffffffff; |
- int32_t right_mask = (right()->range() != NULL) |
- ? right()->range()->Mask() |
- : 0xffffffff; |
- int32_t result_mask = left_mask | right_mask; |
- return (result_mask >= 0) |
- ? new Range(0, result_mask) |
- : HValue::InferRange(); |
-} |
- |
- |
Range* HSar::InferRange() { |
if (right()->IsConstant()) { |
HConstant* c = HConstant::cast(right()); |
@@ -1785,21 +1774,6 @@ |
} |
-HType HBitAnd::CalculateInferredType() { |
- return HType::TaggedNumber(); |
-} |
- |
- |
-HType HBitXor::CalculateInferredType() { |
- return HType::TaggedNumber(); |
-} |
- |
- |
-HType HBitOr::CalculateInferredType() { |
- return HType::TaggedNumber(); |
-} |
- |
- |
HType HBitNot::CalculateInferredType() { |
return HType::TaggedNumber(); |
} |
@@ -1810,21 +1784,6 @@ |
} |
-HType HShl::CalculateInferredType() { |
- return HType::TaggedNumber(); |
-} |
- |
- |
-HType HShr::CalculateInferredType() { |
- return HType::TaggedNumber(); |
-} |
- |
- |
-HType HSar::CalculateInferredType() { |
- return HType::TaggedNumber(); |
-} |
- |
- |
HType HStringCharFromCode::CalculateInferredType() { |
return HType::String(); |
} |