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.h" | 5 #include "src/compiler.h" |
6 | 6 |
7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
9 #include "src/compiler/js-operator.h" | 9 #include "src/compiler/js-operator.h" |
10 #include "src/compiler/js-type-feedback.h" | 10 #include "src/compiler/js-type-feedback.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 ~JSTypeFeedbackTest() override { dependencies_.Rollback(); } | 34 ~JSTypeFeedbackTest() override { dependencies_.Rollback(); } |
35 | 35 |
36 protected: | 36 protected: |
37 Reduction Reduce(Node* node) { | 37 Reduction Reduce(Node* node) { |
38 Handle<GlobalObject> global_object( | 38 Handle<GlobalObject> global_object( |
39 isolate()->native_context()->global_object(), isolate()); | 39 isolate()->native_context()->global_object(), isolate()); |
40 | 40 |
41 MachineOperatorBuilder machine(zone()); | 41 MachineOperatorBuilder machine(zone()); |
42 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine); | 42 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine); |
43 JSTypeFeedbackTable table(zone()); | 43 JSTypeFeedbackTable table(zone()); |
44 JSTypeFeedbackSpecializer reducer(&jsgraph, &table, nullptr, global_object, | 44 // TODO(titzer): mock the GraphReducer here for better unit testing. |
45 &dependencies_); | 45 GraphReducer graph_reducer(graph(), zone()); |
| 46 JSTypeFeedbackSpecializer reducer(&graph_reducer, &jsgraph, &table, nullptr, |
| 47 global_object, &dependencies_); |
46 return reducer.Reduce(node); | 48 return reducer.Reduce(node); |
47 } | 49 } |
48 | 50 |
49 Node* EmptyFrameState() { | 51 Node* EmptyFrameState() { |
50 MachineOperatorBuilder machine(zone()); | 52 MachineOperatorBuilder machine(zone()); |
51 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine); | 53 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &machine); |
52 return jsgraph.EmptyFrameState(); | 54 return jsgraph.EmptyFrameState(); |
53 } | 55 } |
54 | 56 |
55 JSOperatorBuilder* javascript() { return &javascript_; } | 57 JSOperatorBuilder* javascript() { return &javascript_; } |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 dependencies()->Rollback(); | 273 dependencies()->Rollback(); |
272 } else { | 274 } else { |
273 ASSERT_FALSE(r.Changed()); | 275 ASSERT_FALSE(r.Changed()); |
274 EXPECT_TRUE(dependencies()->IsEmpty()); | 276 EXPECT_TRUE(dependencies()->IsEmpty()); |
275 } | 277 } |
276 } | 278 } |
277 } | 279 } |
278 } | 280 } |
279 } | 281 } |
280 } | 282 } |
OLD | NEW |