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 | 6 |
7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
8 #include "src/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" |
9 #include "src/compiler/graph.h" | 9 #include "src/compiler/graph.h" |
10 #include "src/compiler/graph-visualizer.h" | 10 #include "src/compiler/graph-visualizer.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 static const int kNumLeafs = 4; | 33 static const int kNumLeafs = 4; |
34 | 34 |
35 // A helper for all tests dealing with LoopFinder. | 35 // A helper for all tests dealing with LoopFinder. |
36 class LoopFinderTester : HandleAndZoneScope { | 36 class LoopFinderTester : HandleAndZoneScope { |
37 public: | 37 public: |
38 LoopFinderTester() | 38 LoopFinderTester() |
39 : isolate(main_isolate()), | 39 : isolate(main_isolate()), |
40 common(main_zone()), | 40 common(main_zone()), |
41 graph(main_zone()), | 41 graph(main_zone()), |
42 jsgraph(&graph, &common, NULL, NULL), | 42 jsgraph(main_isolate(), &graph, &common, NULL, NULL), |
43 start(graph.NewNode(common.Start(1))), | 43 start(graph.NewNode(common.Start(1))), |
44 end(graph.NewNode(common.End(), start)), | 44 end(graph.NewNode(common.End(), start)), |
45 p0(graph.NewNode(common.Parameter(0), start)), | 45 p0(graph.NewNode(common.Parameter(0), start)), |
46 zero(jsgraph.Int32Constant(0)), | 46 zero(jsgraph.Int32Constant(0)), |
47 one(jsgraph.OneConstant()), | 47 one(jsgraph.OneConstant()), |
48 half(jsgraph.Constant(0.5)), | 48 half(jsgraph.Constant(0.5)), |
49 self(graph.NewNode(common.Int32Constant(0xaabbccdd))), | 49 self(graph.NewNode(common.Int32Constant(0xaabbccdd))), |
50 dead(graph.NewNode(common.Dead())), | 50 dead(graph.NewNode(common.Dead())), |
51 loop_tree(NULL) { | 51 loop_tree(NULL) { |
52 graph.SetEnd(end); | 52 graph.SetEnd(end); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 end->ReplaceInput(0, ret); | 120 end->ReplaceInput(0, ret); |
121 return ret; | 121 return ret; |
122 } | 122 } |
123 | 123 |
124 LoopTree* GetLoopTree() { | 124 LoopTree* GetLoopTree() { |
125 if (loop_tree == NULL) { | 125 if (loop_tree == NULL) { |
126 if (FLAG_trace_turbo_graph) { | 126 if (FLAG_trace_turbo_graph) { |
127 OFStream os(stdout); | 127 OFStream os(stdout); |
128 os << AsRPO(graph); | 128 os << AsRPO(graph); |
129 } | 129 } |
130 Zone zone(isolate); | 130 Zone zone; |
131 loop_tree = LoopFinder::BuildLoopTree(&graph, &zone); | 131 loop_tree = LoopFinder::BuildLoopTree(&graph, &zone); |
132 } | 132 } |
133 return loop_tree; | 133 return loop_tree; |
134 } | 134 } |
135 | 135 |
136 void CheckLoop(Node** header, int header_count, Node** body, int body_count) { | 136 void CheckLoop(Node** header, int header_count, Node** body, int body_count) { |
137 LoopTree* tree = GetLoopTree(); | 137 LoopTree* tree = GetLoopTree(); |
138 LoopTree::Loop* loop = tree->ContainingLoop(header[0]); | 138 LoopTree::Loop* loop = tree->ContainingLoop(header[0]); |
139 CHECK_NE(NULL, loop); | 139 CHECK_NE(NULL, loop); |
140 | 140 |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 TEST(LaManyChained_64) { RunManyChainedLoops_i(64); } | 968 TEST(LaManyChained_64) { RunManyChainedLoops_i(64); } |
969 | 969 |
970 TEST(LaManyNested_30) { RunManyNestedLoops_i(30); } | 970 TEST(LaManyNested_30) { RunManyNestedLoops_i(30); } |
971 TEST(LaManyNested_31) { RunManyNestedLoops_i(31); } | 971 TEST(LaManyNested_31) { RunManyNestedLoops_i(31); } |
972 TEST(LaManyNested_32) { RunManyNestedLoops_i(32); } | 972 TEST(LaManyNested_32) { RunManyNestedLoops_i(32); } |
973 TEST(LaManyNested_33) { RunManyNestedLoops_i(33); } | 973 TEST(LaManyNested_33) { RunManyNestedLoops_i(33); } |
974 TEST(LaManyNested_34) { RunManyNestedLoops_i(34); } | 974 TEST(LaManyNested_34) { RunManyNestedLoops_i(34); } |
975 TEST(LaManyNested_62) { RunManyNestedLoops_i(62); } | 975 TEST(LaManyNested_62) { RunManyNestedLoops_i(62); } |
976 TEST(LaManyNested_63) { RunManyNestedLoops_i(63); } | 976 TEST(LaManyNested_63) { RunManyNestedLoops_i(63); } |
977 TEST(LaManyNested_64) { RunManyNestedLoops_i(64); } | 977 TEST(LaManyNested_64) { RunManyNestedLoops_i(64); } |
OLD | NEW |