| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/compiler/access-builder.h" | 5 #include "src/compiler/access-builder.h" |
| 6 #include "src/compiler/common-operator.h" | 6 #include "src/compiler/common-operator.h" |
| 7 #include "src/compiler/graph.h" | 7 #include "src/compiler/graph.h" |
| 8 #include "src/compiler/graph-visualizer.h" | 8 #include "src/compiler/graph-visualizer.h" |
| 9 #include "src/compiler/js-operator.h" | 9 #include "src/compiler/js-operator.h" |
| 10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
| (...skipping 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1959 Node* end = graph()->NewNode(common()->End(), ret, start); | 1959 Node* end = graph()->NewNode(common()->End(), ret, start); |
| 1960 | 1960 |
| 1961 graph()->SetEnd(end); | 1961 graph()->SetEnd(end); |
| 1962 | 1962 |
| 1963 Schedule* schedule = ComputeAndVerifySchedule(13, graph()); | 1963 Schedule* schedule = ComputeAndVerifySchedule(13, graph()); |
| 1964 // Make sure the true block is marked as deferred. | 1964 // Make sure the true block is marked as deferred. |
| 1965 CHECK(schedule->block(t)->deferred()); | 1965 CHECK(schedule->block(t)->deferred()); |
| 1966 CHECK(!schedule->block(f)->deferred()); | 1966 CHECK(!schedule->block(f)->deferred()); |
| 1967 } | 1967 } |
| 1968 | 1968 |
| 1969 | |
| 1970 TARGET_TEST_F(SchedulerTest, ScheduleTerminate) { | |
| 1971 Node* start = graph()->NewNode(common()->Start(1)); | |
| 1972 graph()->SetStart(start); | |
| 1973 | |
| 1974 Node* loop = graph()->NewNode(common()->Loop(2), start, start); | |
| 1975 loop->ReplaceInput(1, loop); // self loop, NTL. | |
| 1976 | |
| 1977 Node* effect = graph()->NewNode(common()->EffectPhi(1), start, loop); | |
| 1978 effect->ReplaceInput(0, effect); | |
| 1979 | |
| 1980 Node* terminate = graph()->NewNode(common()->Terminate(1), effect, loop); | |
| 1981 Node* end = graph()->NewNode(common()->End(), terminate); | |
| 1982 | |
| 1983 graph()->SetEnd(end); | |
| 1984 | |
| 1985 Schedule* schedule = ComputeAndVerifySchedule(6, graph()); | |
| 1986 BasicBlock* block = schedule->block(loop); | |
| 1987 CHECK_NE(NULL, loop); | |
| 1988 CHECK_EQ(block, schedule->block(effect)); | |
| 1989 CHECK_GE(block->rpo_number(), 0); | |
| 1990 } | |
| 1991 | |
| 1992 } // namespace compiler | 1969 } // namespace compiler |
| 1993 } // namespace internal | 1970 } // namespace internal |
| 1994 } // namespace v8 | 1971 } // namespace v8 |
| OLD | NEW |