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

Side by Side Diff: src/mips/code-stubs-mips.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_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 2473 matching lines...) Expand 10 before | Expand all | Expand 10 after
2484 // a3: from index (untagged) 2484 // a3: from index (untagged)
2485 __ SmiTag(a3, a3); 2485 __ SmiTag(a3, a3);
2486 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, 2486 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime,
2487 RECEIVER_IS_STRING); 2487 RECEIVER_IS_STRING);
2488 generator.GenerateFast(masm); 2488 generator.GenerateFast(masm);
2489 __ DropAndRet(3); 2489 __ DropAndRet(3);
2490 generator.SkipSlow(masm, &runtime); 2490 generator.SkipSlow(masm, &runtime);
2491 } 2491 }
2492 2492
2493 2493
2494 void ToStringStub::Generate(MacroAssembler* masm) {
2495 // The ToString stub takes on argument in a0.
2496 Label is_number;
2497 __ JumpIfSmi(a0, &is_number);
2498
2499 Label not_string;
2500 __ GetObjectType(a0, a1, a1);
2501 // a0: receiver
2502 // a1: receiver instance type
2503 __ Branch(&not_string, ge, a1, Operand(FIRST_NONSTRING_TYPE));
2504 __ Ret(USE_DELAY_SLOT);
2505 __ mov(v0, a0);
2506 __ bind(&not_string);
2507
2508 Label not_heap_number;
2509 __ Branch(&not_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE));
2510 __ bind(&is_number);
2511 NumberToStringStub stub(isolate());
2512 __ TailCallStub(&stub);
2513 __ bind(&not_heap_number);
2514
2515 Label not_oddball;
2516 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
2517 __ Ret(USE_DELAY_SLOT);
2518 __ lw(v0, FieldMemOperand(a0, Oddball::kToStringOffset));
2519 __ bind(&not_oddball);
2520
2521 __ push(a0); // Push argument.
2522 __ TailCallRuntime(Runtime::kToString);
2523 }
2524
2525
2526 void StringHelper::GenerateFlatOneByteStringEquals( 2494 void StringHelper::GenerateFlatOneByteStringEquals(
2527 MacroAssembler* masm, Register left, Register right, Register scratch1, 2495 MacroAssembler* masm, Register left, Register right, Register scratch1,
2528 Register scratch2, Register scratch3) { 2496 Register scratch2, Register scratch3) {
2529 Register length = scratch1; 2497 Register length = scratch1;
2530 2498
2531 // Compare lengths. 2499 // Compare lengths.
2532 Label strings_not_equal, check_zero_length; 2500 Label strings_not_equal, check_zero_length;
2533 __ lw(length, FieldMemOperand(left, String::kLengthOffset)); 2501 __ lw(length, FieldMemOperand(left, String::kLengthOffset));
2534 __ lw(scratch2, FieldMemOperand(right, String::kLengthOffset)); 2502 __ lw(scratch2, FieldMemOperand(right, String::kLengthOffset));
2535 __ Branch(&check_zero_length, eq, length, Operand(scratch2)); 2503 __ Branch(&check_zero_length, eq, length, Operand(scratch2));
(...skipping 2828 matching lines...) Expand 10 before | Expand all | Expand 10 after
5364 kStackUnwindSpace, kInvalidStackOffset, 5332 kStackUnwindSpace, kInvalidStackOffset,
5365 return_value_operand, NULL); 5333 return_value_operand, NULL);
5366 } 5334 }
5367 5335
5368 #undef __ 5336 #undef __
5369 5337
5370 } // namespace internal 5338 } // namespace internal
5371 } // namespace v8 5339 } // namespace v8
5372 5340
5373 #endif // V8_TARGET_ARCH_MIPS 5341 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698