Chromium Code Reviews| Index: src/hydrogen-escape-analysis.cc |
| diff --git a/src/hydrogen-escape-analysis.cc b/src/hydrogen-escape-analysis.cc |
| index 102301992333e1c9a994d0d7b051577869ac89fa..095c675ebccb09b9771edd2b196069f831976e1d 100644 |
| --- a/src/hydrogen-escape-analysis.cc |
| +++ b/src/hydrogen-escape-analysis.cc |
| @@ -196,11 +196,20 @@ void HEscapeAnalysisPhase::AnalyzeDataFlow(HInstruction* allocate) { |
| int index = load->access().offset() / kPointerSize; |
| if (load->object() != allocate) continue; |
| ASSERT(load->access().IsInobject()); |
| - HValue* replacement = state->OperandAt(index); |
| + HValue* load_value = state->OperandAt(index); |
| + HValue* replacement = load_value; |
| + Representation representation = load->representation(); |
| + if (representation.IsSmi()) { |
|
Michael Starzinger
2014/04/25 08:35:10
Can we factor this out into a NewLoadReplacement h
Jarin
2014/04/25 11:05:07
Done.
|
| + Zone* zone = graph()->zone(); |
| + HInstruction* new_instr = |
| + new(zone) HForceRepresentation(load_value, representation); |
| + new_instr->InsertAfter(load); |
| + replacement = new_instr; |
| + } |
| load->DeleteAndReplaceWith(replacement); |
| if (FLAG_trace_escape_analysis) { |
| PrintF("Replacing load #%d with #%d (%s)\n", instr->id(), |
| - replacement->id(), replacement->Mnemonic()); |
| + load_value->id(), load_value->Mnemonic()); |
|
Michael Starzinger
2014/04/25 08:35:10
nit: The logging should print the actual replaceme
Jarin
2014/04/25 11:05:07
Done.
|
| } |
| break; |
| } |