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

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

Issue 2121753002: [turbofan] Robustify tail parameter stack size computations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix windows build Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/linkage.cc ('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 5468a32963ed3bc6197ecb49e3816d1f17b58801..fc5930af80144c987494a0f16847d390a92c04a8 100644
--- a/test/unittests/compiler/linkage-tail-call-unittest.cc
+++ b/test/unittests/compiler/linkage-tail-call-unittest.cc
@@ -54,8 +54,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);
- int stack_param_delta = 0;
- EXPECT_TRUE(desc->CanTailCall(node, &stack_param_delta));
+ EXPECT_TRUE(desc->CanTailCall(node));
+ const CallDescriptor* callee = CallDescriptorOf(node->op());
+ int stack_param_delta = callee->GetStackParameterDelta(desc);
EXPECT_EQ(0, stack_param_delta);
}
@@ -72,8 +73,8 @@ TEST_F(LinkageTailCall, SameReturn) {
CommonOperatorBuilder common(zone());
const Operator* op = common.Call(desc2);
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
- int stack_param_delta = 0;
- EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = desc2->GetStackParameterDelta(desc1);
EXPECT_EQ(0, stack_param_delta);
}
@@ -92,9 +93,7 @@ TEST_F(LinkageTailCall, DifferingReturn) {
CommonOperatorBuilder common(zone());
const Operator* op = common.Call(desc2);
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
- int stack_param_delta = 0;
- EXPECT_FALSE(desc1->CanTailCall(node, &stack_param_delta));
- EXPECT_EQ(0, stack_param_delta);
+ EXPECT_TRUE(!desc1->CanTailCall(node));
}
@@ -113,8 +112,8 @@ TEST_F(LinkageTailCall, MoreRegisterParametersCallee) {
CommonOperatorBuilder common(zone());
const Operator* op = common.Call(desc2);
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
- int stack_param_delta = 0;
- EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = desc2->GetStackParameterDelta(desc1);
EXPECT_EQ(0, stack_param_delta);
}
@@ -134,8 +133,8 @@ TEST_F(LinkageTailCall, MoreRegisterParametersCaller) {
CommonOperatorBuilder common(zone());
const Operator* op = common.Call(desc2);
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
- int stack_param_delta = 0;
- EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = desc2->GetStackParameterDelta(desc1);
EXPECT_EQ(0, stack_param_delta);
}
@@ -155,8 +154,8 @@ TEST_F(LinkageTailCall, MoreRegisterAndStackParametersCallee) {
CommonOperatorBuilder common(zone());
const Operator* op = common.Call(desc2);
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
- int stack_param_delta = 0;
- EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = desc2->GetStackParameterDelta(desc1);
EXPECT_EQ(1, stack_param_delta);
}
@@ -176,8 +175,8 @@ TEST_F(LinkageTailCall, MoreRegisterAndStackParametersCaller) {
CommonOperatorBuilder common(zone());
const Operator* op = common.Call(desc2);
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
- int stack_param_delta = 0;
- EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = desc2->GetStackParameterDelta(desc1);
EXPECT_EQ(-1, stack_param_delta);
}
@@ -202,8 +201,8 @@ TEST_F(LinkageTailCall, MatchingStackParameters) {
const Operator* op = common.Call(desc2);
Node* const node =
Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
- int stack_param_delta = 0;
- EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = desc2->GetStackParameterDelta(desc1);
EXPECT_EQ(0, stack_param_delta);
}
@@ -228,8 +227,8 @@ TEST_F(LinkageTailCall, NonMatchingStackParameters) {
const Operator* op = common.Call(desc2);
Node* const node =
Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
- int stack_param_delta = 0;
- EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = desc2->GetStackParameterDelta(desc1);
EXPECT_EQ(0, stack_param_delta);
}
@@ -255,8 +254,8 @@ TEST_F(LinkageTailCall, MatchingStackParametersExtraCallerRegisters) {
const Operator* op = common.Call(desc2);
Node* const node =
Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
- int stack_param_delta = 0;
- EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = desc2->GetStackParameterDelta(desc1);
EXPECT_EQ(0, stack_param_delta);
}
@@ -283,8 +282,8 @@ TEST_F(LinkageTailCall, MatchingStackParametersExtraCalleeRegisters) {
const Operator* op = common.Call(desc2);
Node* const node =
Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
- int stack_param_delta = 0;
- EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = desc2->GetStackParameterDelta(desc1);
EXPECT_EQ(0, stack_param_delta);
}
@@ -311,8 +310,8 @@ TEST_F(LinkageTailCall, MatchingStackParametersExtraCallerRegistersAndStack) {
const Operator* op = common.Call(desc2);
Node* const node =
Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
- int stack_param_delta = 0;
- EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = desc2->GetStackParameterDelta(desc1);
EXPECT_EQ(-1, stack_param_delta);
}
@@ -339,8 +338,8 @@ TEST_F(LinkageTailCall, MatchingStackParametersExtraCalleeRegistersAndStack) {
const Operator* op = common.Call(desc2);
Node* const node =
Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
- int stack_param_delta = 0;
- EXPECT_TRUE(desc1->CanTailCall(node, &stack_param_delta));
+ EXPECT_TRUE(desc1->CanTailCall(node));
+ int stack_param_delta = desc2->GetStackParameterDelta(desc1);
EXPECT_EQ(1, stack_param_delta);
}
« no previous file with comments | « src/compiler/linkage.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698