Commit 7c30bba1 authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

Don't replace initializing smi stores during store elimination.

R=ishell@chromium.org

Review URL: https://codereview.chromium.org/286903019

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21420 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ab3afc57
......@@ -6753,6 +6753,19 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> {
SetOperandAt(1, value);
}
bool CanBeReplacedWith(HStoreNamedField* that) const {
if (!this->access().Equals(that->access())) return false;
if (SmiValuesAre32Bits() &&
this->field_representation().IsSmi() &&
this->store_mode() == INITIALIZING_STORE &&
that->store_mode() == STORE_TO_INITIALIZED_ENTRY) {
// We cannot replace an initializing store to a smi field with a store to
// an initialized entry on 64-bit architectures (with 32-bit smis).
return false;
}
return true;
}
private:
HStoreNamedField(HValue* obj,
HObjectAccess access,
......
......@@ -58,7 +58,7 @@ void HStoreEliminationPhase::ProcessStore(HStoreNamedField* store) {
while (i < unobserved_.length()) {
HStoreNamedField* prev = unobserved_.at(i);
if (aliasing_->MustAlias(object, prev->object()->ActualValue()) &&
store->access().Equals(prev->access())) {
prev->CanBeReplacedWith(store)) {
// This store is guaranteed to overwrite the previous store.
prev->DeleteAndReplaceWith(NULL);
TRACE(("++ Unobserved store S%d overwritten by S%d\n",
......
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