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

Side by Side Diff: test/unittests/compiler/linkage-tail-call-unittest.cc

Issue 1455833004: [turbofan]: Implement tail calls with more callee than caller parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove stray change Created 5 years, 1 month 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
« src/compiler/linkage.h ('K') | « test/mjsunit/tail-call-intrinsic.js ('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/compiler/common-operator.h" 5 #include "src/compiler/common-operator.h"
6 #include "src/compiler/graph.h" 6 #include "src/compiler/graph.h"
7 #include "src/compiler/linkage.h" 7 #include "src/compiler/linkage.h"
8 #include "src/compiler/node.h" 8 #include "src/compiler/node.h"
9 #include "test/unittests/test-utils.h" 9 #include "test/unittests/test-utils.h"
10 10
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // Callee 150 // Callee
151 LinkageLocation location_array2[] = {RegisterLocation(0), RegisterLocation(0), 151 LinkageLocation location_array2[] = {RegisterLocation(0), RegisterLocation(0),
152 RegisterLocation(1), StackLocation(1)}; 152 RegisterLocation(1), StackLocation(1)};
153 LocationSignature locations2(1, 3, location_array2); 153 LocationSignature locations2(1, 3, location_array2);
154 CallDescriptor* desc2 = NewStandardCallDescriptor(&locations2); 154 CallDescriptor* desc2 = NewStandardCallDescriptor(&locations2);
155 155
156 CommonOperatorBuilder common(zone()); 156 CommonOperatorBuilder common(zone());
157 const Operator* op = common.Call(desc2); 157 const Operator* op = common.Call(desc2);
158 Node* const node = Node::New(zone(), 1, op, 0, nullptr, false); 158 Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
159 int stack_param_delta = 0; 159 int stack_param_delta = 0;
160 EXPECT_FALSE(desc1->CanTailCall(node, &stack_param_delta)); 160 EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
161 EXPECT_EQ(1, stack_param_delta); 161 EXPECT_EQ(1, stack_param_delta);
162 } 162 }
163 163
164 164
165 TEST_F(LinkageTailCall, MoreRegisterAndStackParametersCaller) { 165 TEST_F(LinkageTailCall, MoreRegisterAndStackParametersCaller) {
166 // Caller 166 // Caller
167 LinkageLocation location_array[] = {RegisterLocation(0), RegisterLocation(0), 167 LinkageLocation location_array[] = {RegisterLocation(0), RegisterLocation(0),
168 RegisterLocation(1), StackLocation(1)}; 168 RegisterLocation(1), StackLocation(1)};
169 LocationSignature locations1(1, 3, location_array); 169 LocationSignature locations1(1, 3, location_array);
170 CallDescriptor* desc1 = NewStandardCallDescriptor(&locations1); 170 CallDescriptor* desc1 = NewStandardCallDescriptor(&locations1);
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 Node* p0 = Node::New(zone(), 0, nullptr, 0, nullptr, false); 334 Node* p0 = Node::New(zone(), 0, nullptr, 0, nullptr, false);
335 Node* p1 = Node::New(zone(), 0, common.Parameter(0), 0, nullptr, false); 335 Node* p1 = Node::New(zone(), 0, common.Parameter(0), 0, nullptr, false);
336 Node* p2 = Node::New(zone(), 0, common.Parameter(1), 0, nullptr, false); 336 Node* p2 = Node::New(zone(), 0, common.Parameter(1), 0, nullptr, false);
337 Node* p3 = Node::New(zone(), 0, common.Parameter(2), 0, nullptr, false); 337 Node* p3 = Node::New(zone(), 0, common.Parameter(2), 0, nullptr, false);
338 Node* p4 = Node::New(zone(), 0, common.Parameter(3), 0, nullptr, false); 338 Node* p4 = Node::New(zone(), 0, common.Parameter(3), 0, nullptr, false);
339 Node* parameters[] = {p0, p1, p2, p3, p4}; 339 Node* parameters[] = {p0, p1, p2, p3, p4};
340 const Operator* op = common.Call(desc2); 340 const Operator* op = common.Call(desc2);
341 Node* const node = 341 Node* const node =
342 Node::New(zone(), 1, op, arraysize(parameters), parameters, false); 342 Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
343 int stack_param_delta = 0; 343 int stack_param_delta = 0;
344 EXPECT_FALSE(desc1->CanTailCall(node, &stack_param_delta)); 344 EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
345 EXPECT_EQ(1, stack_param_delta); 345 EXPECT_EQ(1, stack_param_delta);
346 } 346 }
347 347
348 } // namespace compiler 348 } // namespace compiler
349 } // namespace internal 349 } // namespace internal
350 } // namespace v8 350 } // namespace v8
OLDNEW
« src/compiler/linkage.h ('K') | « test/mjsunit/tail-call-intrinsic.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698