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

Side by Side Diff: src/compiler/arm64/instruction-selector-arm64.cc

Issue 1216933011: [turbofan] Enable tail calls for %_CallFunction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix platform ports Created 5 years, 5 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/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/ia32/code-generator-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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/instruction-selector-impl.h" 5 #include "src/compiler/instruction-selector-impl.h"
6 #include "src/compiler/node-matchers.h" 6 #include "src/compiler/node-matchers.h"
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1445 1445
1446 1446
1447 void InstructionSelector::VisitTailCall(Node* node) { 1447 void InstructionSelector::VisitTailCall(Node* node) {
1448 Arm64OperandGenerator g(this); 1448 Arm64OperandGenerator g(this);
1449 const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node); 1449 const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node);
1450 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); 1450 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls);
1451 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); 1451 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite);
1452 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); 1452 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall);
1453 1453
1454 // TODO(turbofan): Relax restriction for stack parameters. 1454 // TODO(turbofan): Relax restriction for stack parameters.
1455 if (descriptor->UsesOnlyRegisters() && 1455 if (linkage()->GetIncomingDescriptor()->CanTailCall(node)) {
1456 descriptor->HasSameReturnLocationsAs(
1457 linkage()->GetIncomingDescriptor())) {
1458 CallBuffer buffer(zone(), descriptor, nullptr); 1456 CallBuffer buffer(zone(), descriptor, nullptr);
1459 1457
1460 // Compute InstructionOperands for inputs and outputs. 1458 // Compute InstructionOperands for inputs and outputs.
1461 // TODO(turbofan): on ARM64 it's probably better to use the code object in a 1459 // TODO(turbofan): on ARM64 it's probably better to use the code object in a
1462 // register if there are multiple uses of it. Improve constant pool and the 1460 // register if there are multiple uses of it. Improve constant pool and the
1463 // heuristics in the register allocator for where to emit constants. 1461 // heuristics in the register allocator for where to emit constants.
1464 InitializeCallBuffer(node, &buffer, true, false); 1462 InitializeCallBuffer(node, &buffer, true, false);
1465 1463
1466 DCHECK_EQ(0u, buffer.pushed_nodes.size());
1467
1468 // Select the appropriate opcode based on the call type. 1464 // Select the appropriate opcode based on the call type.
1469 InstructionCode opcode; 1465 InstructionCode opcode;
1470 switch (descriptor->kind()) { 1466 switch (descriptor->kind()) {
1471 case CallDescriptor::kCallCodeObject: 1467 case CallDescriptor::kCallCodeObject:
1472 opcode = kArchTailCallCodeObject; 1468 opcode = kArchTailCallCodeObject;
1473 break; 1469 break;
1474 case CallDescriptor::kCallJSFunction: 1470 case CallDescriptor::kCallJSFunction:
1475 opcode = kArchTailCallJSFunction; 1471 opcode = kArchTailCallJSFunction;
1476 break; 1472 break;
1477 default: 1473 default:
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
2036 MachineOperatorBuilder::kFloat64RoundTruncate | 2032 MachineOperatorBuilder::kFloat64RoundTruncate |
2037 MachineOperatorBuilder::kFloat64RoundTiesAway | 2033 MachineOperatorBuilder::kFloat64RoundTiesAway |
2038 MachineOperatorBuilder::kWord32ShiftIsSafe | 2034 MachineOperatorBuilder::kWord32ShiftIsSafe |
2039 MachineOperatorBuilder::kInt32DivIsSafe | 2035 MachineOperatorBuilder::kInt32DivIsSafe |
2040 MachineOperatorBuilder::kUint32DivIsSafe; 2036 MachineOperatorBuilder::kUint32DivIsSafe;
2041 } 2037 }
2042 2038
2043 } // namespace compiler 2039 } // namespace compiler
2044 } // namespace internal 2040 } // namespace internal
2045 } // namespace v8 2041 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698