Index: src/hydrogen-instructions.cc |
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
index 889ebfd05fc6f47a4cb835269ab29ddbd686f02e..af093d9aa5488ebc541ecdc6c2ed9f14d433ed01 100644 |
--- a/src/hydrogen-instructions.cc |
+++ b/src/hydrogen-instructions.cc |
@@ -3384,6 +3384,15 @@ void HAllocate::HandleSideEffectDominator(GVNFlag side_effect, |
return; |
} |
+ // Check whether we are folding within the same block for local folding. |
+ if (FLAG_use_local_allocation_folding && dominator->block() != block()) { |
+ if (FLAG_trace_allocation_folding) { |
+ PrintF("#%d (%s) cannot fold into #%d (%s), crosses basic blocks\n", |
+ id(), Mnemonic(), dominator->id(), dominator->Mnemonic()); |
+ } |
+ return; |
+ } |
+ |
HAllocate* dominator_allocate = HAllocate::cast(dominator); |
HValue* dominator_size = dominator_allocate->size(); |
HValue* current_size = size(); |