From d367c25c85a794efc762d97b64ce913446a5608d Mon Sep 17 00:00:00 2001 From: "weiliang.lin@intel.com" Date: Mon, 20 Oct 2014 04:12:53 +0000 Subject: [PATCH] X87: ReceiverCheckMode needs to be utilized further. port r24704. original commit message: 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. BUG= R=weiliang.lin@intel.com Review URL: https://codereview.chromium.org/664973002 Patch from Chunyang Dai . git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24714 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/x87/code-stubs-x87.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc index 690c370..946eda2 100644 --- a/src/x87/code-stubs-x87.cc +++ b/src/x87/code-stubs-x87.cc @@ -382,8 +382,6 @@ void LoadIndexedStringStub::Generate(MacroAssembler* masm) { 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. @@ -2848,8 +2846,9 @@ void SubStringStub::Generate(MacroAssembler* masm) { // 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); -- 2.7.4