| Index: src/hydrogen-instructions.cc
|
| diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
|
| index 4475fc0c74eafe73dfbc981df4bf8b2fdbc7343b..5a9510f8e31349117533232d5a4eca93263ecdda 100644
|
| --- a/src/hydrogen-instructions.cc
|
| +++ b/src/hydrogen-instructions.cc
|
| @@ -3181,10 +3181,17 @@ HType HAllocate::CalculateInferredType() {
|
| void HAllocate::HandleSideEffectDominator(GVNFlag side_effect,
|
| HValue* dominator) {
|
| ASSERT(side_effect == kChangesNewSpacePromotion);
|
| + if (!FLAG_use_allocation_folding) return;
|
| +
|
| // Try to fold allocations together with their dominating allocations.
|
| - if (!FLAG_use_allocation_folding || !dominator->IsAllocate()) {
|
| + if (!dominator->IsAllocate()) {
|
| + if (FLAG_trace_allocation_folding) {
|
| + PrintF("#%d (%s) cannot fold into #%d (%s)\n",
|
| + id(), Mnemonic(), dominator->id(), dominator->Mnemonic());
|
| + }
|
| return;
|
| }
|
| +
|
| HAllocate* dominator_allocate_instr = HAllocate::cast(dominator);
|
| HValue* dominator_size = dominator_allocate_instr->size();
|
| HValue* current_size = size();
|
| @@ -3196,6 +3203,10 @@ void HAllocate::HandleSideEffectDominator(GVNFlag side_effect,
|
| !dominator_allocate_instr->GuaranteedInNewSpace() ||
|
| dominator_allocate_instr->MustAllocateDoubleAligned() ||
|
| !dominator_size->IsInteger32Constant()) {
|
| + if (FLAG_trace_allocation_folding) {
|
| + PrintF("#%d (%s) cannot fold into #%d (%s)\n",
|
| + id(), Mnemonic(), dominator->id(), dominator->Mnemonic());
|
| + }
|
| return;
|
| }
|
|
|
|
|