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

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

Issue 1228463003: X87: [turbofan] Enable tail calls for %_CallRuntime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/x87/code-generator-x87.cc ('k') | no next file » | 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/base/adapters.h" 5 #include "src/base/adapters.h"
6 #include "src/compiler/instruction-selector-impl.h" 6 #include "src/compiler/instruction-selector-impl.h"
7 #include "src/compiler/node-matchers.h" 7 #include "src/compiler/node-matchers.h"
8 #include "src/compiler/node-properties.h" 8 #include "src/compiler/node-properties.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 883
884 884
885 void InstructionSelector::VisitTailCall(Node* node) { 885 void InstructionSelector::VisitTailCall(Node* node) {
886 X87OperandGenerator g(this); 886 X87OperandGenerator g(this);
887 CallDescriptor const* descriptor = OpParameter<CallDescriptor const*>(node); 887 CallDescriptor const* descriptor = OpParameter<CallDescriptor const*>(node);
888 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); 888 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls);
889 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); 889 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite);
890 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); 890 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall);
891 891
892 // TODO(turbofan): Relax restriction for stack parameters. 892 // TODO(turbofan): Relax restriction for stack parameters.
893 if (descriptor->UsesOnlyRegisters() && 893
894 descriptor->HasSameReturnLocationsAs( 894 if (linkage()->GetIncomingDescriptor()->CanTailCall(node)) {
895 linkage()->GetIncomingDescriptor())) {
896 CallBuffer buffer(zone(), descriptor, nullptr); 895 CallBuffer buffer(zone(), descriptor, nullptr);
897 896
898 // Compute InstructionOperands for inputs and outputs. 897 // Compute InstructionOperands for inputs and outputs.
899 InitializeCallBuffer(node, &buffer, true, true); 898 InitializeCallBuffer(node, &buffer, true, true);
900 899
901 DCHECK_EQ(0u, buffer.pushed_nodes.size());
902
903 // Select the appropriate opcode based on the call type. 900 // Select the appropriate opcode based on the call type.
904 InstructionCode opcode; 901 InstructionCode opcode;
905 switch (descriptor->kind()) { 902 switch (descriptor->kind()) {
906 case CallDescriptor::kCallCodeObject: 903 case CallDescriptor::kCallCodeObject:
907 opcode = kArchTailCallCodeObject; 904 opcode = kArchTailCallCodeObject;
908 break; 905 break;
909 case CallDescriptor::kCallJSFunction: 906 case CallDescriptor::kCallJSFunction:
910 opcode = kArchTailCallJSFunction; 907 opcode = kArchTailCallJSFunction;
911 break; 908 break;
912 default: 909 default:
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 MachineOperatorBuilder::kFloat32Min | 1329 MachineOperatorBuilder::kFloat32Min |
1333 MachineOperatorBuilder::kFloat64Max | 1330 MachineOperatorBuilder::kFloat64Max |
1334 MachineOperatorBuilder::kFloat64Min | 1331 MachineOperatorBuilder::kFloat64Min |
1335 MachineOperatorBuilder::kWord32ShiftIsSafe; 1332 MachineOperatorBuilder::kWord32ShiftIsSafe;
1336 return flags; 1333 return flags;
1337 } 1334 }
1338 1335
1339 } // namespace compiler 1336 } // namespace compiler
1340 } // namespace internal 1337 } // namespace internal
1341 } // namespace v8 1338 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/x87/code-generator-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698