Commit 067d921c authored by hpayer@chromium.org's avatar hpayer@chromium.org

Limit the amount of memory that can be folded together.

BUG=
R=mstarzinger@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15804 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d816fd13
...@@ -3229,12 +3229,21 @@ void HAllocate::HandleSideEffectDominator(GVNFlag side_effect, ...@@ -3229,12 +3229,21 @@ void HAllocate::HandleSideEffectDominator(GVNFlag side_effect,
HConstant::cast(dominator_size)->GetInteger32Constant(); HConstant::cast(dominator_size)->GetInteger32Constant();
int32_t current_size_constant = int32_t current_size_constant =
HConstant::cast(current_size)->GetInteger32Constant(); HConstant::cast(current_size)->GetInteger32Constant();
int32_t new_dominator_size = dominator_size_constant + current_size_constant;
if (new_dominator_size > Page::kMaxNonCodeHeapObjectSize) {
if (FLAG_trace_allocation_folding) {
PrintF("#%d (%s) cannot fold into #%d (%s) due to size: %d\n",
id(), Mnemonic(), dominator->id(), dominator->Mnemonic(),
new_dominator_size);
}
return;
}
HBasicBlock* block = dominator->block(); HBasicBlock* block = dominator->block();
Zone* zone = block->zone(); Zone* zone = block->zone();
HInstruction* new_dominator_size = new(zone) HConstant( HInstruction* new_dominator_size_constant = new(zone) HConstant(
dominator_size_constant + current_size_constant); new_dominator_size);
new_dominator_size->InsertBefore(dominator_allocate_instr); new_dominator_size_constant->InsertBefore(dominator_allocate_instr);
dominator_allocate_instr->UpdateSize(new_dominator_size); dominator_allocate_instr->UpdateSize(new_dominator_size_constant);
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
if (FLAG_verify_heap) { if (FLAG_verify_heap) {
......
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