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

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

Issue 1439613003: [turbofan] Better and more sane support for tail calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Skip test in ignition configuration 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/tail-call-intrinsic.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/linkage-tail-call-unittest.cc
diff --git a/test/unittests/compiler/linkage-tail-call-unittest.cc b/test/unittests/compiler/linkage-tail-call-unittest.cc
index 5d24a3bd1da6963f2a5984eac10899205e9e6ca7..814f5efb8e684cd68a25b7a2ef6afa7fae19bb6e 100644
--- a/test/unittests/compiler/linkage-tail-call-unittest.cc
+++ b/test/unittests/compiler/linkage-tail-call-unittest.cc
@@ -55,7 +55,9 @@ TEST_F(LinkageTailCall, EmptyToEmpty) {
CommonOperatorBuilder common(zone());
const Operator* op = common.Call(desc);
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
- EXPECT_TRUE(desc->CanTailCall(node));
+ int stack_param_delta = 0;
+ EXPECT_TRUE(desc->CanTailCall(node, &stack_param_delta));
+ EXPECT_EQ(0, stack_param_delta);
}
@@ -71,7 +73,9 @@ TEST_F(LinkageTailCall, SameReturn) {
CommonOperatorBuilder common(zone());
const Operator* op = common.Call(desc2);
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
- EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = 0;
+ EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_EQ(0, stack_param_delta);
}
@@ -89,7 +93,9 @@ TEST_F(LinkageTailCall, DifferingReturn) {
CommonOperatorBuilder common(zone());
const Operator* op = common.Call(desc2);
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
- EXPECT_FALSE(desc1->CanTailCall(node));
+ int stack_param_delta = 0;
+ EXPECT_FALSE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_EQ(0, stack_param_delta);
}
@@ -108,7 +114,9 @@ TEST_F(LinkageTailCall, MoreRegisterParametersCallee) {
CommonOperatorBuilder common(zone());
const Operator* op = common.Call(desc2);
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
- EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = 0;
+ EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_EQ(0, stack_param_delta);
}
@@ -127,7 +135,9 @@ TEST_F(LinkageTailCall, MoreRegisterParametersCaller) {
CommonOperatorBuilder common(zone());
const Operator* op = common.Call(desc2);
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
- EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = 0;
+ EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_EQ(0, stack_param_delta);
}
@@ -146,7 +156,9 @@ TEST_F(LinkageTailCall, MoreRegisterAndStackParametersCallee) {
CommonOperatorBuilder common(zone());
const Operator* op = common.Call(desc2);
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
- EXPECT_FALSE(desc1->CanTailCall(node));
+ int stack_param_delta = 0;
+ EXPECT_FALSE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_EQ(1, stack_param_delta);
}
@@ -165,7 +177,9 @@ TEST_F(LinkageTailCall, MoreRegisterAndStackParametersCaller) {
CommonOperatorBuilder common(zone());
const Operator* op = common.Call(desc2);
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
- EXPECT_FALSE(desc1->CanTailCall(node));
+ int stack_param_delta = 0;
+ EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_EQ(-1, stack_param_delta);
}
@@ -189,7 +203,9 @@ TEST_F(LinkageTailCall, MatchingStackParameters) {
const Operator* op = common.Call(desc2);
Node* const node =
Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
- EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = 0;
+ EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_EQ(0, stack_param_delta);
}
@@ -213,7 +229,9 @@ TEST_F(LinkageTailCall, NonMatchingStackParameters) {
const Operator* op = common.Call(desc2);
Node* const node =
Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
- EXPECT_FALSE(desc1->CanTailCall(node));
+ int stack_param_delta = 0;
+ EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_EQ(0, stack_param_delta);
}
@@ -238,7 +256,9 @@ TEST_F(LinkageTailCall, MatchingStackParametersExtraCallerRegisters) {
const Operator* op = common.Call(desc2);
Node* const node =
Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
- EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = 0;
+ EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_EQ(0, stack_param_delta);
}
@@ -264,7 +284,9 @@ TEST_F(LinkageTailCall, MatchingStackParametersExtraCalleeRegisters) {
const Operator* op = common.Call(desc2);
Node* const node =
Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
- EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = 0;
+ EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_EQ(0, stack_param_delta);
}
@@ -290,7 +312,9 @@ TEST_F(LinkageTailCall, MatchingStackParametersExtraCallerRegistersAndStack) {
const Operator* op = common.Call(desc2);
Node* const node =
Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
- EXPECT_FALSE(desc1->CanTailCall(node));
+ int stack_param_delta = 0;
+ EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_EQ(-1, stack_param_delta);
}
@@ -316,7 +340,9 @@ TEST_F(LinkageTailCall, MatchingStackParametersExtraCalleeRegistersAndStack) {
const Operator* op = common.Call(desc2);
Node* const node =
Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
- EXPECT_FALSE(desc1->CanTailCall(node));
+ int stack_param_delta = 0;
+ EXPECT_FALSE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_EQ(1, stack_param_delta);
}
} // namespace compiler
« no previous file with comments | « test/mjsunit/tail-call-intrinsic.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698