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/common-operator.h" | 8 #include "src/compiler/common-operator.h" |
9 #include "src/compiler/control-reducer.h" | 9 #include "src/compiler/control-reducer.h" |
10 #include "src/compiler/graph-inl.h" | 10 #include "src/compiler/graph-inl.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 Isolate* isolate; | 31 Isolate* isolate; |
32 CommonOperatorBuilder common; | 32 CommonOperatorBuilder common; |
33 Graph graph; | 33 Graph graph; |
34 JSGraph jsgraph; | 34 JSGraph jsgraph; |
35 Node* start; | 35 Node* start; |
36 Node* p0; | 36 Node* p0; |
37 Node* one; | 37 Node* one; |
38 Node* half; | 38 Node* half; |
39 | 39 |
40 void Trim() { ControlReducer::TrimGraph(&jsgraph); } | 40 void Trim() { ControlReducer::TrimGraph(main_zone(), &jsgraph); } |
41 }; | 41 }; |
42 | 42 |
43 | 43 |
44 bool IsUsedBy(Node* a, Node* b) { | 44 bool IsUsedBy(Node* a, Node* b) { |
45 for (UseIter i = a->uses().begin(); i != a->uses().end(); ++i) { | 45 for (UseIter i = a->uses().begin(); i != a->uses().end(); ++i) { |
46 if (b == *i) return true; | 46 if (b == *i) return true; |
47 } | 47 } |
48 return false; | 48 return false; |
49 } | 49 } |
50 | 50 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 T.jsgraph.UndefinedConstant(), T.jsgraph.TheHoleConstant(), | 233 T.jsgraph.UndefinedConstant(), T.jsgraph.TheHoleConstant(), |
234 T.jsgraph.TrueConstant(), T.jsgraph.FalseConstant(), | 234 T.jsgraph.TrueConstant(), T.jsgraph.FalseConstant(), |
235 T.jsgraph.NullConstant(), T.jsgraph.ZeroConstant(), | 235 T.jsgraph.NullConstant(), T.jsgraph.ZeroConstant(), |
236 T.jsgraph.OneConstant(), T.jsgraph.NaNConstant(), | 236 T.jsgraph.OneConstant(), T.jsgraph.NaNConstant(), |
237 T.jsgraph.Constant(21), T.jsgraph.Constant(22.2)}; | 237 T.jsgraph.Constant(21), T.jsgraph.Constant(22.2)}; |
238 | 238 |
239 for (size_t i = 0; i < arraysize(other_constants); i++) { | 239 for (size_t i = 0; i < arraysize(other_constants); i++) { |
240 CheckTrimConstant(&T, other_constants[i]); | 240 CheckTrimConstant(&T, other_constants[i]); |
241 } | 241 } |
242 } | 242 } |
OLD | NEW |