Revision: 10027
Author: [email protected]
Date: Fri Nov 18 01:13:01 2011
Log: 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
http://code.google.com/p/v8/source/detail?r=10027
Modified:
/branches/bleeding_edge/src/mips/code-stubs-mips.cc
=======================================
--- /branches/bleeding_edge/src/mips/code-stubs-mips.cc Thu Nov 17 05:27:58
2011
+++ /branches/bleeding_edge/src/mips/code-stubs-mips.cc Fri Nov 18 01:13:01
2011
@@ -6026,15 +6026,13 @@
// 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 @@
__ 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);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev