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

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

Issue 2380973002: [stubs] replaced ToString MacroAssembler Stub with CodeStubAssembler builtin (Closed)
Patch Set: completely removed ToStringStub 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
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 2476 matching lines...) Expand 10 before | Expand all | Expand 10 after
2487 // a2: length 2487 // a2: length
2488 // a3: from index (untagged) 2488 // a3: from index (untagged)
2489 __ SmiTag(a3); 2489 __ SmiTag(a3);
2490 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, 2490 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime,
2491 RECEIVER_IS_STRING); 2491 RECEIVER_IS_STRING);
2492 generator.GenerateFast(masm); 2492 generator.GenerateFast(masm);
2493 __ DropAndRet(3); 2493 __ DropAndRet(3);
2494 generator.SkipSlow(masm, &runtime); 2494 generator.SkipSlow(masm, &runtime);
2495 } 2495 }
2496 2496
2497 void ToStringStub::Generate(MacroAssembler* masm) {
2498 // The ToString stub takes on argument in a0.
2499 Label is_number;
2500 __ JumpIfSmi(a0, &is_number);
2501
2502 Label not_string;
2503 __ GetObjectType(a0, a1, a1);
2504 // a0: receiver
2505 // a1: receiver instance type
2506 __ Branch(&not_string, ge, a1, Operand(FIRST_NONSTRING_TYPE));
2507 __ Ret(USE_DELAY_SLOT);
2508 __ mov(v0, a0);
2509 __ bind(&not_string);
2510
2511 Label not_heap_number;
2512 __ Branch(&not_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE));
2513 __ bind(&is_number);
2514 NumberToStringStub stub(isolate());
2515 __ TailCallStub(&stub);
2516 __ bind(&not_heap_number);
2517
2518 Label not_oddball;
2519 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
2520 __ Ret(USE_DELAY_SLOT);
2521 __ ld(v0, FieldMemOperand(a0, Oddball::kToStringOffset));
2522 __ bind(&not_oddball);
2523
2524 __ push(a0); // Push argument.
2525 __ TailCallRuntime(Runtime::kToString);
2526 }
2527
2528 2497
2529 void StringHelper::GenerateFlatOneByteStringEquals( 2498 void StringHelper::GenerateFlatOneByteStringEquals(
2530 MacroAssembler* masm, Register left, Register right, Register scratch1, 2499 MacroAssembler* masm, Register left, Register right, Register scratch1,
2531 Register scratch2, Register scratch3) { 2500 Register scratch2, Register scratch3) {
2532 Register length = scratch1; 2501 Register length = scratch1;
2533 2502
2534 // Compare lengths. 2503 // Compare lengths.
2535 Label strings_not_equal, check_zero_length; 2504 Label strings_not_equal, check_zero_length;
2536 __ ld(length, FieldMemOperand(left, String::kLengthOffset)); 2505 __ ld(length, FieldMemOperand(left, String::kLengthOffset));
2537 __ ld(scratch2, FieldMemOperand(right, String::kLengthOffset)); 2506 __ ld(scratch2, FieldMemOperand(right, String::kLengthOffset));
(...skipping 2853 matching lines...) Expand 10 before | Expand all | Expand 10 after
5391 kStackUnwindSpace, kInvalidStackOffset, 5360 kStackUnwindSpace, kInvalidStackOffset,
5392 return_value_operand, NULL); 5361 return_value_operand, NULL);
5393 } 5362 }
5394 5363
5395 #undef __ 5364 #undef __
5396 5365
5397 } // namespace internal 5366 } // namespace internal
5398 } // namespace v8 5367 } // namespace v8
5399 5368
5400 #endif // V8_TARGET_ARCH_MIPS64 5369 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698