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

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

Issue 1178403004: [turbofan] Use appropriate type for NodeId. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix useless static_cast. Created 5 years, 6 months 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
« no previous file with comments | « test/unittests/base/bits-unittest.cc ('k') | test/unittests/compiler/graph-reducer-unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "src/bit-vector.h" 5 #include "src/bit-vector.h"
6 #include "src/compiler/control-equivalence.h" 6 #include "src/compiler/control-equivalence.h"
7 #include "src/compiler/graph-visualizer.h" 7 #include "src/compiler/graph-visualizer.h"
8 #include "src/compiler/node-properties.h" 8 #include "src/compiler/node-properties.h"
9 #include "src/zone-containers.h" 9 #include "src/zone-containers.h"
10 #include "test/unittests/compiler/graph-unittest.h" 10 #include "test/unittests/compiler/graph-unittest.h"
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 ControlEquivalence equivalence(zone(), graph()); 35 ControlEquivalence equivalence(zone(), graph());
36 equivalence.Run(node); 36 equivalence.Run(node);
37 classes_.resize(graph()->NodeCount()); 37 classes_.resize(graph()->NodeCount());
38 for (Node* node : all_nodes_) { 38 for (Node* node : all_nodes_) {
39 classes_[node->id()] = equivalence.ClassOf(node); 39 classes_[node->id()] = equivalence.ClassOf(node);
40 } 40 }
41 } 41 }
42 42
43 bool IsEquivalenceClass(size_t length, Node** nodes) { 43 bool IsEquivalenceClass(size_t length, Node** nodes) {
44 BitVector in_class(graph()->NodeCount(), zone()); 44 BitVector in_class(static_cast<int>(graph()->NodeCount()), zone());
45 size_t expected_class = classes_[nodes[0]->id()]; 45 size_t expected_class = classes_[nodes[0]->id()];
46 for (size_t i = 0; i < length; ++i) { 46 for (size_t i = 0; i < length; ++i) {
47 in_class.Add(nodes[i]->id()); 47 in_class.Add(nodes[i]->id());
48 } 48 }
49 for (Node* node : all_nodes_) { 49 for (Node* node : all_nodes_) {
50 if (in_class.Contains(node->id())) { 50 if (in_class.Contains(node->id())) {
51 if (classes_[node->id()] != expected_class) return false; 51 if (classes_[node->id()] != expected_class) return false;
52 } else { 52 } else {
53 if (classes_[node->id()] == expected_class) return false; 53 if (classes_[node->id()] == expected_class) return false;
54 } 54 }
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 ASSERT_EQUIVALENCE(t2); 246 ASSERT_EQUIVALENCE(t2);
247 ASSERT_EQUIVALENCE(f2); 247 ASSERT_EQUIVALENCE(f2);
248 ASSERT_EQUIVALENCE(f3); 248 ASSERT_EQUIVALENCE(f3);
249 ASSERT_EQUIVALENCE(lp); 249 ASSERT_EQUIVALENCE(lp);
250 } 250 }
251 251
252 252
253 } // namespace compiler 253 } // namespace compiler
254 } // namespace internal 254 } // namespace internal
255 } // namespace v8 255 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/base/bits-unittest.cc ('k') | test/unittests/compiler/graph-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698