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

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

Issue 2050853003: [stubs] StringToNumberStub --> StringToNumber builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 2651 matching lines...) Expand 10 before | Expand all | Expand 10 after
2662 2662
2663 void NonNumberToNumberStub::Generate(MacroAssembler* masm) { 2663 void NonNumberToNumberStub::Generate(MacroAssembler* masm) {
2664 // The NonNumberToNumber stub takes on argument in a0. 2664 // The NonNumberToNumber stub takes on argument in a0.
2665 __ AssertNotNumber(a0); 2665 __ AssertNotNumber(a0);
2666 2666
2667 Label not_string; 2667 Label not_string;
2668 __ GetObjectType(a0, a1, a1); 2668 __ GetObjectType(a0, a1, a1);
2669 // a0: receiver 2669 // a0: receiver
2670 // a1: receiver instance type 2670 // a1: receiver instance type
2671 __ Branch(&not_string, hs, a1, Operand(FIRST_NONSTRING_TYPE)); 2671 __ Branch(&not_string, hs, a1, Operand(FIRST_NONSTRING_TYPE));
2672 StringToNumberStub stub(masm->isolate()); 2672 __ Jump(isolate()->builtins()->StringToNumber(), RelocInfo::CODE_TARGET);
2673 __ TailCallStub(&stub);
2674 __ bind(&not_string); 2673 __ bind(&not_string);
2675 2674
2676 Label not_oddball; 2675 Label not_oddball;
2677 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE)); 2676 __ Branch(&not_oddball, ne, a1, Operand(ODDBALL_TYPE));
2678 __ Ret(USE_DELAY_SLOT); 2677 __ Ret(USE_DELAY_SLOT);
2679 __ ld(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); // In delay slot. 2678 __ ld(v0, FieldMemOperand(a0, Oddball::kToNumberOffset)); // In delay slot.
2680 __ bind(&not_oddball); 2679 __ bind(&not_oddball);
2681 2680
2682 __ Push(a0); // Push argument. 2681 __ Push(a0); // Push argument.
2683 __ TailCallRuntime(Runtime::kToNumber); 2682 __ TailCallRuntime(Runtime::kToNumber);
2684 } 2683 }
2685 2684
2686 void StringToNumberStub::Generate(MacroAssembler* masm) {
2687 // The StringToNumber stub takes on argument in a0.
2688 __ AssertString(a0);
2689
2690 // Check if string has a cached array index.
2691 Label runtime;
2692 __ lwu(a2, FieldMemOperand(a0, String::kHashFieldOffset));
2693 __ And(at, a2, Operand(String::kContainsCachedArrayIndexMask));
2694 __ Branch(&runtime, ne, at, Operand(zero_reg));
2695 __ IndexFromHash(a2, v0);
2696 __ Ret();
2697
2698 __ bind(&runtime);
2699 __ Push(a0); // Push argument.
2700 __ TailCallRuntime(Runtime::kStringToNumber);
2701 }
2702
2703 void ToStringStub::Generate(MacroAssembler* masm) { 2685 void ToStringStub::Generate(MacroAssembler* masm) {
2704 // The ToString stub takes on argument in a0. 2686 // The ToString stub takes on argument in a0.
2705 Label is_number; 2687 Label is_number;
2706 __ JumpIfSmi(a0, &is_number); 2688 __ JumpIfSmi(a0, &is_number);
2707 2689
2708 Label not_string; 2690 Label not_string;
2709 __ GetObjectType(a0, a1, a1); 2691 __ GetObjectType(a0, a1, a1);
2710 // a0: receiver 2692 // a0: receiver
2711 // a1: receiver instance type 2693 // a1: receiver instance type
2712 __ Branch(&not_string, ge, a1, Operand(FIRST_NONSTRING_TYPE)); 2694 __ Branch(&not_string, ge, a1, Operand(FIRST_NONSTRING_TYPE));
(...skipping 2952 matching lines...) Expand 10 before | Expand all | Expand 10 after
5665 kStackUnwindSpace, kInvalidStackOffset, 5647 kStackUnwindSpace, kInvalidStackOffset,
5666 return_value_operand, NULL); 5648 return_value_operand, NULL);
5667 } 5649 }
5668 5650
5669 #undef __ 5651 #undef __
5670 5652
5671 } // namespace internal 5653 } // namespace internal
5672 } // namespace v8 5654 } // namespace v8
5673 5655
5674 #endif // V8_TARGET_ARCH_MIPS64 5656 #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