| Index: src/hydrogen-escape-analysis.cc
|
| diff --git a/src/hydrogen-escape-analysis.cc b/src/hydrogen-escape-analysis.cc
|
| index 5eaa88b2767e5974aa485100ad1aab08e5351b05..0359678ef958bd2621ea4f207be4ca872673308e 100644
|
| --- a/src/hydrogen-escape-analysis.cc
|
| +++ b/src/hydrogen-escape-analysis.cc
|
| @@ -110,14 +110,11 @@ HCapturedObject* HEscapeAnalysisPhase::NewStateCopy(
|
|
|
|
|
| // Insert a newly created phi into the given block and fill all incoming
|
| -// edges with the given value. The merge index is chosen so that it is
|
| -// unique for this particular scalar replacement index.
|
| +// edges with the given value.
|
| HPhi* HEscapeAnalysisPhase::NewPhiAndInsert(
|
| HBasicBlock* block, HValue* incoming_value, int index) {
|
| Zone* zone = graph()->zone();
|
| - HBasicBlock* pred = block->predecessors()->first();
|
| - int phi_index = pred->last_environment()->length() + cumulative_values_;
|
| - HPhi* phi = new(zone) HPhi(phi_index + index, zone);
|
| + HPhi* phi = new(zone) HPhi(HPhi::kInvalidMergedIndex, zone);
|
| for (int i = 0; i < block->predecessors()->length(); i++) {
|
| phi->AddInput(incoming_value);
|
| }
|
| @@ -215,7 +212,14 @@ void HEscapeAnalysisPhase::AnalyzeDataFlow(HInstruction* allocate) {
|
| if (mapcheck->value() != allocate) continue;
|
| // TODO(mstarzinger): This approach breaks if the tracked map value
|
| // is not a HConstant. Find a repro test case and fix this.
|
| + for (HUseIterator it(mapcheck->uses()); !it.Done(); it.Advance()) {
|
| + if (!it.value()->IsLoadNamedField()) continue;
|
| + HLoadNamedField* load = HLoadNamedField::cast(it.value());
|
| + ASSERT(load->typecheck() == mapcheck);
|
| + load->ClearTypeCheck();
|
| + }
|
| ASSERT(mapcheck->HasNoUses());
|
| +
|
| mapcheck->DeleteAndReplaceWith(NULL);
|
| break;
|
| }
|
|
|