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

Unified Diff: src/compiler/escape-analysis-reducer.cc

Issue 1577273002: [turbofan] Fix double reduce in escape analysis (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@hash-maps
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/escape-analysis-reducer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/escape-analysis-reducer.cc
diff --git a/src/compiler/escape-analysis-reducer.cc b/src/compiler/escape-analysis-reducer.cc
index cbe808f7eaf7e975098c7fae19f4992f1c1299f9..1e02591bcadf07bc2c662c9aabe2d99b053b2d25 100644
--- a/src/compiler/escape-analysis-reducer.cc
+++ b/src/compiler/escape-analysis-reducer.cc
@@ -17,7 +17,8 @@ EscapeAnalysisReducer::EscapeAnalysisReducer(Editor* editor, JSGraph* jsgraph,
: AdvancedReducer(editor),
jsgraph_(jsgraph),
escape_analysis_(escape_analysis),
- zone_(zone) {}
+ zone_(zone),
+ visited_(static_cast<int>(jsgraph->graph()->NodeCount()), zone) {}
Reduction EscapeAnalysisReducer::Reduce(Node* node) {
@@ -52,7 +53,10 @@ Reduction EscapeAnalysisReducer::Reduce(Node* node) {
Reduction EscapeAnalysisReducer::ReduceLoad(Node* node) {
DCHECK(node->opcode() == IrOpcode::kLoadField ||
node->opcode() == IrOpcode::kLoadElement);
+ if (visited_.Contains(node->id())) return NoChange();
+ visited_.Add(node->id());
if (Node* rep = escape_analysis()->GetReplacement(node)) {
+ visited_.Add(node->id());
Michael Starzinger 2016/01/12 12:25:00 nit: Why add the node twice?
counters()->turbo_escape_loads_replaced()->Increment();
if (FLAG_trace_turbo_escape) {
PrintF("Replaced #%d (%s) with #%d (%s)\n", node->id(),
@@ -68,6 +72,8 @@ Reduction EscapeAnalysisReducer::ReduceLoad(Node* node) {
Reduction EscapeAnalysisReducer::ReduceStore(Node* node) {
DCHECK(node->opcode() == IrOpcode::kStoreField ||
node->opcode() == IrOpcode::kStoreElement);
+ if (visited_.Contains(node->id())) return NoChange();
+ visited_.Add(node->id());
if (escape_analysis()->IsVirtual(NodeProperties::GetValueInput(node, 0))) {
if (FLAG_trace_turbo_escape) {
PrintF("Removed #%d (%s) from effect chain\n", node->id(),
@@ -82,6 +88,8 @@ Reduction EscapeAnalysisReducer::ReduceStore(Node* node) {
Reduction EscapeAnalysisReducer::ReduceAllocate(Node* node) {
DCHECK_EQ(node->opcode(), IrOpcode::kAllocate);
+ if (visited_.Contains(node->id())) return NoChange();
+ visited_.Add(node->id());
if (escape_analysis()->IsVirtual(node)) {
RelaxEffectsAndControls(node);
counters()->turbo_escape_allocs_replaced()->Increment();
@@ -159,6 +167,8 @@ Reduction EscapeAnalysisReducer::ReduceObjectIsSmi(Node* node) {
Reduction EscapeAnalysisReducer::ReduceFrameStateUses(Node* node) {
+ if (visited_.Contains(node->id())) return NoChange();
+ visited_.Add(node->id());
DCHECK_GE(node->op()->EffectInputCount(), 1);
bool changed = false;
for (int i = 0; i < node->InputCount(); ++i) {
« no previous file with comments | « src/compiler/escape-analysis-reducer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698