Commit 4b949591 authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[turbofan] escape analysis: check replacement invariant only after fixed-point is reached

We have to ensure that replacements do not have replacements because
otherwise a changed replacement (of the replacement) wouldn't trigger
graph revisitations. However, this invariant can be temporarily
violated when the information propagated along the effect chain is
outdated for another reason. So we should only check this for the final
fixed-point.


Bug: chromium:787959

Change-Id: I4a6b2c4f6ff3205649c0f866654900d4ab126acf
Reviewed-on: https://chromium-review.googlesource.com/817777Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49995}
parent 1e49864f
...@@ -223,8 +223,12 @@ class EscapeAnalysisTracker : public ZoneObject { ...@@ -223,8 +223,12 @@ class EscapeAnalysisTracker : public ZoneObject {
replacement_ = replacement; replacement_ = replacement;
vobject_ = vobject_ =
replacement ? tracker_->virtual_objects_.Get(replacement) : nullptr; replacement ? tracker_->virtual_objects_.Get(replacement) : nullptr;
TRACE("Set %s#%d as replacement.\n", replacement->op()->mnemonic(), if (replacement) {
replacement->id()); TRACE("Set %s#%d as replacement.\n", replacement->op()->mnemonic(),
replacement->id());
} else {
TRACE("Set nullptr as replacement.\n");
}
} }
void MarkForDeletion() { SetReplacement(tracker_->jsgraph_->Dead()); } void MarkForDeletion() { SetReplacement(tracker_->jsgraph_->Dead()); }
...@@ -248,10 +252,6 @@ class EscapeAnalysisTracker : public ZoneObject { ...@@ -248,10 +252,6 @@ class EscapeAnalysisTracker : public ZoneObject {
Node* GetReplacementOf(Node* node) { return replacements_[node]; } Node* GetReplacementOf(Node* node) { return replacements_[node]; }
Node* ResolveReplacement(Node* node) { Node* ResolveReplacement(Node* node) {
if (Node* replacement = GetReplacementOf(node)) { if (Node* replacement = GetReplacementOf(node)) {
// Replacements cannot have replacements. This is important to ensure
// re-visitation: If a replacement is replaced, then all nodes accessing
// the replacement have to be updated.
DCHECK_NULL(GetReplacementOf(replacement));
return replacement; return replacement;
} }
return node; return node;
...@@ -768,7 +768,12 @@ EscapeAnalysis::EscapeAnalysis(JSGraph* jsgraph, Zone* zone) ...@@ -768,7 +768,12 @@ EscapeAnalysis::EscapeAnalysis(JSGraph* jsgraph, Zone* zone)
jsgraph_(jsgraph) {} jsgraph_(jsgraph) {}
Node* EscapeAnalysisResult::GetReplacementOf(Node* node) { Node* EscapeAnalysisResult::GetReplacementOf(Node* node) {
return tracker_->GetReplacementOf(node); Node* replacement = tracker_->GetReplacementOf(node);
// Replacements cannot have replacements. This is important to ensure
// re-visitation: If a replacement is replaced, then all nodes accessing
// the replacement have to be updated.
if (replacement) DCHECK_NULL(tracker_->GetReplacementOf(replacement));
return replacement;
} }
Node* EscapeAnalysisResult::GetVirtualObjectField(const VirtualObject* vobject, Node* EscapeAnalysisResult::GetVirtualObjectField(const VirtualObject* vobject,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment