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

Unified Diff: src/compiler/loop-variable-optimizer.cc

Issue 2274053002: [turbofan] Change map to vector in loop variable analysis. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/loop-variable-optimizer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/loop-variable-optimizer.cc
diff --git a/src/compiler/loop-variable-optimizer.cc b/src/compiler/loop-variable-optimizer.cc
index 8331963a7d8087b1b2d68c0e722f42507875d67b..3b6be3713ab17d604309c46e9c0c143986629585 100644
--- a/src/compiler/loop-variable-optimizer.cc
+++ b/src/compiler/loop-variable-optimizer.cc
@@ -28,7 +28,7 @@ LoopVariableOptimizer::LoopVariableOptimizer(Graph* graph,
: graph_(graph),
common_(common),
zone_(zone),
- limits_(zone),
+ limits_(graph->NodeCount(), zone),
induction_vars_(zone) {}
void LoopVariableOptimizer::Run() {
@@ -40,14 +40,13 @@ void LoopVariableOptimizer::Run() {
queue.pop();
queued.Set(node, false);
- DCHECK(limits_.find(node->id()) == limits_.end());
+ DCHECK_NULL(limits_[node->id()]);
bool all_inputs_visited = true;
int inputs_end = (node->opcode() == IrOpcode::kLoop)
? kFirstBackedge
: node->op()->ControlInputCount();
for (int i = 0; i < inputs_end; i++) {
- auto input = limits_.find(NodeProperties::GetControlInput(node, i)->id());
- if (input == limits_.end()) {
+ if (limits_[NodeProperties::GetControlInput(node, i)->id()] == nullptr) {
all_inputs_visited = false;
break;
}
@@ -55,7 +54,7 @@ void LoopVariableOptimizer::Run() {
if (!all_inputs_visited) continue;
VisitNode(node);
- DCHECK(limits_.find(node->id()) != limits_.end());
+ DCHECK_NOT_NULL(limits_[node->id()]);
// Queue control outputs.
for (Edge edge : node->use_edges()) {
« no previous file with comments | « src/compiler/loop-variable-optimizer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698