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

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

Issue 2380973002: [stubs] replaced ToString MacroAssembler Stub with CodeStubAssembler builtin (Closed)
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/v8/v8 into ToStringTFStub Created 4 years, 2 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
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips64/code-stubs-mips64.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 2250 matching lines...) Expand 10 before | Expand all | Expand 10 after
2261 __ lbu(scratch, MemOperand(src)); 2261 __ lbu(scratch, MemOperand(src));
2262 __ Addu(src, src, Operand(1)); 2262 __ Addu(src, src, Operand(1));
2263 __ sb(scratch, MemOperand(dest)); 2263 __ sb(scratch, MemOperand(dest));
2264 __ Addu(dest, dest, Operand(1)); 2264 __ Addu(dest, dest, Operand(1));
2265 __ bind(&loop_entry); 2265 __ bind(&loop_entry);
2266 __ Branch(&loop, lt, dest, Operand(limit)); 2266 __ Branch(&loop, lt, dest, Operand(limit));
2267 2267
2268 __ bind(&done); 2268 __ bind(&done);
2269 } 2269 }
2270 2270
2271 void ToStringStub::Generate(MacroAssembler* masm) {
2272 // The ToString stub takes on argument in a0.
2273 Label is_number;
2274 __ JumpIfSmi(a0, &is_number);
2275
2276 Label not_string;
2277 __ GetObjectType(a0, a1, a1);
2278 // a0: receiver
2279 // a1: receiver instance type
2280 __ Branch(&not_string, ge, a1, Operand(FIRST_NONSTRING_TYPE));
2281 __ Ret(USE_DELAY_SLOT);
2282 __ mov(v0, a0);
2283 __ bind(&not_string);
2284
2285 Label not_heap_number;
2286 __ Branch(&not_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE));
2287 __ bind(&is_number);
2288 NumberToStringStub stub(isolate());
2289 __ TailCallStub(&stub);
2290 __ bind(&not_heap_number);
2291
2292 Label not_oddball;
2293 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
2294 __ Ret(USE_DELAY_SLOT);
2295 __ lw(v0, FieldMemOperand(a0, Oddball::kToStringOffset));
2296 __ bind(&not_oddball);
2297
2298 __ push(a0); // Push argument.
2299 __ TailCallRuntime(Runtime::kToString);
2300 }
2301
2302 2271
2303 void StringHelper::GenerateFlatOneByteStringEquals( 2272 void StringHelper::GenerateFlatOneByteStringEquals(
2304 MacroAssembler* masm, Register left, Register right, Register scratch1, 2273 MacroAssembler* masm, Register left, Register right, Register scratch1,
2305 Register scratch2, Register scratch3) { 2274 Register scratch2, Register scratch3) {
2306 Register length = scratch1; 2275 Register length = scratch1;
2307 2276
2308 // Compare lengths. 2277 // Compare lengths.
2309 Label strings_not_equal, check_zero_length; 2278 Label strings_not_equal, check_zero_length;
2310 __ lw(length, FieldMemOperand(left, String::kLengthOffset)); 2279 __ lw(length, FieldMemOperand(left, String::kLengthOffset));
2311 __ lw(scratch2, FieldMemOperand(right, String::kLengthOffset)); 2280 __ lw(scratch2, FieldMemOperand(right, String::kLengthOffset));
(...skipping 2829 matching lines...) Expand 10 before | Expand all | Expand 10 after
5141 kStackUnwindSpace, kInvalidStackOffset, 5110 kStackUnwindSpace, kInvalidStackOffset,
5142 return_value_operand, NULL); 5111 return_value_operand, NULL);
5143 } 5112 }
5144 5113
5145 #undef __ 5114 #undef __
5146 5115
5147 } // namespace internal 5116 } // namespace internal
5148 } // namespace v8 5117 } // namespace v8
5149 5118
5150 #endif // V8_TARGET_ARCH_MIPS 5119 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698