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

Side by Side Diff: src/compiler/escape-analysis-reducer.cc

Issue 2369953002: [turbofan] Fix indirect escapes in escape analysis. (Closed)
Patch Set: Created 4 years, 2 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 | test/mjsunit/compiler/regress-escape-analysis-indirect.js » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/escape-analysis-reducer.h" 5 #include "src/compiler/escape-analysis-reducer.h"
6 6
7 #include "src/compiler/all-nodes.h" 7 #include "src/compiler/all-nodes.h"
8 #include "src/compiler/js-graph.h" 8 #include "src/compiler/js-graph.h"
9 #include "src/counters.h" 9 #include "src/counters.h"
10 10
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } 113 }
114 114
115 } // namespace 115 } // namespace
116 116
117 Reduction EscapeAnalysisReducer::ReduceLoad(Node* node) { 117 Reduction EscapeAnalysisReducer::ReduceLoad(Node* node) {
118 DCHECK(node->opcode() == IrOpcode::kLoadField || 118 DCHECK(node->opcode() == IrOpcode::kLoadField ||
119 node->opcode() == IrOpcode::kLoadElement); 119 node->opcode() == IrOpcode::kLoadElement);
120 if (node->id() < static_cast<NodeId>(fully_reduced_.length())) { 120 if (node->id() < static_cast<NodeId>(fully_reduced_.length())) {
121 fully_reduced_.Add(node->id()); 121 fully_reduced_.Add(node->id());
122 } 122 }
123 if (Node* rep = escape_analysis()->GetReplacement(node)) { 123 if (escape_analysis()->IsVirtual(NodeProperties::GetValueInput(node, 0))) {
124 isolate()->counters()->turbo_escape_loads_replaced()->Increment(); 124 if (Node* rep = escape_analysis()->GetReplacement(node)) {
125 TRACE("Replaced #%d (%s) with #%d (%s)\n", node->id(), 125 isolate()->counters()->turbo_escape_loads_replaced()->Increment();
126 node->op()->mnemonic(), rep->id(), rep->op()->mnemonic()); 126 TRACE("Replaced #%d (%s) with #%d (%s)\n", node->id(),
127 rep = MaybeGuard(jsgraph(), node, rep); 127 node->op()->mnemonic(), rep->id(), rep->op()->mnemonic());
128 ReplaceWithValue(node, rep); 128 rep = MaybeGuard(jsgraph(), node, rep);
129 return Replace(rep); 129 ReplaceWithValue(node, rep);
130 return Replace(rep);
131 }
130 } 132 }
131 return NoChange(); 133 return NoChange();
132 } 134 }
133 135
134 136
135 Reduction EscapeAnalysisReducer::ReduceStore(Node* node) { 137 Reduction EscapeAnalysisReducer::ReduceStore(Node* node) {
136 DCHECK(node->opcode() == IrOpcode::kStoreField || 138 DCHECK(node->opcode() == IrOpcode::kStoreField ||
137 node->opcode() == IrOpcode::kStoreElement); 139 node->opcode() == IrOpcode::kStoreElement);
138 if (node->id() < static_cast<NodeId>(fully_reduced_.length())) { 140 if (node->id() < static_cast<NodeId>(fully_reduced_.length())) {
139 fully_reduced_.Add(node->id()); 141 fully_reduced_.Add(node->id());
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 } 361 }
360 } 362 }
361 #endif // DEBUG 363 #endif // DEBUG
362 } 364 }
363 365
364 Isolate* EscapeAnalysisReducer::isolate() const { return jsgraph_->isolate(); } 366 Isolate* EscapeAnalysisReducer::isolate() const { return jsgraph_->isolate(); }
365 367
366 } // namespace compiler 368 } // namespace compiler
367 } // namespace internal 369 } // namespace internal
368 } // namespace v8 370 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/compiler/regress-escape-analysis-indirect.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698