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

Side by Side Diff: src/crankshaft/arm64/lithium-codegen-arm64.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/arm/lithium-codegen-arm.cc ('k') | src/crankshaft/ia32/lithium-codegen-ia32.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 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h"
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 __ Bind(&loop); 1525 __ Bind(&loop);
1526 __ Ldr(scratch, MemOperand(elements, length, SXTW, kPointerSizeLog2)); 1526 __ Ldr(scratch, MemOperand(elements, length, SXTW, kPointerSizeLog2));
1527 __ Push(scratch); 1527 __ Push(scratch);
1528 __ Subs(length, length, 1); 1528 __ Subs(length, length, 1);
1529 __ B(ne, &loop); 1529 __ B(ne, &loop);
1530 1530
1531 __ Bind(&invoke); 1531 __ Bind(&invoke);
1532 1532
1533 InvokeFlag flag = CALL_FUNCTION; 1533 InvokeFlag flag = CALL_FUNCTION;
1534 if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) { 1534 if (instr->hydrogen()->tail_call_mode() == TailCallMode::kAllow) {
1535 DCHECK(!info()->saves_caller_doubles());
1535 // TODO(ishell): drop current frame before pushing arguments to the stack. 1536 // TODO(ishell): drop current frame before pushing arguments to the stack.
1536 flag = JUMP_FUNCTION; 1537 flag = JUMP_FUNCTION;
1537 ParameterCount actual(x0); 1538 ParameterCount actual(x0);
1538 // It is safe to use x3, x4 and x5 as scratch registers here given that 1539 // It is safe to use x3, x4 and x5 as scratch registers here given that
1539 // 1) we are not going to return to caller function anyway, 1540 // 1) we are not going to return to caller function anyway,
1540 // 2) x3 (new.target) will be initialized below. 1541 // 2) x3 (new.target) will be initialized below.
1541 PrepareForTailCall(actual, x3, x4, x5); 1542 PrepareForTailCall(actual, x3, x4, x5);
1542 } 1543 }
1543 1544
1544 DCHECK(instr->HasPointerMap()); 1545 DCHECK(instr->HasPointerMap());
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after
2862 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { 2863 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
2863 HInvokeFunction* hinstr = instr->hydrogen(); 2864 HInvokeFunction* hinstr = instr->hydrogen();
2864 DCHECK(ToRegister(instr->context()).is(cp)); 2865 DCHECK(ToRegister(instr->context()).is(cp));
2865 // The function is required to be in x1. 2866 // The function is required to be in x1.
2866 DCHECK(ToRegister(instr->function()).is(x1)); 2867 DCHECK(ToRegister(instr->function()).is(x1));
2867 DCHECK(instr->HasPointerMap()); 2868 DCHECK(instr->HasPointerMap());
2868 2869
2869 bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow; 2870 bool is_tail_call = hinstr->tail_call_mode() == TailCallMode::kAllow;
2870 2871
2871 if (is_tail_call) { 2872 if (is_tail_call) {
2873 DCHECK(!info()->saves_caller_doubles());
2872 ParameterCount actual(instr->arity()); 2874 ParameterCount actual(instr->arity());
2873 // It is safe to use x3, x4 and x5 as scratch registers here given that 2875 // It is safe to use x3, x4 and x5 as scratch registers here given that
2874 // 1) we are not going to return to caller function anyway, 2876 // 1) we are not going to return to caller function anyway,
2875 // 2) x3 (new.target) will be initialized below. 2877 // 2) x3 (new.target) will be initialized below.
2876 PrepareForTailCall(actual, x3, x4, x5); 2878 PrepareForTailCall(actual, x3, x4, x5);
2877 } 2879 }
2878 2880
2879 Handle<JSFunction> known_function = hinstr->known_function(); 2881 Handle<JSFunction> known_function = hinstr->known_function();
2880 if (known_function.is_null()) { 2882 if (known_function.is_null()) {
2881 LPointerMap* pointers = instr->pointer_map(); 2883 LPointerMap* pointers = instr->pointer_map();
(...skipping 2854 matching lines...) Expand 10 before | Expand all | Expand 10 after
5736 5738
5737 5739
5738 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { 5740 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) {
5739 Register context = ToRegister(instr->context()); 5741 Register context = ToRegister(instr->context());
5740 __ Str(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); 5742 __ Str(context, MemOperand(fp, StandardFrameConstants::kContextOffset));
5741 } 5743 }
5742 5744
5743 5745
5744 } // namespace internal 5746 } // namespace internal
5745 } // namespace v8 5747 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/arm/lithium-codegen-arm.cc ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698