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" |
11 #include "src/compiler/opcodes.h" | 11 #include "src/compiler/opcodes.h" |
12 #include "src/compiler/operator.h" | 12 #include "src/compiler/operator.h" |
13 #include "src/compiler/schedule.h" | 13 #include "src/compiler/schedule.h" |
14 #include "src/compiler/scheduler.h" | 14 #include "src/compiler/scheduler.h" |
15 #include "src/compiler/simplified-operator.h" | 15 #include "src/compiler/simplified-operator.h" |
| 16 #include "src/compiler/source-position.h" |
16 #include "src/compiler/verifier.h" | 17 #include "src/compiler/verifier.h" |
17 #include "test/unittests/compiler/compiler-test-utils.h" | 18 #include "test/unittests/compiler/compiler-test-utils.h" |
18 #include "test/unittests/test-utils.h" | 19 #include "test/unittests/test-utils.h" |
19 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
20 | 21 |
21 using testing::AnyOf; | 22 using testing::AnyOf; |
22 | 23 |
23 namespace v8 { | 24 namespace v8 { |
24 namespace internal { | 25 namespace internal { |
25 namespace compiler { | 26 namespace compiler { |
26 | 27 |
27 class SchedulerTest : public TestWithIsolateAndZone { | 28 class SchedulerTest : public TestWithIsolateAndZone { |
28 public: | 29 public: |
29 SchedulerTest() | 30 SchedulerTest() |
30 : graph_(zone()), common_(zone()), simplified_(zone()), js_(zone()) {} | 31 : graph_(zone()), common_(zone()), simplified_(zone()), js_(zone()) {} |
31 | 32 |
32 Schedule* ComputeAndVerifySchedule(size_t expected) { | 33 Schedule* ComputeAndVerifySchedule(size_t expected) { |
33 if (FLAG_trace_turbo) { | 34 if (FLAG_trace_turbo) { |
34 OFStream os(stdout); | 35 OFStream os(stdout); |
35 os << AsDOT(*graph()); | 36 SourcePositionTable table(graph()); |
| 37 os << AsJSON(*graph(), &table); |
36 } | 38 } |
37 | 39 |
38 Schedule* schedule = | 40 Schedule* schedule = |
39 Scheduler::ComputeSchedule(zone(), graph(), Scheduler::kSplitNodes); | 41 Scheduler::ComputeSchedule(zone(), graph(), Scheduler::kSplitNodes); |
40 | 42 |
41 if (FLAG_trace_turbo_scheduler) { | 43 if (FLAG_trace_turbo_scheduler) { |
42 OFStream os(stdout); | 44 OFStream os(stdout); |
43 os << *schedule << std::endl; | 45 os << *schedule << std::endl; |
44 } | 46 } |
45 ScheduleVerifier::Run(schedule); | 47 ScheduleVerifier::Run(schedule); |
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 | 1155 |
1154 Schedule* schedule = ComputeAndVerifySchedule(6); | 1156 Schedule* schedule = ComputeAndVerifySchedule(6); |
1155 BasicBlock* block = schedule->block(loop); | 1157 BasicBlock* block = schedule->block(loop); |
1156 EXPECT_EQ(block, schedule->block(effect)); | 1158 EXPECT_EQ(block, schedule->block(effect)); |
1157 EXPECT_GE(block->rpo_number(), 0); | 1159 EXPECT_GE(block->rpo_number(), 0); |
1158 } | 1160 } |
1159 | 1161 |
1160 } // namespace compiler | 1162 } // namespace compiler |
1161 } // namespace internal | 1163 } // namespace internal |
1162 } // namespace v8 | 1164 } // namespace v8 |
OLD | NEW |