Reset overwrite mode for BinaryOpStub unless we can actually make use of it.
authorbmeurer@chromium.org <bmeurer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 20 Nov 2013 09:30:46 +0000 (09:30 +0000)
committerbmeurer@chromium.org <bmeurer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 20 Nov 2013 09:30:46 +0000 (09:30 +0000)
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/77943002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17899 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/code-stubs.cc

index 166d46d..051dd45 100644 (file)
@@ -586,6 +586,14 @@ void BinaryOpStub::UpdateStatus(Handle<Object> left,
   ASSERT(result_state_ <= (has_int_result() ? INT32 : NUMBER) ||
          op_ == Token::ADD);
 
+  // Reset overwrite mode unless we can actually make use of it, or may be able
+  // to make use of it at some point in the future.
+  if ((mode_ == OVERWRITE_LEFT && left_state_ > NUMBER) ||
+      (mode_ == OVERWRITE_RIGHT && right_state_ > NUMBER) ||
+      result_state_ > NUMBER) {
+    mode_ = NO_OVERWRITE;
+  }
+
   if (old_state == GetExtraICState()) {
     // Tagged operations can lead to non-truncating HChanges
     if (left->IsUndefined() || left->IsBoolean()) {