Commit 0c81c4e9 authored by mlippautz's avatar mlippautz Committed by Commit bot

Add bailout for large objects when allocating arrays in optimized code.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#31259}
parent a0159c11
......@@ -3514,6 +3514,11 @@ HAllocate* HGraphBuilder::JSArrayBuilder::AllocateArray(
HValue* elements_size =
builder()->BuildCalculateElementsSize(kind_, capacity);
// Bail out for large objects.
HValue* max_regular_heap_object_size =
builder()->Add<HConstant>(Page::kMaxRegularHeapObjectSize);
builder()->Add<HBoundsCheck>(elements_size, max_regular_heap_object_size);
// Allocate (dealing with failure appropriately)
HAllocate* array_object = builder()->AllocateJSArrayObject(mode_);
......
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