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

Side by Side Diff: src/mips/builtins-mips.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/ia32/code-stubs-ia32.cc ('k') | src/mips/code-stubs-mips.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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 #include "src/codegen.h" 7 #include "src/codegen.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
(...skipping 2747 matching lines...) Expand 10 before | Expand all | Expand 10 after
2758 // -- a0 : requested object size (untagged) 2758 // -- a0 : requested object size (untagged)
2759 // -- ra : return address 2759 // -- ra : return address
2760 // ----------------------------------- 2760 // -----------------------------------
2761 __ SmiTag(a0); 2761 __ SmiTag(a0);
2762 __ Move(a1, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); 2762 __ Move(a1, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE)));
2763 __ Push(a0, a1); 2763 __ Push(a0, a1);
2764 __ Move(cp, Smi::FromInt(0)); 2764 __ Move(cp, Smi::FromInt(0));
2765 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); 2765 __ TailCallRuntime(Runtime::kAllocateInTargetSpace);
2766 } 2766 }
2767 2767
2768 // static
2769 void Builtins::Generate_StringToNumber(MacroAssembler* masm) {
2770 // The StringToNumber stub takes on argument in a0.
2771 __ AssertString(a0);
2772
2773 // Check if string has a cached array index.
2774 Label runtime;
2775 __ lw(a2, FieldMemOperand(a0, String::kHashFieldOffset));
2776 __ And(at, a2, Operand(String::kContainsCachedArrayIndexMask));
2777 __ Branch(&runtime, ne, at, Operand(zero_reg));
2778 __ IndexFromHash(a2, v0);
2779 __ Ret();
2780
2781 __ bind(&runtime);
2782 __ Push(a0); // Push argument.
2783 __ TailCallRuntime(Runtime::kStringToNumber);
2784 }
2785
2768 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { 2786 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
2769 // State setup as expected by MacroAssembler::InvokePrologue. 2787 // State setup as expected by MacroAssembler::InvokePrologue.
2770 // ----------- S t a t e ------------- 2788 // ----------- S t a t e -------------
2771 // -- a0: actual arguments count 2789 // -- a0: actual arguments count
2772 // -- a1: function (passed through to callee) 2790 // -- a1: function (passed through to callee)
2773 // -- a2: expected arguments count 2791 // -- a2: expected arguments count
2774 // -- a3: new target (passed through to callee) 2792 // -- a3: new target (passed through to callee)
2775 // ----------------------------------- 2793 // -----------------------------------
2776 2794
2777 Label invoke, dont_adapt_arguments, stack_overflow; 2795 Label invoke, dont_adapt_arguments, stack_overflow;
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2896 } 2914 }
2897 } 2915 }
2898 2916
2899 2917
2900 #undef __ 2918 #undef __
2901 2919
2902 } // namespace internal 2920 } // namespace internal
2903 } // namespace v8 2921 } // namespace v8
2904 2922
2905 #endif // V8_TARGET_ARCH_MIPS 2923 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698