Fix bogus allocation limit in allocation folding.

R=ishell@chromium.org
TEST=mjsunit/allocation-folding

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17805 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4ed25382
...@@ -3404,7 +3404,7 @@ void HAllocate::HandleSideEffectDominator(GVNFlag side_effect, ...@@ -3404,7 +3404,7 @@ void HAllocate::HandleSideEffectDominator(GVNFlag side_effect,
} }
} }
if (new_dominator_size > Page::kMaxNonCodeHeapObjectSize) { if (new_dominator_size > isolate()->heap()->MaxRegularSpaceAllocationSize()) {
if (FLAG_trace_allocation_folding) { if (FLAG_trace_allocation_folding) {
PrintF("#%d (%s) cannot fold into #%d (%s) due to size: %d\n", PrintF("#%d (%s) cannot fold into #%d (%s) due to size: %d\n",
id(), Mnemonic(), dominator_allocate->id(), id(), Mnemonic(), dominator_allocate->id(),
......
...@@ -100,3 +100,17 @@ gc(); ...@@ -100,3 +100,17 @@ gc();
assertEquals(result[1], 4); assertEquals(result[1], 4);
assertEquals(result2[1], 6); assertEquals(result2[1], 6);
// Test to exceed the Heap::MaxRegularSpaceAllocationSize limit but not
// the Page::kMaxNonCodeHeapObjectSize limit with allocation folding.
function boom() {
var a1 = new Array(84632);
var a2 = new Array(84632);
var a3 = new Array(84632);
return [ a1, a2, a3 ];
}
boom(); boom(); boom();
%OptimizeFunctionOnNextCall(boom);
boom();
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