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 "test/unittests/compiler/graph-unittest.h" | 5 #include "test/unittests/compiler/graph-unittest.h" |
6 | 6 |
7 #include <ostream> // NOLINT(readability/streams) | |
8 | |
9 #include "src/compiler/node-properties-inl.h" | 7 #include "src/compiler/node-properties-inl.h" |
10 #include "test/unittests/compiler/node-test-utils.h" | 8 #include "test/unittests/compiler/node-test-utils.h" |
11 | 9 |
12 namespace v8 { | 10 namespace v8 { |
13 namespace internal { | 11 namespace internal { |
14 namespace compiler { | 12 namespace compiler { |
15 | 13 |
16 GraphTest::GraphTest(int num_parameters) : common_(zone()), graph_(zone()) { | 14 GraphTest::GraphTest(int num_parameters) : common_(zone()), graph_(zone()) { |
17 graph()->SetStart(graph()->NewNode(common()->Start(num_parameters))); | 15 graph()->SetStart(graph()->NewNode(common()->Start(num_parameters))); |
18 } | 16 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 return IsHeapConstant( | 84 return IsHeapConstant( |
87 Unique<HeapObject>::CreateImmovable(factory()->false_value())); | 85 Unique<HeapObject>::CreateImmovable(factory()->false_value())); |
88 } | 86 } |
89 | 87 |
90 | 88 |
91 Matcher<Node*> GraphTest::IsTrueConstant() { | 89 Matcher<Node*> GraphTest::IsTrueConstant() { |
92 return IsHeapConstant( | 90 return IsHeapConstant( |
93 Unique<HeapObject>::CreateImmovable(factory()->true_value())); | 91 Unique<HeapObject>::CreateImmovable(factory()->true_value())); |
94 } | 92 } |
95 | 93 |
| 94 |
| 95 TypedGraphTest::TypedGraphTest(int num_parameters) |
| 96 : GraphTest(num_parameters), typer_(graph(), MaybeHandle<Context>()) {} |
| 97 |
| 98 |
| 99 TypedGraphTest::~TypedGraphTest() {} |
| 100 |
| 101 |
| 102 Node* TypedGraphTest::Parameter(Type* type, int32_t index) { |
| 103 Node* node = GraphTest::Parameter(index); |
| 104 NodeProperties::SetBounds(node, Bounds(type)); |
| 105 return node; |
| 106 } |
| 107 |
96 } // namespace compiler | 108 } // namespace compiler |
97 } // namespace internal | 109 } // namespace internal |
98 } // namespace v8 | 110 } // namespace v8 |
OLD | NEW |