Revision: 13021
Author:   [email protected]
Date:     Wed Nov 21 01:41:34 2012
Log: MIPS: Make kAsciiDataHintTag have correct semantics for all both 1 and 2 byte string types.

Port r12966 (ec963fe0)

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/11316091
Patch from Akos Palfi <[email protected]>.
http://code.google.com/p/v8/source/detail?r=13021

Modified:
 /branches/bleeding_edge/src/mips/code-stubs-mips.cc
 /branches/bleeding_edge/src/mips/macro-assembler-mips.cc

=======================================
--- /branches/bleeding_edge/src/mips/code-stubs-mips.cc Tue Nov 20 06:11:53 2012 +++ /branches/bleeding_edge/src/mips/code-stubs-mips.cc Wed Nov 21 01:41:34 2012
@@ -6600,12 +6600,6 @@
   __ and_(at, at, t1);
   __ Branch(&ascii_data, ne, at, Operand(zero_reg));

-  __ xor_(t0, t0, t1);
-  STATIC_ASSERT(kOneByteStringTag != 0 && kAsciiDataHintTag != 0);
-  __ And(t0, t0, Operand(kOneByteStringTag | kAsciiDataHintTag));
-  __ Branch(
- &ascii_data, eq, t0, Operand(kOneByteStringTag | kAsciiDataHintTag));
-
   // Allocate a two byte cons string.
   __ AllocateTwoByteConsString(v0, t2, t0, t1, &call_runtime);
   __ Branch(&allocated);
=======================================
--- /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Thu Nov 15 05:31:27 2012 +++ /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Wed Nov 21 01:41:34 2012
@@ -4896,8 +4896,10 @@
     Register scratch2,
     Label* failure) {
   int kFlatAsciiStringMask =
-      kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask;
+      kIsNotStringMask | kStringEncodingMask | kAsciiDataHintMask |
+      kStringRepresentationMask;
   int kFlatAsciiStringTag = ASCII_STRING_TYPE;
+  ASSERT_EQ(ASCII_STRING_TYPE, ASCII_STRING_TYPE & kFlatAsciiStringMask);
   ASSERT(kFlatAsciiStringTag <= 0xffff);  // Ensure this fits 16-bit immed.
   andi(scratch1, first, kFlatAsciiStringMask);
   Branch(failure, ne, scratch1, Operand(kFlatAsciiStringTag));
@@ -4910,8 +4912,10 @@
Register scratch, Label* failure) {
   int kFlatAsciiStringMask =
-      kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask;
+      kIsNotStringMask | kStringEncodingMask | kAsciiDataHintMask |
+      kStringRepresentationMask;
   int kFlatAsciiStringTag = ASCII_STRING_TYPE;
+  ASSERT_EQ(ASCII_STRING_TYPE, ASCII_STRING_TYPE & kFlatAsciiStringMask);
   And(scratch, type, Operand(kFlatAsciiStringMask));
   Branch(failure, ne, scratch, Operand(kFlatAsciiStringTag));
 }

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

Reply via email to