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

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

Issue 2302923002: [stubs] Port ToName stub to TurboFan. (Closed)
Patch Set: Addressed nits. Created 4 years, 3 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 2519 matching lines...) Expand 10 before | Expand all | Expand 10 after
2530 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE)); 2530 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
2531 __ Ret(USE_DELAY_SLOT); 2531 __ Ret(USE_DELAY_SLOT);
2532 __ ld(v0, FieldMemOperand(a0, Oddball::kToStringOffset)); 2532 __ ld(v0, FieldMemOperand(a0, Oddball::kToStringOffset));
2533 __ bind(&not_oddball); 2533 __ bind(&not_oddball);
2534 2534
2535 __ push(a0); // Push argument. 2535 __ push(a0); // Push argument.
2536 __ TailCallRuntime(Runtime::kToString); 2536 __ TailCallRuntime(Runtime::kToString);
2537 } 2537 }
2538 2538
2539 2539
2540 void ToNameStub::Generate(MacroAssembler* masm) {
2541 // The ToName stub takes on argument in a0.
2542 Label is_number;
2543 __ JumpIfSmi(a0, &is_number);
2544
2545 Label not_name;
2546 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
2547 __ GetObjectType(a0, a1, a1);
2548 // a0: receiver
2549 // a1: receiver instance type
2550 __ Branch(&not_name, gt, a1, Operand(LAST_NAME_TYPE));
2551 __ Ret(USE_DELAY_SLOT);
2552 __ mov(v0, a0);
2553 __ bind(&not_name);
2554
2555 Label not_heap_number;
2556 __ Branch(&not_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE));
2557 __ bind(&is_number);
2558 NumberToStringStub stub(isolate());
2559 __ TailCallStub(&stub);
2560 __ bind(&not_heap_number);
2561
2562 Label not_oddball;
2563 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
2564 __ Ret(USE_DELAY_SLOT);
2565 __ ld(v0, FieldMemOperand(a0, Oddball::kToStringOffset));
2566 __ bind(&not_oddball);
2567
2568 __ push(a0); // Push argument.
2569 __ TailCallRuntime(Runtime::kToName);
2570 }
2571
2572
2573 void StringHelper::GenerateFlatOneByteStringEquals( 2540 void StringHelper::GenerateFlatOneByteStringEquals(
2574 MacroAssembler* masm, Register left, Register right, Register scratch1, 2541 MacroAssembler* masm, Register left, Register right, Register scratch1,
2575 Register scratch2, Register scratch3) { 2542 Register scratch2, Register scratch3) {
2576 Register length = scratch1; 2543 Register length = scratch1;
2577 2544
2578 // Compare lengths. 2545 // Compare lengths.
2579 Label strings_not_equal, check_zero_length; 2546 Label strings_not_equal, check_zero_length;
2580 __ ld(length, FieldMemOperand(left, String::kLengthOffset)); 2547 __ ld(length, FieldMemOperand(left, String::kLengthOffset));
2581 __ ld(scratch2, FieldMemOperand(right, String::kLengthOffset)); 2548 __ ld(scratch2, FieldMemOperand(right, String::kLengthOffset));
2582 __ Branch(&check_zero_length, eq, length, Operand(scratch2)); 2549 __ Branch(&check_zero_length, eq, length, Operand(scratch2));
(...skipping 2852 matching lines...) Expand 10 before | Expand all | Expand 10 after
5435 kStackUnwindSpace, kInvalidStackOffset, 5402 kStackUnwindSpace, kInvalidStackOffset,
5436 return_value_operand, NULL); 5403 return_value_operand, NULL);
5437 } 5404 }
5438 5405
5439 #undef __ 5406 #undef __
5440 5407
5441 } // namespace internal 5408 } // namespace internal
5442 } // namespace v8 5409 } // namespace v8
5443 5410
5444 #endif // V8_TARGET_ARCH_MIPS64 5411 #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