Revision: 5634
Author: [email protected]
Date: Sun Oct 17 23:36:27 2010
Log: Merge x64 minus-zero fix (bleeding_edge r5631) to 2.2 branch.

[email protected]
Review URL: http://codereview.chromium.org/3858001
http://code.google.com/p/v8/source/detail?r=5634

Modified:
 /branches/2.2/src/version.cc
 /branches/2.2/src/x64/codegen-x64.cc
 /branches/2.2/test/mjsunit/smi-negative-zero.js

=======================================
--- /branches/2.2/src/version.cc        Wed Sep 29 09:06:15 2010
+++ /branches/2.2/src/version.cc        Sun Oct 17 23:36:27 2010
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     2
 #define MINOR_VERSION     2
 #define BUILD_NUMBER      24
-#define PATCH_LEVEL       26
+#define PATCH_LEVEL       27
 #define CANDIDATE_VERSION false

 // Define SONAME to have the SCons build the put a specific SONAME into the
=======================================
--- /branches/2.2/src/x64/codegen-x64.cc        Tue Sep 28 00:38:12 2010
+++ /branches/2.2/src/x64/codegen-x64.cc        Sun Oct 17 23:36:27 2010
@@ -9428,17 +9428,7 @@
     // 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);
-
-    // 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);
-    }
+    __ jmp(&slow);

     // Try floating point case.
     __ bind(&try_float);
=======================================
--- /branches/2.2/test/mjsunit/smi-negative-zero.js     Fri Oct 16 04:48:38 2009
+++ /branches/2.2/test/mjsunit/smi-negative-zero.js     Sun Oct 17 23:36:27 2010
@@ -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