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

This reverts commit dc0adc5668.

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#31284}
This commit is contained in:
mlippautz 2015-10-15 02:54:38 -07:00 committed by Commit bot
parent b79f00bcf6
commit 5a3929ea4f
2 changed files with 8 additions and 0 deletions

View File

@ -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_);

View File

@ -696,6 +696,9 @@
'readonly': [SKIP],
'array-feedback': [SKIP],
# Bounds check triggers forced deopt for array constructors.
'array-constructor-feedback': [SKIP],
# Deopting uses just enough memory to make this one OOM.
'regress/regress-3976': [SKIP],