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

Side by Side Diff: src/crankshaft/ia32/lithium-codegen-ia32.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
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_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.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 2913 matching lines...) Expand 10 before | Expand all | Expand 10 after
2924 __ bind(&loop); 2924 __ bind(&loop);
2925 __ push(Operand(elements, length, times_pointer_size, 1 * kPointerSize)); 2925 __ push(Operand(elements, length, times_pointer_size, 1 * kPointerSize));
2926 __ dec(length); 2926 __ dec(length);
2927 __ j(not_zero, &loop); 2927 __ j(not_zero, &loop);
2928 2928
2929 // Invoke the function. 2929 // Invoke the function.
2930 __ bind(&invoke); 2930 __ bind(&invoke);
2931 2931
2932 InvokeFlag flag = CALL_FUNCTION; 2932 InvokeFlag flag = CALL_FUNCTION;
2933 if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) { 2933 if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) {
2934 DCHECK(!info()->saves_caller_doubles());
2934 // TODO(ishell): drop current frame before pushing arguments to the stack. 2935 // TODO(ishell): drop current frame before pushing arguments to the stack.
2935 flag = JUMP_FUNCTION; 2936 flag = JUMP_FUNCTION;
2936 ParameterCount actual(eax); 2937 ParameterCount actual(eax);
2937 // It is safe to use ebx, ecx and edx as scratch registers here given that 2938 // It is safe to use ebx, ecx and edx as scratch registers here given that
2938 // 1) we are not going to return to caller function anyway, 2939 // 1) we are not going to return to caller function anyway,
2939 // 2) ebx (expected arguments count) and edx (new.target) will be 2940 // 2) ebx (expected arguments count) and edx (new.target) will be
2940 // initialized below. 2941 // initialized below.
2941 PrepareForTailCall(actual, ebx, ecx, edx); 2942 PrepareForTailCall(actual, ebx, ecx, edx);
2942 } 2943 }
2943 2944
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
3476 3477
3477 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { 3478 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
3478 HInvokeFunction* hinstr = instr->hydrogen(); 3479 HInvokeFunction* hinstr = instr->hydrogen();
3479 DCHECK(ToRegister(instr->context()).is(esi)); 3480 DCHECK(ToRegister(instr->context()).is(esi));
3480 DCHECK(ToRegister(instr->function()).is(edi)); 3481 DCHECK(ToRegister(instr->function()).is(edi));
3481 DCHECK(instr->HasPointerMap()); 3482 DCHECK(instr->HasPointerMap());
3482 3483
3483 bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow; 3484 bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow;
3484 3485
3485 if (is_tail_call) { 3486 if (is_tail_call) {
3487 DCHECK(!info()->saves_caller_doubles());
3486 ParameterCount actual(instr->arity()); 3488 ParameterCount actual(instr->arity());
3487 // It is safe to use ebx, ecx and edx as scratch registers here given that 3489 // It is safe to use ebx, ecx and edx as scratch registers here given that
3488 // 1) we are not going to return to caller function anyway, 3490 // 1) we are not going to return to caller function anyway,
3489 // 2) ebx (expected arguments count) and edx (new.target) will be 3491 // 2) ebx (expected arguments count) and edx (new.target) will be
3490 // initialized below. 3492 // initialized below.
3491 PrepareForTailCall(actual, ebx, ecx, edx); 3493 PrepareForTailCall(actual, ebx, ecx, edx);
3492 } 3494 }
3493 3495
3494 Handle<JSFunction> known_function = hinstr->known_function(); 3496 Handle<JSFunction> known_function = hinstr->known_function();
3495 if (known_function.is_null()) { 3497 if (known_function.is_null()) {
(...skipping 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after
5271 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), context); 5273 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), context);
5272 } 5274 }
5273 5275
5274 5276
5275 #undef __ 5277 #undef __
5276 5278
5277 } // namespace internal 5279 } // namespace internal
5278 } // namespace v8 5280 } // namespace v8
5279 5281
5280 #endif // V8_TARGET_ARCH_IA32 5282 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/crankshaft/arm64/lithium-codegen-arm64.cc ('k') | src/crankshaft/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698