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.

R=titzer@chromium.org
TEST=mjsunit/compiler/escape-analysis --deopt-every-n-times [3,6,9]

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16394 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 65843dbf
......@@ -172,11 +172,14 @@ void HEscapeAnalysisPhase::AnalyzeDataFlow(HInstruction* allocate) {
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(),
......
......@@ -3230,6 +3230,12 @@ class HCapturedObject V8_FINAL : public HDematerializedObject {
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);
......
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