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

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

Issue 2051113002: [stubs] ToNumberStub --> ToNumber builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix full-code on non-x64 platforms Created 4 years, 6 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/mips64/builtins-mips64.cc ('k') | src/ppc/builtins-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 2620 matching lines...) Expand 10 before | Expand all | Expand 10 after
2631 // a2: length 2631 // a2: length
2632 // a3: from index (untagged) 2632 // a3: from index (untagged)
2633 __ SmiTag(a3); 2633 __ SmiTag(a3);
2634 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, 2634 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime,
2635 RECEIVER_IS_STRING); 2635 RECEIVER_IS_STRING);
2636 generator.GenerateFast(masm); 2636 generator.GenerateFast(masm);
2637 __ DropAndRet(3); 2637 __ DropAndRet(3);
2638 generator.SkipSlow(masm, &runtime); 2638 generator.SkipSlow(masm, &runtime);
2639 } 2639 }
2640 2640
2641
2642 void ToNumberStub::Generate(MacroAssembler* masm) {
2643 // The ToNumber stub takes one argument in a0.
2644 Label not_smi;
2645 __ JumpIfNotSmi(a0, &not_smi);
2646 __ Ret(USE_DELAY_SLOT);
2647 __ mov(v0, a0);
2648 __ bind(&not_smi);
2649
2650 Label not_heap_number;
2651 __ GetObjectType(a0, a1, a1);
2652 // a0: receiver
2653 // a1: receiver instance type
2654 __ Branch(&not_heap_number, ne, a1, Operand(HEAP_NUMBER_TYPE));
2655 __ Ret(USE_DELAY_SLOT);
2656 __ mov(v0, a0);
2657 __ bind(&not_heap_number);
2658
2659 NonNumberToNumberStub stub(masm->isolate());
2660 __ TailCallStub(&stub);
2661 }
2662
2663 void NonNumberToNumberStub::Generate(MacroAssembler* masm) {
2664 // The NonNumberToNumber stub takes on argument in a0.
2665 __ AssertNotNumber(a0);
2666
2667 Label not_string;
2668 __ GetObjectType(a0, a1, a1);
2669 // a0: receiver
2670 // a1: receiver instance type
2671 __ Branch(&not_string, hs, a1, Operand(FIRST_NONSTRING_TYPE));
2672 __ Jump(isolate()->builtins()->StringToNumber(), RelocInfo::CODE_TARGET);
2673 __ bind(&not_string);
2674
2675 Label not_oddball;
2676 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
2677 __ Ret(USE_DELAY_SLOT);
2678 __ ld(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); // In delay slot.
2679 __ bind(&not_oddball);
2680
2681 __ Push(a0); // Push argument.
2682 __ TailCallRuntime(Runtime::kToNumber);
2683 }
2684
2685 void ToStringStub::Generate(MacroAssembler* masm) { 2641 void ToStringStub::Generate(MacroAssembler* masm) {
2686 // The ToString stub takes on argument in a0. 2642 // The ToString stub takes on argument in a0.
2687 Label is_number; 2643 Label is_number;
2688 __ JumpIfSmi(a0, &is_number); 2644 __ JumpIfSmi(a0, &is_number);
2689 2645
2690 Label not_string; 2646 Label not_string;
2691 __ GetObjectType(a0, a1, a1); 2647 __ GetObjectType(a0, a1, a1);
2692 // a0: receiver 2648 // a0: receiver
2693 // a1: receiver instance type 2649 // a1: receiver instance type
2694 __ Branch(&not_string, ge, a1, Operand(FIRST_NONSTRING_TYPE)); 2650 __ Branch(&not_string, ge, a1, Operand(FIRST_NONSTRING_TYPE));
(...skipping 2952 matching lines...) Expand 10 before | Expand all | Expand 10 after
5647 kStackUnwindSpace, kInvalidStackOffset, 5603 kStackUnwindSpace, kInvalidStackOffset,
5648 return_value_operand, NULL); 5604 return_value_operand, NULL);
5649 } 5605 }
5650 5606
5651 #undef __ 5607 #undef __
5652 5608
5653 } // namespace internal 5609 } // namespace internal
5654 } // namespace v8 5610 } // namespace v8
5655 5611
5656 #endif // V8_TARGET_ARCH_MIPS64 5612 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/builtins-mips64.cc ('k') | src/ppc/builtins-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698