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

Side by Side Diff: src/compiler/control-equivalence.h

Issue 2611603002: [turbofan] Tentative fix for ControlEquivalence crasher. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | 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 #ifndef V8_COMPILER_CONTROL_EQUIVALENCE_H_ 5 #ifndef V8_COMPILER_CONTROL_EQUIVALENCE_H_
6 #define V8_COMPILER_CONTROL_EQUIVALENCE_H_ 6 #define V8_COMPILER_CONTROL_EQUIVALENCE_H_
7 7
8 #include "src/base/compiler-specific.h" 8 #include "src/base/compiler-specific.h"
9 #include "src/compiler/graph.h" 9 #include "src/compiler/graph.h"
10 #include "src/compiler/node.h" 10 #include "src/compiler/node.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // / \ to D have been visited, we pop N and call VisitPost(N). 117 // / \ to D have been visited, we pop N and call VisitPost(N).
118 // 118 //
119 // This will yield a true spanning tree (without cross or forward edges) and 119 // This will yield a true spanning tree (without cross or forward edges) and
120 // also discover proper back edges in both directions. 120 // also discover proper back edges in both directions.
121 void RunUndirectedDFS(Node* exit); 121 void RunUndirectedDFS(Node* exit);
122 122
123 void DetermineParticipationEnqueue(ZoneQueue<Node*>& queue, Node* node); 123 void DetermineParticipationEnqueue(ZoneQueue<Node*>& queue, Node* node);
124 void DetermineParticipation(Node* exit); 124 void DetermineParticipation(Node* exit);
125 125
126 private: 126 private:
127 NodeData* GetData(Node* node) { return &node_data_[node->id()]; } 127 NodeData* GetData(Node* node) {
128 size_t const index = node->id();
129 if (index >= node_data_.size()) node_data_.resize(index + 1, EmptyData());
130 return &node_data_[index];
131 }
128 int NewClassNumber() { return class_number_++; } 132 int NewClassNumber() { return class_number_++; }
129 int NewDFSNumber() { return dfs_number_++; } 133 int NewDFSNumber() { return dfs_number_++; }
130 134
131 // Template used to initialize per-node data. 135 // Template used to initialize per-node data.
132 NodeData EmptyData() { 136 NodeData EmptyData() {
133 return {kInvalidClass, 0, false, false, false, BracketList(zone_)}; 137 return {kInvalidClass, 0, false, false, false, BracketList(zone_)};
134 } 138 }
135 139
136 // Accessors for the DFS number stored within the per-node data. 140 // Accessors for the DFS number stored within the per-node data.
137 size_t GetNumber(Node* node) { return GetData(node)->dfs_number; } 141 size_t GetNumber(Node* node) { return GetData(node)->dfs_number; }
(...skipping 27 matching lines...) Expand all
165 int dfs_number_; // Generates new DFS pre-order numbers on demand. 169 int dfs_number_; // Generates new DFS pre-order numbers on demand.
166 int class_number_; // Generates new equivalence class numbers on demand. 170 int class_number_; // Generates new equivalence class numbers on demand.
167 Data node_data_; // Per-node data stored as a side-table. 171 Data node_data_; // Per-node data stored as a side-table.
168 }; 172 };
169 173
170 } // namespace compiler 174 } // namespace compiler
171 } // namespace internal 175 } // namespace internal
172 } // namespace v8 176 } // namespace v8
173 177
174 #endif // V8_COMPILER_CONTROL_EQUIVALENCE_H_ 178 #endif // V8_COMPILER_CONTROL_EQUIVALENCE_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698