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

Side by Side Diff: src/crankshaft/x64/lithium-codegen-x64.cc

Issue 1773173005: [crankshaft] Added checks to tail call instructions that we don't have to restore caller doubles. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@tco-turbo-3
Patch Set: Created 4 years, 9 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/crankshaft/ppc/lithium-codegen-ppc.cc ('k') | src/crankshaft/x87/lithium-codegen-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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/crankshaft/x64/lithium-codegen-x64.h" 7 #include "src/crankshaft/x64/lithium-codegen-x64.h"
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 3116 matching lines...) Expand 10 before | Expand all | Expand 10 after
3127 ARGUMENTS_DONT_CONTAIN_RECEIVER); 3127 ARGUMENTS_DONT_CONTAIN_RECEIVER);
3128 __ Push(args.GetArgumentOperand(0)); 3128 __ Push(args.GetArgumentOperand(0));
3129 __ decl(length); 3129 __ decl(length);
3130 __ j(not_zero, &loop); 3130 __ j(not_zero, &loop);
3131 3131
3132 // Invoke the function. 3132 // Invoke the function.
3133 __ bind(&invoke); 3133 __ bind(&invoke);
3134 3134
3135 InvokeFlag flag = CALL_FUNCTION; 3135 InvokeFlag flag = CALL_FUNCTION;
3136 if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) { 3136 if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) {
3137 DCHECK(!info()->saves_caller_doubles());
3137 // TODO(ishell): drop current frame before pushing arguments to the stack. 3138 // TODO(ishell): drop current frame before pushing arguments to the stack.
3138 flag = JUMP_FUNCTION; 3139 flag = JUMP_FUNCTION;
3139 ParameterCount actual(rax); 3140 ParameterCount actual(rax);
3140 // It is safe to use rbx, rcx and r8 as scratch registers here given that 3141 // It is safe to use rbx, rcx and r8 as scratch registers here given that
3141 // 1) we are not going to return to caller function anyway, 3142 // 1) we are not going to return to caller function anyway,
3142 // 2) rbx (expected number of arguments) will be initialized below. 3143 // 2) rbx (expected number of arguments) will be initialized below.
3143 PrepareForTailCall(actual, rbx, rcx, r8); 3144 PrepareForTailCall(actual, rbx, rcx, r8);
3144 } 3145 }
3145 3146
3146 DCHECK(instr->HasPointerMap()); 3147 DCHECK(instr->HasPointerMap());
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
3680 3681
3681 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { 3682 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
3682 HInvokeFunction* hinstr = instr->hydrogen(); 3683 HInvokeFunction* hinstr = instr->hydrogen();
3683 DCHECK(ToRegister(instr->context()).is(rsi)); 3684 DCHECK(ToRegister(instr->context()).is(rsi));
3684 DCHECK(ToRegister(instr->function()).is(rdi)); 3685 DCHECK(ToRegister(instr->function()).is(rdi));
3685 DCHECK(instr->HasPointerMap()); 3686 DCHECK(instr->HasPointerMap());
3686 3687
3687 bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow; 3688 bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow;
3688 3689
3689 if (is_tail_call) { 3690 if (is_tail_call) {
3691 DCHECK(!info()->saves_caller_doubles());
3690 ParameterCount actual(instr->arity()); 3692 ParameterCount actual(instr->arity());
3691 // It is safe to use rbx, rcx and r8 as scratch registers here given that 3693 // It is safe to use rbx, rcx and r8 as scratch registers here given that
3692 // 1) we are not going to return to caller function anyway, 3694 // 1) we are not going to return to caller function anyway,
3693 // 2) rbx (expected number of arguments) will be initialized below. 3695 // 2) rbx (expected number of arguments) will be initialized below.
3694 PrepareForTailCall(actual, rbx, rcx, r8); 3696 PrepareForTailCall(actual, rbx, rcx, r8);
3695 } 3697 }
3696 3698
3697 Handle<JSFunction> known_function = hinstr->known_function(); 3699 Handle<JSFunction> known_function = hinstr->known_function();
3698 if (known_function.is_null()) { 3700 if (known_function.is_null()) {
3699 LPointerMap* pointers = instr->pointer_map(); 3701 LPointerMap* pointers = instr->pointer_map();
(...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after
5581 __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), context); 5583 __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), context);
5582 } 5584 }
5583 5585
5584 5586
5585 #undef __ 5587 #undef __
5586 5588
5587 } // namespace internal 5589 } // namespace internal
5588 } // namespace v8 5590 } // namespace v8
5589 5591
5590 #endif // V8_TARGET_ARCH_X64 5592 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/crankshaft/ppc/lithium-codegen-ppc.cc ('k') | src/crankshaft/x87/lithium-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698