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

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

Issue 2571793002: [turbofan] fixed escape analysis crash because of incomplete replacements (Closed)
Patch Set: missing file Created 4 years 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') | test/mjsunit/compiler/escape-analysis-replacement.js » ('j') | 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 f7708f85da26d1d551f174c323e796fa67a85e6e..67edd433a29b96caba344ea8684d0db90bca8c54 100644
--- a/src/compiler/escape-analysis-reducer.cc
+++ b/src/compiler/escape-analysis-reducer.cc
@@ -31,7 +31,7 @@ EscapeAnalysisReducer::EscapeAnalysisReducer(Editor* editor, JSGraph* jsgraph,
fully_reduced_(static_cast<int>(jsgraph->graph()->NodeCount() * 2), zone),
exists_virtual_allocate_(escape_analysis->ExistsVirtualAllocate()) {}
-Reduction EscapeAnalysisReducer::Reduce(Node* node) {
+Reduction EscapeAnalysisReducer::ReduceNode(Node* node) {
if (node->id() < static_cast<NodeId>(fully_reduced_.length()) &&
fully_reduced_.Contains(node->id())) {
return NoChange();
@@ -97,6 +97,14 @@ Reduction EscapeAnalysisReducer::Reduce(Node* node) {
return NoChange();
}
+Reduction EscapeAnalysisReducer::Reduce(Node* node) {
+ Reduction reduction = ReduceNode(node);
+ if (reduction.Changed() && node != reduction.replacement()) {
+ escape_analysis()->SetReplacement(node, reduction.replacement());
+ }
+ return reduction;
+}
+
namespace {
Node* MaybeGuard(JSGraph* jsgraph, Node* original, Node* replacement) {
@@ -202,7 +210,7 @@ Reduction EscapeAnalysisReducer::ReduceReferenceEqual(Node* node) {
escape_analysis()->CompareVirtualObjects(left, right)) {
ReplaceWithValue(node, jsgraph()->TrueConstant());
TRACE("Replaced ref eq #%d with true\n", node->id());
- Replace(jsgraph()->TrueConstant());
+ return Replace(jsgraph()->TrueConstant());
}
// Right-hand side is not a virtual object, or a different one.
ReplaceWithValue(node, jsgraph()->FalseConstant());
« no previous file with comments | « src/compiler/escape-analysis-reducer.h ('k') | test/mjsunit/compiler/escape-analysis-replacement.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698