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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 638903004: Fix incorrect handling of refined aliases during load forwarding. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/language/vm/load_to_load_forwarding_vm_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index 9af52c53db07daafd96bffb817fe2f4fe2cf618e..cb7eb2b67e0ca37ba79a0537ea09790b66f88099 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -5680,6 +5680,26 @@ class AliasedSet : public ZoneAllocated {
const intptr_t alias_id = LookupAliasId(place.ToAlias());
if (alias_id != kNoAlias) {
*killed = GetKilledSet(alias_id);
+ } else if (!place.IsFinalField()) {
+ // We encountered unknown alias: this means intrablock load forwarding
+ // refined parameter of this store, for example
+ //
+ // o <- alloc()
+ // a.f <- o
+ // u <- a.f
+ // u.x <- null ;; this store alias is *.x
+ //
+ // after intrablock load forwarding
+ //
+ // o <- alloc()
+ // a.f <- o
+ // o.x <- null ;; this store alias is o.x
+ //
+ // In this case we fallback to using place id recorded in the
+ // instruction that still points to the old place with a more generic
+ // alias.
+ *killed = GetKilledSet(
+ LookupAliasId(places_[instr->place_id()]->ToAlias()));
}
}
return is_store;
@@ -6198,6 +6218,7 @@ static AliasedSet* NumberPlaces(
!it.Done();
it.Advance()) {
BlockEntryInstr* block = it.Current();
+
for (ForwardInstructionIterator instr_it(block);
!instr_it.Done();
instr_it.Advance()) {
« no previous file with comments | « no previous file | tests/language/vm/load_to_load_forwarding_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698