Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: src/hydrogen.cc

Issue 1392853009: Reland "Add bailout for large objects when allocating arrays in optimized code." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Skip test where bounds check interferes with forced deopts Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 33c90c238775fcffff7bc242fd0e5d51a4bd2e2e..1268927252bb618c74e5466d1754e8b91bcaa201 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -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_);
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698