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

Unified Diff: test/unittests/compiler/scheduler-unittest.cc

Issue 944903002: Make sure exception handlers are deferred. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/scheduler.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/scheduler-unittest.cc
diff --git a/test/unittests/compiler/scheduler-unittest.cc b/test/unittests/compiler/scheduler-unittest.cc
index dbab3581334e05307ac0a145966724a6b5f43b28..afca98ca9b1fb109d0502886eeefea5dad168838 100644
--- a/test/unittests/compiler/scheduler-unittest.cc
+++ b/test/unittests/compiler/scheduler-unittest.cc
@@ -136,6 +136,8 @@ const Operator kHeapConstant(IrOpcode::kHeapConstant, Operator::kPure,
"HeapConstant", 0, 0, 0, 1, 0, 0);
const Operator kIntAdd(IrOpcode::kInt32Add, Operator::kPure, "Int32Add", 2, 0,
0, 1, 0, 0);
+const Operator kMockCall(IrOpcode::kCall, Operator::kNoProperties, "MockCall",
+ 0, 0, 1, 1, 0, 2);
} // namespace
@@ -1962,6 +1964,34 @@ TARGET_TEST_F(SchedulerTest, BranchHintFalse) {
}
+TARGET_TEST_F(SchedulerTest, CallException) {
+ Node* start = graph()->NewNode(common()->Start(1));
+ graph()->SetStart(start);
+
+ Node* p0 = graph()->NewNode(common()->Parameter(0), start);
+ Node* c1 = graph()->NewNode(&kMockCall, start);
+ Node* ok1 = graph()->NewNode(common()->IfSuccess(), c1);
+ Node* ex1 = graph()->NewNode(common()->IfException(), c1);
+ Node* c2 = graph()->NewNode(&kMockCall, ok1);
+ Node* ok2 = graph()->NewNode(common()->IfSuccess(), c2);
+ Node* ex2 = graph()->NewNode(common()->IfException(), c2);
+ Node* hdl = graph()->NewNode(common()->Merge(2), ex1, ex2);
+ Node* m = graph()->NewNode(common()->Merge(2), ok2, hdl);
+ Node* phi = graph()->NewNode(common()->Phi(kMachAnyTagged, 2), c2, p0, m);
+ Node* ret = graph()->NewNode(common()->Return(), phi, start, m);
+ Node* end = graph()->NewNode(common()->End(), ret);
+
+ graph()->SetEnd(end);
+
+ Schedule* schedule = ComputeAndVerifySchedule(17);
+ // Make sure the exception blocks as well as the handler are deferred.
+ EXPECT_TRUE(schedule->block(ex1)->deferred());
+ EXPECT_TRUE(schedule->block(ex2)->deferred());
+ EXPECT_TRUE(schedule->block(hdl)->deferred());
+ EXPECT_FALSE(schedule->block(m)->deferred());
+}
+
+
TARGET_TEST_F(SchedulerTest, Switch) {
Node* start = graph()->NewNode(common()->Start(1));
graph()->SetStart(start);
« no previous file with comments | « src/compiler/scheduler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698