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

Side by Side Diff: src/ppc/builtins-ppc.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/code-stubs-mips64.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 2732 matching lines...) Expand 10 before | Expand all | Expand 10 after
2743 // -- r4 : requested object size (untagged) 2743 // -- r4 : requested object size (untagged)
2744 // -- lr : return address 2744 // -- lr : return address
2745 // ----------------------------------- 2745 // -----------------------------------
2746 __ SmiTag(r4); 2746 __ SmiTag(r4);
2747 __ LoadSmiLiteral(r5, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); 2747 __ LoadSmiLiteral(r5, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE)));
2748 __ Push(r4, r5); 2748 __ Push(r4, r5);
2749 __ LoadSmiLiteral(cp, Smi::FromInt(0)); 2749 __ LoadSmiLiteral(cp, Smi::FromInt(0));
2750 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); 2750 __ TailCallRuntime(Runtime::kAllocateInTargetSpace);
2751 } 2751 }
2752 2752
2753 // static
2754 void Builtins::Generate_StringToNumber(MacroAssembler* masm) {
2755 // The StringToNumber stub takes one argument in r3.
2756 __ AssertString(r3);
2757
2758 // Check if string has a cached array index.
2759 Label runtime;
2760 __ lwz(r5, FieldMemOperand(r3, String::kHashFieldOffset));
2761 __ And(r0, r5, Operand(String::kContainsCachedArrayIndexMask), SetRC);
2762 __ bne(&runtime, cr0);
2763 __ IndexFromHash(r5, r3);
2764 __ blr();
2765
2766 __ bind(&runtime);
2767 __ push(r3); // Push argument.
2768 __ TailCallRuntime(Runtime::kStringToNumber);
2769 }
2770
2753 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { 2771 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
2754 // ----------- S t a t e ------------- 2772 // ----------- S t a t e -------------
2755 // -- r3 : actual number of arguments 2773 // -- r3 : actual number of arguments
2756 // -- r4 : function (passed through to callee) 2774 // -- r4 : function (passed through to callee)
2757 // -- r5 : expected number of arguments 2775 // -- r5 : expected number of arguments
2758 // -- r6 : new target (passed through to callee) 2776 // -- r6 : new target (passed through to callee)
2759 // ----------------------------------- 2777 // -----------------------------------
2760 2778
2761 Label invoke, dont_adapt_arguments, stack_overflow; 2779 Label invoke, dont_adapt_arguments, stack_overflow;
2762 2780
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
2882 __ bkpt(0); 2900 __ bkpt(0);
2883 } 2901 }
2884 } 2902 }
2885 2903
2886 2904
2887 #undef __ 2905 #undef __
2888 } // namespace internal 2906 } // namespace internal
2889 } // namespace v8 2907 } // namespace v8
2890 2908
2891 #endif // V8_TARGET_ARCH_PPC 2909 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698