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

Side by Side Diff: src/mips64/code-stubs-mips64.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/mips/code-stubs-mips.cc ('k') | src/ppc/code-stubs-ppc.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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
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/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2264 __ lbu(scratch, MemOperand(src)); 2264 __ lbu(scratch, MemOperand(src));
2265 __ daddiu(src, src, 1); 2265 __ daddiu(src, src, 1);
2266 __ sb(scratch, MemOperand(dest)); 2266 __ sb(scratch, MemOperand(dest));
2267 __ daddiu(dest, dest, 1); 2267 __ daddiu(dest, dest, 1);
2268 __ bind(&loop_entry); 2268 __ bind(&loop_entry);
2269 __ Branch(&loop, lt, dest, Operand(limit)); 2269 __ Branch(&loop, lt, dest, Operand(limit));
2270 2270
2271 __ bind(&done); 2271 __ bind(&done);
2272 } 2272 }
2273 2273
2274 void ToStringStub::Generate(MacroAssembler* masm) {
2275 // The ToString stub takes on argument in a0.
2276 Label is_number;
2277 __ JumpIfSmi(a0, &is_number);
2278
2279 Label not_string;
2280 __ GetObjectType(a0, a1, a1);
2281 // a0: receiver
2282 // a1: receiver instance type
2283 __ Branch(&not_string, ge, a1, Operand(FIRST_NONSTRING_TYPE));
2284 __ Ret(USE_DELAY_SLOT);
2285 __ mov(v0, a0);
2286 __ bind(&not_string);
2287
2288 Label not_heap_number;
2289 __ Branch(&not_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE));
2290 __ bind(&is_number);
2291 NumberToStringStub stub(isolate());
2292 __ TailCallStub(&stub);
2293 __ bind(&not_heap_number);
2294
2295 Label not_oddball;
2296 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
2297 __ Ret(USE_DELAY_SLOT);
2298 __ ld(v0, FieldMemOperand(a0, Oddball::kToStringOffset));
2299 __ bind(&not_oddball);
2300
2301 __ push(a0); // Push argument.
2302 __ TailCallRuntime(Runtime::kToString);
2303 }
2304
2305 2274
2306 void StringHelper::GenerateFlatOneByteStringEquals( 2275 void StringHelper::GenerateFlatOneByteStringEquals(
2307 MacroAssembler* masm, Register left, Register right, Register scratch1, 2276 MacroAssembler* masm, Register left, Register right, Register scratch1,
2308 Register scratch2, Register scratch3) { 2277 Register scratch2, Register scratch3) {
2309 Register length = scratch1; 2278 Register length = scratch1;
2310 2279
2311 // Compare lengths. 2280 // Compare lengths.
2312 Label strings_not_equal, check_zero_length; 2281 Label strings_not_equal, check_zero_length;
2313 __ ld(length, FieldMemOperand(left, String::kLengthOffset)); 2282 __ ld(length, FieldMemOperand(left, String::kLengthOffset));
2314 __ ld(scratch2, FieldMemOperand(right, String::kLengthOffset)); 2283 __ ld(scratch2, FieldMemOperand(right, String::kLengthOffset));
(...skipping 2853 matching lines...) Expand 10 before | Expand all | Expand 10 after
5168 kStackUnwindSpace, kInvalidStackOffset, 5137 kStackUnwindSpace, kInvalidStackOffset,
5169 return_value_operand, NULL); 5138 return_value_operand, NULL);
5170 } 5139 }
5171 5140
5172 #undef __ 5141 #undef __
5173 5142
5174 } // namespace internal 5143 } // namespace internal
5175 } // namespace v8 5144 } // namespace v8
5176 5145
5177 #endif // V8_TARGET_ARCH_MIPS64 5146 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698