Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1632)

Side by Side Diff: test/unittests/compiler/graph-unittest.cc

Issue 819103002: [turbofan] Minor cleanup to reduce code duplication. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « test/unittests/compiler/graph-unittest.h ('k') | test/unittests/compiler/js-builtin-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698