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/compiler/value-numbering-reducer.h" | 5 #include "src/compiler/value-numbering-reducer.h" |
6 | 6 |
7 #include "src/compiler/node.h" | 7 #include "src/compiler/node.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
55 | 55 |
56 ValueNumberingReducer::~ValueNumberingReducer() {} | 56 ValueNumberingReducer::~ValueNumberingReducer() {} |
57 | 57 |
58 | 58 |
59 Reduction ValueNumberingReducer::Reduce(Node* node) { | 59 Reduction ValueNumberingReducer::Reduce(Node* node) { |
60 Entry** head = &buckets_[HashCode(node) % arraysize(buckets_)]; | 60 Entry** head = &buckets_[HashCode(node) % arraysize(buckets_)]; |
61 for (Entry* entry = *head; entry; entry = entry->next()) { | 61 for (Entry* entry = *head; entry; entry = entry->next()) { |
62 if (entry->node()->op() == NULL) continue; | 62 if (entry->node()->IsDead()) continue; |
63 if (entry->node() == node) return NoChange(); | 63 if (entry->node() == node) return NoChange(); |
64 if (Equals(node, entry->node())) { | 64 if (Equals(node, entry->node())) { |
65 return Replace(entry->node()); | 65 return Replace(entry->node()); |
66 } | 66 } |
67 } | 67 } |
68 *head = new (zone()) Entry(node, *head); | 68 *head = new (zone()) Entry(node, *head); |
69 return NoChange(); | 69 return NoChange(); |
70 } | 70 } |
71 | 71 |
72 } // namespace compiler | 72 } // namespace compiler |
73 } // namespace internal | 73 } // namespace internal |
74 } // namespace v8 | 74 } // namespace v8 |
OLD | NEW |