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

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 9625003: Tweaks to SubStringStub (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 6133 matching lines...) Expand 10 before | Expand all | Expand 10 after
6144 __ LoadRoot(t0, Heap::kEmptyStringRootIndex); 6144 __ LoadRoot(t0, Heap::kEmptyStringRootIndex);
6145 __ Branch(&runtime, ne, t1, Operand(t0)); 6145 __ Branch(&runtime, ne, t1, Operand(t0));
6146 __ lw(t1, FieldMemOperand(v0, ConsString::kFirstOffset)); 6146 __ lw(t1, FieldMemOperand(v0, ConsString::kFirstOffset));
6147 // Update instance type. 6147 // Update instance type.
6148 __ lw(a1, FieldMemOperand(t1, HeapObject::kMapOffset)); 6148 __ lw(a1, FieldMemOperand(t1, HeapObject::kMapOffset));
6149 __ lbu(a1, FieldMemOperand(a1, Map::kInstanceTypeOffset)); 6149 __ lbu(a1, FieldMemOperand(a1, Map::kInstanceTypeOffset));
6150 __ jmp(&underlying_unpacked); 6150 __ jmp(&underlying_unpacked);
6151 6151
6152 __ bind(&sliced_string); 6152 __ bind(&sliced_string);
6153 // Sliced string. Fetch parent and correct start index by offset. 6153 // Sliced string. Fetch parent and correct start index by offset.
6154 __ lw(t1, FieldMemOperand(v0, SlicedString::kParentOffset));
6154 __ lw(t0, FieldMemOperand(v0, SlicedString::kOffsetOffset)); 6155 __ lw(t0, FieldMemOperand(v0, SlicedString::kOffsetOffset));
6155 __ lw(t1, FieldMemOperand(v0, SlicedString::kParentOffset));
6156 __ sra(t0, t0, 1); // Add offset to index. 6156 __ sra(t0, t0, 1); // Add offset to index.
6157 __ Addu(a3, a3, t0); 6157 __ Addu(a3, a3, t0);
6158 // Update instance type. 6158 // Update instance type.
6159 __ lw(a1, FieldMemOperand(t1, HeapObject::kMapOffset)); 6159 __ lw(a1, FieldMemOperand(t1, HeapObject::kMapOffset));
6160 __ lbu(a1, FieldMemOperand(a1, Map::kInstanceTypeOffset)); 6160 __ lbu(a1, FieldMemOperand(a1, Map::kInstanceTypeOffset));
6161 __ jmp(&underlying_unpacked); 6161 __ jmp(&underlying_unpacked);
6162 6162
6163 __ bind(&seq_or_external_string); 6163 __ bind(&seq_or_external_string);
6164 // Sequential or external string. Just move string to the expected register. 6164 // Sequential or external string. Just move string to the expected register.
6165 __ mov(t1, v0); 6165 __ mov(t1, v0);
(...skipping 17 matching lines...) Expand all
6183 STATIC_ASSERT((kStringEncodingMask & kAsciiStringTag) != 0); 6183 STATIC_ASSERT((kStringEncodingMask & kAsciiStringTag) != 0);
6184 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); 6184 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0);
6185 __ And(t0, a1, Operand(kStringEncodingMask)); 6185 __ And(t0, a1, Operand(kStringEncodingMask));
6186 __ Branch(&two_byte_slice, eq, t0, Operand(zero_reg)); 6186 __ Branch(&two_byte_slice, eq, t0, Operand(zero_reg));
6187 __ AllocateAsciiSlicedString(v0, a2, t2, t3, &runtime); 6187 __ AllocateAsciiSlicedString(v0, a2, t2, t3, &runtime);
6188 __ jmp(&set_slice_header); 6188 __ jmp(&set_slice_header);
6189 __ bind(&two_byte_slice); 6189 __ bind(&two_byte_slice);
6190 __ AllocateTwoByteSlicedString(v0, a2, t2, t3, &runtime); 6190 __ AllocateTwoByteSlicedString(v0, a2, t2, t3, &runtime);
6191 __ bind(&set_slice_header); 6191 __ bind(&set_slice_header);
6192 __ sll(a3, a3, 1); 6192 __ sll(a3, a3, 1);
6193 __ sw(t1, FieldMemOperand(v0, SlicedString::kParentOffset));
6193 __ sw(a3, FieldMemOperand(v0, SlicedString::kOffsetOffset)); 6194 __ sw(a3, FieldMemOperand(v0, SlicedString::kOffsetOffset));
6194 __ sw(t1, FieldMemOperand(v0, SlicedString::kParentOffset));
6195 __ jmp(&return_v0); 6195 __ jmp(&return_v0);
6196 6196
6197 __ bind(&copy_routine); 6197 __ bind(&copy_routine);
6198 } 6198 }
6199 6199
6200 // t1: underlying subject string 6200 // t1: underlying subject string
6201 // a1: instance type of underlying subject string 6201 // a1: instance type of underlying subject string
6202 // a2: length 6202 // a2: length
6203 // a3: adjusted start index (untagged) 6203 // a3: adjusted start index (untagged)
6204 Label two_byte_sequential, sequential_string, allocate_result; 6204 Label two_byte_sequential, sequential_string, allocate_result;
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after
7669 __ Ret(USE_DELAY_SLOT); 7669 __ Ret(USE_DELAY_SLOT);
7670 __ mov(v0, a0); 7670 __ mov(v0, a0);
7671 } 7671 }
7672 7672
7673 7673
7674 #undef __ 7674 #undef __
7675 7675
7676 } } // namespace v8::internal 7676 } } // namespace v8::internal
7677 7677
7678 #endif // V8_TARGET_ARCH_MIPS 7678 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698