Revision: 24704
Author:   [email protected]
Date:     Fri Oct 17 16:23:31 2014 UTC
Log:      ReceiverCheckMode needs to be utilized further.

The parameter wasn't being passed appropriately, and there was an extra
opportunity to use mode RECEIVER_IS_STRING in SubStringStub.

[email protected]

Review URL: https://codereview.chromium.org/657313005
https://code.google.com/p/v8/source/detail?r=24704

Modified:
 /branches/bleeding_edge/src/arm/code-stubs-arm.cc
 /branches/bleeding_edge/src/arm64/code-stubs-arm64.cc
 /branches/bleeding_edge/src/code-stubs.h
 /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc
 /branches/bleeding_edge/src/mips/code-stubs-mips.cc
 /branches/bleeding_edge/src/x64/code-stubs-x64.cc

=======================================
--- /branches/bleeding_edge/src/arm/code-stubs-arm.cc Thu Oct 16 12:27:35 2014 UTC +++ /branches/bleeding_edge/src/arm/code-stubs-arm.cc Fri Oct 17 16:23:31 2014 UTC
@@ -3167,8 +3167,8 @@
   // r2: length
   // r3: from index (untagged)
   __ SmiTag(r3, r3);
-  StringCharAtGenerator generator(
- r0, r3, r2, r0, &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER); + StringCharAtGenerator generator(r0, r3, r2, r0, &runtime, &runtime, &runtime, + STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING);
   generator.GenerateFast(masm);
   __ Drop(3);
   __ Ret();
=======================================
--- /branches/bleeding_edge/src/arm64/code-stubs-arm64.cc Thu Oct 16 12:27:35 2014 UTC +++ /branches/bleeding_edge/src/arm64/code-stubs-arm64.cc Fri Oct 17 16:23:31 2014 UTC
@@ -3812,9 +3812,9 @@
   // x12: input_type
   // x15: from (untagged)
   __ SmiTag(from);
-  StringCharAtGenerator generator(
-      input_string, from, result_length, x0,
-      &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER);
+  StringCharAtGenerator generator(input_string, from, result_length, x0,
+                                  &runtime, &runtime, &runtime,
+ STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING);
   generator.GenerateFast(masm);
   __ Drop(3);
   __ Ret();
=======================================
--- /branches/bleeding_edge/src/code-stubs.h    Thu Oct 16 11:42:47 2014 UTC
+++ /branches/bleeding_edge/src/code-stubs.h    Fri Oct 17 16:23:31 2014 UTC
@@ -1803,7 +1803,7 @@
                         ReceiverCheckMode check_mode = RECEIVER_IS_UNKNOWN)
: char_code_at_generator_(object, index, scratch, receiver_not_string,
                                 index_not_number, index_out_of_range,
-                                index_flags),
+                                index_flags, check_mode),
         char_from_code_generator_(scratch, result) {}

   // Generates the fast case code. On the fallthrough path |result|
=======================================
--- /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Thu Oct 16 11:42:47 2014 UTC +++ /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Fri Oct 17 16:23:31 2014 UTC
@@ -702,8 +702,6 @@
   Register result = eax;
   DCHECK(!result.is(scratch));

-  // TODO(mvstanton): the generator doesn't need to verify that
-  // receiver is a string map, that is done outside the handler.
   StringCharAtGenerator char_at_generator(receiver, index, scratch, result,
                                           &miss,  // When not a string.
                                           &miss,  // When not a number.
@@ -3159,8 +3157,9 @@
   // ebx: instance type
   // ecx: sub string length (smi)
   // edx: from index (smi)
-  StringCharAtGenerator generator(
- eax, edx, ecx, eax, &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER);
+  StringCharAtGenerator generator(eax, edx, ecx, eax, &runtime, &runtime,
+                                  &runtime, STRING_INDEX_IS_NUMBER,
+                                  RECEIVER_IS_STRING);
   generator.GenerateFast(masm);
   __ ret(3 * kPointerSize);
   generator.SkipSlow(masm, &runtime);
=======================================
--- /branches/bleeding_edge/src/mips/code-stubs-mips.cc Thu Oct 16 16:25:27 2014 UTC +++ /branches/bleeding_edge/src/mips/code-stubs-mips.cc Fri Oct 17 16:23:31 2014 UTC
@@ -3332,8 +3332,8 @@
   // a2: length
   // a3: from index (untagged)
   __ SmiTag(a3, a3);
-  StringCharAtGenerator generator(
- v0, a3, a2, v0, &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER); + StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, + STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING);
   generator.GenerateFast(masm);
   __ DropAndRet(3);
   generator.SkipSlow(masm, &runtime);
=======================================
--- /branches/bleeding_edge/src/x64/code-stubs-x64.cc Thu Oct 16 12:27:35 2014 UTC +++ /branches/bleeding_edge/src/x64/code-stubs-x64.cc Fri Oct 17 16:23:31 2014 UTC
@@ -3106,8 +3106,9 @@
   // rbx: instance type
   // rcx: sub string length (smi)
   // rdx: from index (smi)
-  StringCharAtGenerator generator(
- rax, rdx, rcx, rax, &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER);
+  StringCharAtGenerator generator(rax, rdx, rcx, rax, &runtime, &runtime,
+                                  &runtime, STRING_INDEX_IS_NUMBER,
+                                  RECEIVER_IS_STRING);
   generator.GenerateFast(masm);
   __ ret(SUB_STRING_ARGUMENT_COUNT * kPointerSize);
   generator.SkipSlow(masm, &runtime);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to