Reviewers: William Hesse,

Description:
Merge x64 minus-zero fix (bleeding_edge r5631) to 2.3 branch.

[email protected]

Please review this at http://codereview.chromium.org/3755012/show

SVN Base: http://v8.googlecode.com/svn/branches/2.3/

Affected files:
  M     src/version.cc
  M     src/x64/code-stubs-x64.cc
  M     test/mjsunit/smi-negative-zero.js


Index: src/version.cc
===================================================================
--- src/version.cc      (revision 5631)
+++ src/version.cc      (working copy)
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     2
 #define MINOR_VERSION     3
 #define BUILD_NUMBER      11
-#define PATCH_LEVEL       18
+#define PATCH_LEVEL       19
 #define CANDIDATE_VERSION false

 // Define SONAME to have the SCons build the put a specific SONAME into the
Index: src/x64/code-stubs-x64.cc
===================================================================
--- src/x64/code-stubs-x64.cc   (revision 5631)
+++ src/x64/code-stubs-x64.cc   (working copy)
@@ -1418,18 +1418,8 @@
     // to make sure that we switch between 0 and -0.
     // Also enter it if the value of the smi is Smi::kMinValue.
     __ SmiNeg(rax, rax, &done);
+    __ jmp(&slow);

-    // Either zero or Smi::kMinValue, neither of which become a smi when
-    // negated.
-    if (negative_zero_ == kStrictNegativeZero) {
-      __ SmiCompare(rax, Smi::FromInt(0));
-      __ j(not_equal, &slow);
-      __ Move(rax, Factory::minus_zero_value());
-      __ jmp(&done);
-    } else  {
-      __ jmp(&slow);
-    }
-
     // Try floating point case.
     __ bind(&try_float);
     __ movq(rdx, FieldOperand(rax, HeapObject::kMapOffset));
Index: test/mjsunit/smi-negative-zero.js
===================================================================
--- test/mjsunit/smi-negative-zero.js   (revision 5631)
+++ test/mjsunit/smi-negative-zero.js   (working copy)
@@ -98,3 +98,16 @@
 assertEquals(-Infinity, one / (-4 % -2), "fiskhest2");
 assertEquals(Infinity, one / (4 % 2), "fiskhest3");
 assertEquals(Infinity, one / (4 % -2), "fiskhest4");
+
+
+// This tests against a singleton -0.0 object being overwritten.gc
+x = 0;
+z = 3044;
+
+function foo(x) {
+  var y = -x + z;
+  return -x;
+}
+
+assertEquals(0, foo(x));
+assertEquals(0, foo(x));


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to