OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 #include "test/cctest/cctest.h" | 6 #include "test/cctest/cctest.h" |
7 | 7 |
8 #include "src/compiler/access-builder.h" | 8 #include "src/compiler/access-builder.h" |
9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
10 #include "src/compiler/generic-node-inl.h" | 10 #include "src/compiler/generic-node-inl.h" |
(...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1881 Node* end = graph.NewNode(common.End(), ret, start); | 1881 Node* end = graph.NewNode(common.End(), ret, start); |
1882 | 1882 |
1883 graph.SetEnd(end); | 1883 graph.SetEnd(end); |
1884 | 1884 |
1885 Schedule* schedule = ComputeAndVerifySchedule(13, &graph); | 1885 Schedule* schedule = ComputeAndVerifySchedule(13, &graph); |
1886 // Make sure the true block is marked as deferred. | 1886 // Make sure the true block is marked as deferred. |
1887 CHECK(schedule->block(t)->deferred()); | 1887 CHECK(schedule->block(t)->deferred()); |
1888 CHECK(!schedule->block(f)->deferred()); | 1888 CHECK(!schedule->block(f)->deferred()); |
1889 } | 1889 } |
1890 | 1890 |
| 1891 |
| 1892 TEST(ScheduleTerminate) { |
| 1893 HandleAndZoneScope scope; |
| 1894 Graph graph(scope.main_zone()); |
| 1895 CommonOperatorBuilder common(scope.main_zone()); |
| 1896 |
| 1897 Node* start = graph.NewNode(common.Start(1)); |
| 1898 graph.SetStart(start); |
| 1899 |
| 1900 Node* loop = graph.NewNode(common.Loop(2), start, start); |
| 1901 loop->ReplaceInput(1, loop); // self loop, NTL. |
| 1902 |
| 1903 Node* effect = graph.NewNode(common.EffectPhi(1), start, loop); |
| 1904 effect->ReplaceInput(0, effect); |
| 1905 |
| 1906 Node* terminate = graph.NewNode(common.Terminate(1), effect, loop); |
| 1907 Node* end = graph.NewNode(common.End(), terminate); |
| 1908 |
| 1909 graph.SetEnd(end); |
| 1910 |
| 1911 Schedule* schedule = ComputeAndVerifySchedule(5, &graph); |
| 1912 BasicBlock* block = schedule->block(loop); |
| 1913 CHECK_NE(NULL, loop); |
| 1914 CHECK_EQ(block, schedule->block(effect)); |
| 1915 CHECK_GE(block->rpo_number(), 0); |
| 1916 } |
| 1917 |
1891 #endif | 1918 #endif |
OLD | NEW |