Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Unified Diff: src/x64/code-stubs-x64.cc

Issue 8513016: Change generated code for substring not to bail out to runtime system. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/ia32/code-stubs-ia32.cc ('K') | « src/ia32/code-stubs-ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index bf50869ed90f1a381160756ecacbd633c456a1b2..30287e2f17180dccfa09bc82c94028196cccc587 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -4912,18 +4912,14 @@ void SubStringStub::Generate(MacroAssembler* masm) {
// rbx: instance type
// rcx: sub string length
// rdx: from index (smi)
- Label allocate_slice, sliced_string, seq_string;
+ Label allocate_slice, sliced_string, seq_or_external_string;
__ cmpq(rcx, Immediate(SlicedString::kMinLength));
// Short slice. Copy instead of slicing.
__ j(less, &copy_routine);
- STATIC_ASSERT(kSeqStringTag == 0);
- __ testb(rbx, Immediate(kStringRepresentationMask));
- __ j(zero, &seq_string, Label::kNear);
STATIC_ASSERT(kIsIndirectStringMask == (kSlicedStringTag & kConsStringTag));
STATIC_ASSERT(kIsIndirectStringMask != 0);
__ testb(rbx, Immediate(kIsIndirectStringMask));
- // External string. Jump to runtime.
- __ j(zero, &runtime);
+ __ j(zero, &seq_or_external_string, Label::kNear);
__ testb(rbx, Immediate(kSlicedNotConsMask));
__ j(not_zero, &sliced_string, Label::kNear);
@@ -4940,8 +4936,8 @@ void SubStringStub::Generate(MacroAssembler* masm) {
__ movq(rdi, FieldOperand(rax, SlicedString::kParentOffset));
__ jmp(&allocate_slice, Label::kNear);
- __ 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.
__ movq(rdi, rax);
__ bind(&allocate_slice);
« src/ia32/code-stubs-ia32.cc ('K') | « src/ia32/code-stubs-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698