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

Unified Diff: test/unittests/compiler/live-range-unittest.cc

Issue 1318493005: [turbofan] relative_id of splinters and their children. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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/register-allocator.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/live-range-unittest.cc
diff --git a/test/unittests/compiler/live-range-unittest.cc b/test/unittests/compiler/live-range-unittest.cc
index a9ac20ca33e534d3bdb1ddffdf2d366e01e75a24..623721896ee3d2a28a992254dd87240d8f094f54 100644
--- a/test/unittests/compiler/live-range-unittest.cc
+++ b/test/unittests/compiler/live-range-unittest.cc
@@ -407,6 +407,33 @@ TEST_F(LiveRangeUnitTest, MergeAfterSplitting) {
}
+TEST_F(LiveRangeUnitTest, IDGeneration) {
+ TopLevelLiveRange* vreg = TestRangeBuilder(zone()).Id(2).Build(0, 100);
+ EXPECT_EQ(2, vreg->vreg());
+ EXPECT_EQ(0, vreg->relative_id());
+
+ TopLevelLiveRange* splinter =
+ new (zone()) TopLevelLiveRange(101, MachineType::kRepTagged);
+ vreg->Splinter(LifetimePosition::FromInt(4), LifetimePosition::FromInt(12),
+ splinter, zone());
+
+ EXPECT_EQ(101, splinter->vreg());
+ EXPECT_EQ(1, splinter->relative_id());
+
+ LiveRange* child = vreg->SplitAt(LifetimePosition::FromInt(50), zone());
+
+ EXPECT_EQ(2, child->relative_id());
+
+ LiveRange* splinter_child =
+ splinter->SplitAt(LifetimePosition::FromInt(8), zone());
+
+ EXPECT_EQ(1, splinter->relative_id());
+ EXPECT_EQ(3, splinter_child->relative_id());
+
+ vreg->Merge(splinter, zone());
+ EXPECT_EQ(1, splinter->relative_id());
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/register-allocator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698