Disable store elimination on singleton object.
Stores into singleton objects that are finalizable need to be kept.
Disable those store eliminations before we have the finalizable info available.
Change-Id: I281e0c442588ec291b1002fdc9b59a144c15dc8e
diff --git a/compiler/optimizing/load_store_elimination.cc b/compiler/optimizing/load_store_elimination.cc
index 68d02a4..90f28e5 100644
--- a/compiler/optimizing/load_store_elimination.cc
+++ b/compiler/optimizing/load_store_elimination.cc
@@ -695,12 +695,15 @@
} else {
redundant_store = true;
}
+ // TODO: eliminate the store if the singleton object is not finalizable.
+ redundant_store = false;
}
if (redundant_store) {
removed_instructions_.push_back(instruction);
substitute_instructions_.push_back(nullptr);
TryRemovingNullCheck(instruction);
}
+
heap_values[idx] = value;
// This store may kill values in other heap locations due to aliasing.
for (size_t i = 0; i < heap_values.size(); i++) {