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

Side by Side Diff: src/compiler/value-numbering-reducer.cc

Issue 539833003: [turbofan] Value numbering should never replace a node with itself. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/compiler/value-numbering-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/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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
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()->op() == NULL) continue;
63 if (entry->node() == node) return NoChange();
63 if (Equals(node, entry->node())) { 64 if (Equals(node, entry->node())) {
64 return Replace(entry->node()); 65 return Replace(entry->node());
65 } 66 }
66 } 67 }
67 *head = new (zone()) Entry(node, *head); 68 *head = new (zone()) Entry(node, *head);
68 return NoChange(); 69 return NoChange();
69 } 70 }
70 71
71 } // namespace compiler 72 } // namespace compiler
72 } // namespace internal 73 } // namespace internal
73 } // namespace v8 74 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/value-numbering-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698