diff --git a/src/code-stubs.cc b/src/code-stubs.cc index 1b9826ee42..2283f847ba 100644 --- a/src/code-stubs.cc +++ b/src/code-stubs.cc @@ -584,11 +584,18 @@ void BinaryOpStub::UpdateStatus(Handle left, op_ == Token::ADD); if (old_state == GetExtraICState()) { - // Since the fpu is to precise, we might bail out on numbers which - // actually would truncate with 64 bit precision. - ASSERT(!CpuFeatures::IsSupported(SSE2) && - result_state_ <= INT32); - result_state_ = NUMBER; + // Tagged operations can lead to non-truncating HChanges + if (left->IsUndefined()) { + left_state_ = GENERIC; + } else if (right->IsUndefined()) { + right_state_ = GENERIC; + } else { + // Since the fpu is to precise, we might bail out on numbers which + // actually would truncate with 64 bit precision. + ASSERT(!CpuFeatures::IsSupported(SSE2) && + result_state_ <= INT32); + result_state_ = NUMBER; + } } }