Revision: 16394
Author:   [email protected]
Date:     Wed Aug 28 12:36:32 2013 UTC
Log:      Fix lost store side effects with escape analysis.

This preserves side effects from stores in HCapturedObject markers so
that simulates following these markers are not merged away.

[email protected]
TEST=mjsunit/compiler/escape-analysis --deopt-every-n-times [3,6,9]

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

Modified:
 /branches/bleeding_edge/src/hydrogen-escape-analysis.cc
 /branches/bleeding_edge/src/hydrogen-instructions.h

=======================================
--- /branches/bleeding_edge/src/hydrogen-escape-analysis.cc Mon Aug 26 16:43:19 2013 UTC +++ /branches/bleeding_edge/src/hydrogen-escape-analysis.cc Wed Aug 28 12:36:32 2013 UTC
@@ -172,11 +172,14 @@
           int index = store->access().offset() / kPointerSize;
           if (store->object() != allocate) continue;
           ASSERT(store->access().IsInobject());
-          state = NewStateCopy(store, state);
+          state = NewStateCopy(store->previous(), state);
           state->SetOperandAt(index, store->value());
           if (store->has_transition()) {
             state->SetOperandAt(0, store->transition());
           }
+          if (store->HasObservableSideEffects()) {
+            state->ReuseSideEffectsFromStore(store);
+          }
           store->DeleteAndReplaceWith(NULL);
           if (FLAG_trace_escape_analysis) {
             PrintF("Replacing store #%d%s\n", instr->id(),
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Wed Aug 28 08:39:43 2013 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Wed Aug 28 12:36:32 2013 UTC
@@ -3229,6 +3229,12 @@
   const ZoneList<HValue*>* values() const { return &values_; }
   int length() const { return values_.length(); }
   int capture_id() const { return capture_id_; }
+
+  void ReuseSideEffectsFromStore(HInstruction* store) {
+    ASSERT(store->HasObservableSideEffects());
+    ASSERT(store->IsStoreNamedField());
+    gvn_flags_.Add(store->gvn_flags());
+  }

   // Replay effects of this instruction on the given environment.
   void ReplayEnvironment(HEnvironment* env);

--
--
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/groups/opt_out.

Reply via email to