Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 44df621790d875f1534a839db80ecaecf4b80753..3180f4d069d0e934a835c1f56382764e72eb1927 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -2369,10 +2369,9 @@ HValue* HGraphBuilder::BuildNewElementsCapacity(HValue* old_capacity) { |
void HGraphBuilder::BuildNewSpaceArrayCheck(HValue* length, ElementsKind kind) { |
- Heap* heap = isolate()->heap(); |
int element_size = IsFastDoubleElementsKind(kind) ? kDoubleSize |
: kPointerSize; |
- int max_size = heap->MaxRegularSpaceAllocationSize() / element_size; |
+ int max_size = Page::kMaxRegularHeapObjectSize / element_size; |
max_size -= JSArray::kSize / element_size; |
HConstant* max_size_constant = Add<HConstant>(max_size); |
Add<HBoundsCheck>(length, max_size_constant); |