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

Unified Diff: test/cctest/compiler/test-code-stub-assembler.cc

Issue 1811333002: Ensure Schedules generated by the RawMachineAssembler are in edge-split form (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review feedback Created 4 years, 9 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/schedule.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-code-stub-assembler.cc
diff --git a/test/cctest/compiler/test-code-stub-assembler.cc b/test/cctest/compiler/test-code-stub-assembler.cc
index 2bf785b422627c35a4b946aaec387cbe4575111d..adbc7e0eb1f329c91c11ca816cf4263c81241b35 100644
--- a/test/cctest/compiler/test-code-stub-assembler.cc
+++ b/test/cctest/compiler/test-code-stub-assembler.cc
@@ -331,6 +331,36 @@ TEST(JSFunction) {
CHECK_EQ(57, Handle<Smi>::cast(result.ToHandleChecked())->value());
}
+TEST(SplitEdgeBranchMerge) {
+ Isolate* isolate(CcTest::InitIsolateOnce());
+ VoidDescriptor descriptor(isolate);
+ CodeStubAssemblerTester m(isolate, descriptor);
+ CodeStubAssembler::Label l1(&m), merge(&m);
+ m.Branch(m.Int32Constant(1), &l1, &merge);
+ m.Bind(&l1);
+ m.Goto(&merge);
+ m.Bind(&merge);
+ USE(m.GenerateCode());
+}
+
+TEST(SplitEdgeSwitchMerge) {
+ Isolate* isolate(CcTest::InitIsolateOnce());
+ VoidDescriptor descriptor(isolate);
+ CodeStubAssemblerTester m(isolate, descriptor);
+ CodeStubAssembler::Label l1(&m), l2(&m), l3(&m), default_label(&m);
+ CodeStubAssembler::Label* labels[] = {&l1, &l2};
+ int32_t values[] = {1, 2};
+ m.Branch(m.Int32Constant(1), &l3, &l1);
+ m.Bind(&l3);
+ m.Switch(m.Int32Constant(2), &default_label, values, labels, 2);
+ m.Bind(&l1);
+ m.Goto(&l2);
+ m.Bind(&l2);
+ m.Goto(&default_label);
+ m.Bind(&default_label);
+ USE(m.GenerateCode());
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/schedule.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698