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

Side by Side Diff: src/builtins/x64/builtins-x64.cc

Issue 2327703003: [builtins] Migrate ToNumber to TurboFan. (Closed)
Patch Set: Rebase Created 4 years, 3 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/builtins/s390/builtins-s390.cc ('k') | src/builtins/x87/builtins-x87.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 2199 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 // -- rdx : message_id as Smi 2210 // -- rdx : message_id as Smi
2211 // -- rsp[0] : return address 2211 // -- rsp[0] : return address
2212 // ----------------------------------- 2212 // -----------------------------------
2213 __ PopReturnAddressTo(rcx); 2213 __ PopReturnAddressTo(rcx);
2214 __ Push(rdx); 2214 __ Push(rdx);
2215 __ PushReturnAddressFrom(rcx); 2215 __ PushReturnAddressFrom(rcx);
2216 __ Move(rsi, Smi::FromInt(0)); 2216 __ Move(rsi, Smi::FromInt(0));
2217 __ TailCallRuntime(Runtime::kAbort); 2217 __ TailCallRuntime(Runtime::kAbort);
2218 } 2218 }
2219 2219
2220 // static
2221 void Builtins::Generate_ToNumber(MacroAssembler* masm) {
2222 // The ToNumber stub takes one argument in rax.
2223 Label not_smi;
2224 __ JumpIfNotSmi(rax, &not_smi, Label::kNear);
2225 __ Ret();
2226 __ bind(&not_smi);
2227
2228 Label not_heap_number;
2229 __ CompareRoot(FieldOperand(rax, HeapObject::kMapOffset),
2230 Heap::kHeapNumberMapRootIndex);
2231 __ j(not_equal, &not_heap_number, Label::kNear);
2232 __ Ret();
2233 __ bind(&not_heap_number);
2234
2235 __ Jump(masm->isolate()->builtins()->NonNumberToNumber(),
2236 RelocInfo::CODE_TARGET);
2237 }
2238
2239 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { 2220 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
2240 // ----------- S t a t e ------------- 2221 // ----------- S t a t e -------------
2241 // -- rax : actual number of arguments 2222 // -- rax : actual number of arguments
2242 // -- rbx : expected number of arguments 2223 // -- rbx : expected number of arguments
2243 // -- rdx : new target (passed through to callee) 2224 // -- rdx : new target (passed through to callee)
2244 // -- rdi : function (passed through to callee) 2225 // -- rdi : function (passed through to callee)
2245 // ----------------------------------- 2226 // -----------------------------------
2246 2227
2247 Label invoke, dont_adapt_arguments, stack_overflow; 2228 Label invoke, dont_adapt_arguments, stack_overflow;
2248 Counters* counters = masm->isolate()->counters(); 2229 Counters* counters = masm->isolate()->counters();
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
3134 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { 3115 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
3135 Generate_OnStackReplacementHelper(masm, true); 3116 Generate_OnStackReplacementHelper(masm, true);
3136 } 3117 }
3137 3118
3138 #undef __ 3119 #undef __
3139 3120
3140 } // namespace internal 3121 } // namespace internal
3141 } // namespace v8 3122 } // namespace v8
3142 3123
3143 #endif // V8_TARGET_ARCH_X64 3124 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/builtins/s390/builtins-s390.cc ('k') | src/builtins/x87/builtins-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698