Index: src/hydrogen-instructions.cc |
=================================================================== |
--- src/hydrogen-instructions.cc (revision 6698) |
+++ src/hydrogen-instructions.cc (working copy) |
@@ -680,6 +680,12 @@ |
} |
+void HNeg::PrintDataTo(StringStream* stream) const { |
+ HUnaryOperation::PrintDataTo(stream); |
+ if (CheckFlag(kBailoutOnMinusZero)) stream->Add(" -0?"); |
+} |
+ |
+ |
HCheckInstanceType* HCheckInstanceType::NewIsJSObjectOrJSFunction( |
HValue* value) { |
STATIC_ASSERT((LAST_JS_OBJECT_TYPE + 1) == JS_FUNCTION_TYPE); |
@@ -874,6 +880,22 @@ |
} |
+Range* HNeg::InferRange() { |
+ if (representation().IsInteger32()) { |
+ Range* input_range = value()->range(); |
+ Range* result = input_range->Copy(); |
+ Range neg_one(-1, -1); |
+ if (!result->MulAndCheckOverflow(&neg_one)) { |
+ ClearFlag(HValue::kCanOverflow); |
+ } |
+ result->set_can_be_minus_zero(input_range->CanBeZero()); |
+ return result; |
+ } else { |
+ return HValue::InferRange(); |
+ } |
+} |
+ |
+ |
void HPhi::PrintTo(StringStream* stream) const { |
stream->Add("["); |
for (int i = 0; i < OperandCount(); ++i) { |
@@ -1288,6 +1310,11 @@ |
} |
+HType HNeg::CalculateInferredType() const { |
+ return HType::TaggedNumber(); |
+} |
+ |
+ |
HType HUnaryMathOperation::CalculateInferredType() const { |
return HType::TaggedNumber(); |
} |
@@ -1366,6 +1393,15 @@ |
} |
+HValue* HNeg::EnsureAndPropagateNotMinusZero(BitVector* visited) { |
+ visited->Add(id()); |
+ if (range() == NULL || range()->CanBeMinusZero()) { |
+ SetFlag(kBailoutOnMinusZero); |
+ } |
+ return NULL; |
+} |
+ |
+ |
HValue* HSub::EnsureAndPropagateNotMinusZero(BitVector* visited) { |
visited->Add(id()); |
// Propagate to the left argument. If the left argument cannot be -0, then |