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

Side by Side Diff: src/x64/builtins-x64.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/ppc/code-stubs-ppc.cc ('k') | src/x64/code-stubs-x64.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_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/codegen.h" 8 #include "src/codegen.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 2058 matching lines...) Expand 10 before | Expand all | Expand 10 after
2069 // ----------------------------------- 2069 // -----------------------------------
2070 __ Integer32ToSmi(rdx, rdx); 2070 __ Integer32ToSmi(rdx, rdx);
2071 __ PopReturnAddressTo(rcx); 2071 __ PopReturnAddressTo(rcx);
2072 __ Push(rdx); 2072 __ Push(rdx);
2073 __ Push(Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); 2073 __ Push(Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE)));
2074 __ PushReturnAddressFrom(rcx); 2074 __ PushReturnAddressFrom(rcx);
2075 __ Move(rsi, Smi::FromInt(0)); 2075 __ Move(rsi, Smi::FromInt(0));
2076 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); 2076 __ TailCallRuntime(Runtime::kAllocateInTargetSpace);
2077 } 2077 }
2078 2078
2079 void Builtins::Generate_StringToNumber(MacroAssembler* masm) {
2080 // The StringToNumber stub takes one argument in rax.
2081 __ AssertString(rax);
2082
2083 // Check if string has a cached array index.
2084 Label runtime;
2085 __ testl(FieldOperand(rax, String::kHashFieldOffset),
2086 Immediate(String::kContainsCachedArrayIndexMask));
2087 __ j(not_zero, &runtime, Label::kNear);
2088 __ movl(rax, FieldOperand(rax, String::kHashFieldOffset));
2089 __ IndexFromHash(rax, rax);
2090 __ Ret();
2091
2092 __ bind(&runtime);
2093 __ PopReturnAddressTo(rcx); // Pop return address.
2094 __ Push(rax); // Push argument.
2095 __ PushReturnAddressFrom(rcx); // Push return address.
2096 __ TailCallRuntime(Runtime::kStringToNumber);
2097 }
2098
2079 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { 2099 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
2080 // ----------- S t a t e ------------- 2100 // ----------- S t a t e -------------
2081 // -- rax : actual number of arguments 2101 // -- rax : actual number of arguments
2082 // -- rbx : expected number of arguments 2102 // -- rbx : expected number of arguments
2083 // -- rdx : new target (passed through to callee) 2103 // -- rdx : new target (passed through to callee)
2084 // -- rdi : function (passed through to callee) 2104 // -- rdi : function (passed through to callee)
2085 // ----------------------------------- 2105 // -----------------------------------
2086 2106
2087 Label invoke, dont_adapt_arguments, stack_overflow; 2107 Label invoke, dont_adapt_arguments, stack_overflow;
2088 Counters* counters = masm->isolate()->counters(); 2108 Counters* counters = masm->isolate()->counters();
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
2961 __ ret(0); 2981 __ ret(0);
2962 } 2982 }
2963 2983
2964 2984
2965 #undef __ 2985 #undef __
2966 2986
2967 } // namespace internal 2987 } // namespace internal
2968 } // namespace v8 2988 } // namespace v8
2969 2989
2970 #endif // V8_TARGET_ARCH_X64 2990 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ppc/code-stubs-ppc.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698