From: yangguo@chromium.org Date: Fri, 18 Nov 2011 09:13:01 +0000 (+0000) Subject: MIPS: Change generated code for substring not to bail out to runtime system. X-Git-Tag: upstream/4.7.83~17884 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f0878c8424facb49edce5df94533af6c2979a044;p=platform%2Fupstream%2Fv8.git MIPS: Change generated code for substring not to bail out to runtime system. Port r10012 (09c6bcba81). Original commit message: There is no need to bail out to runtime system when creating sliced strings of external strings since the string content is unimportant. BUG= TEST= Review URL: http://codereview.chromium.org/8585041 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10027 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc index 423a2e9..dd1af02 100644 --- a/src/mips/code-stubs-mips.cc +++ b/src/mips/code-stubs-mips.cc @@ -6026,15 +6026,13 @@ void SubStringStub::Generate(MacroAssembler* masm) { // a3: from index (untagged smi) // t2 (a.k.a. to): to (smi) // t3 (a.k.a. from): from offset (smi) - Label allocate_slice, sliced_string, seq_string; - STATIC_ASSERT(kSeqStringTag == 0); - __ And(t4, a1, Operand(kStringRepresentationMask)); - __ Branch(&seq_string, eq, t4, Operand(zero_reg)); + Label allocate_slice, sliced_string, seq_or_external_string; + // If the string is not indirect, it can only be sequential or external. STATIC_ASSERT(kIsIndirectStringMask == (kSlicedStringTag & kConsStringTag)); STATIC_ASSERT(kIsIndirectStringMask != 0); __ And(t4, a1, Operand(kIsIndirectStringMask)); // External string. Jump to runtime. - __ Branch(&sub_string_runtime, eq, t4, Operand(zero_reg)); + __ Branch(&seq_or_external_string, eq, t4, Operand(zero_reg)); __ And(t4, a1, Operand(kSlicedNotConsMask)); __ Branch(&sliced_string, ne, t4, Operand(zero_reg)); @@ -6052,8 +6050,8 @@ void SubStringStub::Generate(MacroAssembler* masm) { __ lw(t1, FieldMemOperand(v0, SlicedString::kParentOffset)); __ jmp(&allocate_slice); - __ bind(&seq_string); - // Sequential string. Just move string to the right register. + __ bind(&seq_or_external_string); + // Sequential or external string. Just move string to the correct register. __ mov(t1, v0); __ bind(&allocate_slice);