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

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

Issue 2488713002: [turbofan] Fixed reuse of nested ObjectState in escape analysis (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/escape-analysis.cc
diff --git a/src/compiler/escape-analysis.cc b/src/compiler/escape-analysis.cc
index f75a83b975f5489995863a53b59c2614a93724a2..3d9b56e96676a793425d4c88ae7a302dd0f148ff 100644
--- a/src/compiler/escape-analysis.cc
+++ b/src/compiler/escape-analysis.cc
@@ -1135,7 +1135,17 @@ VirtualObject* EscapeAnalysis::CopyForModificationAt(VirtualObject* obj,
Node* node) {
if (obj->NeedCopyForModification()) {
state = CopyForModificationAt(state, node);
- return state->Copy(obj, status_analysis_->GetAlias(obj->id()));
+ // TODO(tebbi): this copies the complete virtual state. Replace with a more
+ // precise analysis of which objects are actually affected by the change.
+ Alias changed_alias = status_analysis_->GetAlias(obj->id());
+ for (Alias alias = 0; alias < state->size(); ++alias) {
+ if (VirtualObject* next_obj = state->VirtualObjectFromAlias(alias)) {
+ if (alias != changed_alias && next_obj->NeedCopyForModification()) {
+ state->Copy(next_obj, alias);
+ }
+ }
+ }
+ return state->Copy(obj, changed_alias);
}
return obj;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698