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

Side by Side Diff: src/compiler/ia32/instruction-selector-ia32.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/ia32/code-generator-ia32.cc ('k') | src/compiler/js-generic-lowering.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/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 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 899
900 900
901 void InstructionSelector::VisitTailCall(Node* node) { 901 void InstructionSelector::VisitTailCall(Node* node) {
902 IA32OperandGenerator g(this); 902 IA32OperandGenerator g(this);
903 CallDescriptor const* descriptor = OpParameter<CallDescriptor const*>(node); 903 CallDescriptor const* descriptor = OpParameter<CallDescriptor const*>(node);
904 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls); 904 DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls);
905 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite); 905 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kPatchableCallSite);
906 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall); 906 DCHECK_EQ(0, descriptor->flags() & CallDescriptor::kNeedsNopAfterCall);
907 907
908 // TODO(turbofan): Relax restriction for stack parameters. 908 // TODO(turbofan): Relax restriction for stack parameters.
909 if (descriptor->UsesOnlyRegisters() && 909
910 descriptor->HasSameReturnLocationsAs( 910 if (linkage()->GetIncomingDescriptor()->CanTailCall(node)) {
911 linkage()->GetIncomingDescriptor())) {
912 CallBuffer buffer(zone(), descriptor, nullptr); 911 CallBuffer buffer(zone(), descriptor, nullptr);
913 912
914 // Compute InstructionOperands for inputs and outputs. 913 // Compute InstructionOperands for inputs and outputs.
915 InitializeCallBuffer(node, &buffer, true, true); 914 InitializeCallBuffer(node, &buffer, true, true);
916 915
917 DCHECK_EQ(0u, buffer.pushed_nodes.size());
918
919 // Select the appropriate opcode based on the call type. 916 // Select the appropriate opcode based on the call type.
920 InstructionCode opcode; 917 InstructionCode opcode;
921 switch (descriptor->kind()) { 918 switch (descriptor->kind()) {
922 case CallDescriptor::kCallCodeObject: 919 case CallDescriptor::kCallCodeObject:
923 opcode = kArchTailCallCodeObject; 920 opcode = kArchTailCallCodeObject;
924 break; 921 break;
925 case CallDescriptor::kCallJSFunction: 922 case CallDescriptor::kCallJSFunction:
926 opcode = kArchTailCallJSFunction; 923 opcode = kArchTailCallJSFunction;
927 break; 924 break;
928 default: 925 default:
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1341 if (CpuFeatures::IsSupported(SSE4_1)) { 1338 if (CpuFeatures::IsSupported(SSE4_1)) {
1342 flags |= MachineOperatorBuilder::kFloat64RoundDown | 1339 flags |= MachineOperatorBuilder::kFloat64RoundDown |
1343 MachineOperatorBuilder::kFloat64RoundTruncate; 1340 MachineOperatorBuilder::kFloat64RoundTruncate;
1344 } 1341 }
1345 return flags; 1342 return flags;
1346 } 1343 }
1347 1344
1348 } // namespace compiler 1345 } // namespace compiler
1349 } // namespace internal 1346 } // namespace internal
1350 } // namespace v8 1347 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698