Revision: 21420
Author:   [email protected]
Date:     Thu May 22 07:40:07 2014 UTC
Log:      Don't replace initializing smi stores during store elimination.

[email protected]

Review URL: https://codereview.chromium.org/286903019
http://code.google.com/p/v8/source/detail?r=21420

Modified:
 /branches/bleeding_edge/src/hydrogen-instructions.h
 /branches/bleeding_edge/src/hydrogen-store-elimination.cc

=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Thu May 22 05:33:37 2014 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Thu May 22 07:40:07 2014 UTC
@@ -6752,6 +6752,19 @@
   void UpdateValue(HValue* value) {
     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,
=======================================
--- /branches/bleeding_edge/src/hydrogen-store-elimination.cc Tue May 20 13:03:25 2014 UTC +++ /branches/bleeding_edge/src/hydrogen-store-elimination.cc Thu May 22 07:40:07 2014 UTC
@@ -58,7 +58,7 @@
   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",

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to