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

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

Issue 1609893003: [es6] Tail calls support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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
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 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after
2037 { 2037 {
2038 __ CompareRoot(rdx, Heap::kUndefinedValueRootIndex); 2038 __ CompareRoot(rdx, Heap::kUndefinedValueRootIndex);
2039 __ j(equal, masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); 2039 __ j(equal, masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
2040 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); 2040 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
2041 } 2041 }
2042 } 2042 }
2043 2043
2044 2044
2045 // static 2045 // static
2046 void Builtins::Generate_CallFunction(MacroAssembler* masm, 2046 void Builtins::Generate_CallFunction(MacroAssembler* masm,
2047 ConvertReceiverMode mode) { 2047 ConvertReceiverMode mode,
2048 TailCallMode tail_call_mode) {
2048 // ----------- S t a t e ------------- 2049 // ----------- S t a t e -------------
2049 // -- rax : the number of arguments (not including the receiver) 2050 // -- rax : the number of arguments (not including the receiver)
2050 // -- rdi : the function to call (checked to be a JSFunction) 2051 // -- rdi : the function to call (checked to be a JSFunction)
2051 // ----------------------------------- 2052 // -----------------------------------
2052 StackArgumentsAccessor args(rsp, rax); 2053 StackArgumentsAccessor args(rsp, rax);
2053 __ AssertFunction(rdi); 2054 __ AssertFunction(rdi);
2054 2055
2055 // ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList) 2056 // ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList)
2056 // Check that the function is not a "classConstructor". 2057 // Check that the function is not a "classConstructor".
2057 Label class_constructor; 2058 Label class_constructor;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
2133 } 2134 }
2134 __ bind(&done_convert); 2135 __ bind(&done_convert);
2135 2136
2136 // ----------- S t a t e ------------- 2137 // ----------- S t a t e -------------
2137 // -- rax : the number of arguments (not including the receiver) 2138 // -- rax : the number of arguments (not including the receiver)
2138 // -- rdx : the shared function info. 2139 // -- rdx : the shared function info.
2139 // -- rdi : the function to call (checked to be a JSFunction) 2140 // -- rdi : the function to call (checked to be a JSFunction)
2140 // -- rsi : the function context. 2141 // -- rsi : the function context.
2141 // ----------------------------------- 2142 // -----------------------------------
2142 2143
2144 if (tail_call_mode == TailCallMode::kAllow) {
2145 __ DropCurrentJSFrame(rax, rbx, rcx, r8);
Benedikt Meurer 2016/01/21 05:20:49 We need to check whether the debugger is active, a
Igor Sheludko 2016/01/21 14:37:08 Done.
2146 }
2147
2143 __ LoadSharedFunctionInfoSpecialField( 2148 __ LoadSharedFunctionInfoSpecialField(
2144 rbx, rdx, SharedFunctionInfo::kFormalParameterCountOffset); 2149 rbx, rdx, SharedFunctionInfo::kFormalParameterCountOffset);
2145 ParameterCount actual(rax); 2150 ParameterCount actual(rax);
2146 ParameterCount expected(rbx); 2151 ParameterCount expected(rbx);
2147 2152
2148 __ InvokeFunctionCode(rdi, no_reg, expected, actual, JUMP_FUNCTION, 2153 __ InvokeFunctionCode(rdi, no_reg, expected, actual, JUMP_FUNCTION,
2149 CheckDebugStepCallWrapper()); 2154 CheckDebugStepCallWrapper());
2150 2155
2151 // The function is a "classConstructor", need to raise an exception. 2156 // The function is a "classConstructor", need to raise an exception.
2152 __ bind(&class_constructor); 2157 __ bind(&class_constructor);
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
2615 __ ret(0); 2620 __ ret(0);
2616 } 2621 }
2617 2622
2618 2623
2619 #undef __ 2624 #undef __
2620 2625
2621 } // namespace internal 2626 } // namespace internal
2622 } // namespace v8 2627 } // namespace v8
2623 2628
2624 #endif // V8_TARGET_ARCH_X64 2629 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/parsing/parser.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | src/x64/macro-assembler-x64.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698