Revision: 7189
Author: [email protected]
Date: Wed Mar 16 01:53:27 2011
Log: Fix incorrect assumption about BIT_AND on smis on ARM.
Review URL: http://codereview.chromium.org/6672040
http://code.google.com/p/v8/source/detail?r=7189

Modified:
 /branches/2.3/src/arm/codegen-arm.cc
 /branches/2.3/src/version.cc
 /branches/2.3/test/mjsunit/bitops-info.js

=======================================
--- /branches/2.3/src/arm/codegen-arm.cc        Tue Oct 26 02:25:42 2010
+++ /branches/2.3/src/arm/codegen-arm.cc        Wed Mar 16 01:53:27 2011
@@ -1201,8 +1201,10 @@
           default: UNREACHABLE();
         }
         deferred->BindExit();
-        TypeInfo result_type =
- (op == Token::BIT_AND) ? TypeInfo::Smi() : TypeInfo::Integer32();
+        TypeInfo result_type = TypeInfo::Integer32();
+        if (op == Token::BIT_AND && int_value >= 0) {
+          result_type = TypeInfo::Smi();
+        }
         frame_->EmitPush(tos, result_type);
       }
       break;
=======================================
--- /branches/2.3/src/version.cc        Thu Feb  3 01:01:47 2011
+++ /branches/2.3/src/version.cc        Wed Mar 16 01:53:27 2011
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     2
 #define MINOR_VERSION     3
 #define BUILD_NUMBER      11
-#define PATCH_LEVEL       25
+#define PATCH_LEVEL       26
 #define CANDIDATE_VERSION false

 // Define SONAME to have the SCons build the put a specific SONAME into the
=======================================
--- /branches/2.3/test/mjsunit/bitops-info.js   Mon Aug 16 09:28:43 2010
+++ /branches/2.3/test/mjsunit/bitops-info.js   Wed Mar 16 01:53:27 2011
@@ -36,7 +36,6 @@
 function hidden_int32() {
   return 1600822924;  // It's a signed Int32.
 }
-

 function f() {
   var x = non_int32();  // Not a constant.
@@ -66,6 +65,13 @@
   assertEquals(46512102 & 2600822924, x & y, "10rev");
   assertEquals(1600822924 & 2600822924, x & z, "11rev");

+  assertEquals((46512102 & -0x20123456) | 1, (y & -0x20123456) | 1, "12");
+ assertEquals((1600822924 & -0x20123456) | 1, (z & -0x20123456) | 1, "13"); + assertEquals((2600822924 & -0x20123456) | 1, (x & -0x20123456) | 1, "14"); + assertEquals((46512102 & -0x20123456) | 1, (-0x20123456 & y) | 1, "12rev"); + assertEquals((1600822924 & -0x20123456) | 1, (-0x20123456 & z) | 1, "13rev"); + assertEquals((2600822924 & -0x20123456) | 1, (-0x20123456 & x) | 1, "14rev");
+
   assertEquals(2600822924 & 2600822924, x & x, "xx");
   assertEquals(y, y & y, "yy");
   assertEquals(z, z & z, "zz");

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

Reply via email to