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

Unified Diff: src/runtime.cc

Issue 23622016: limit InitialMaxFastElement by MaxRegularSpaceAllocationSize (Closed) Base URL: https://github.com/v8/v8.git@master
Patch Set: Created 7 years, 4 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 | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 4830fafe35c323598e0bd6a49ed6f7a7ef6569ca..f360483d10fbf7fd8f9ceb18b2bc7ff4d8ed28af 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -14519,11 +14519,12 @@ static MaybeObject* ArrayConstructorCommon(Isolate* isolate,
Arguments* caller_args) {
bool holey = false;
bool can_use_type_feedback = true;
+ Heap* heap = isolate->heap();
if (caller_args->length() == 1) {
Object* argument_one = (*caller_args)[0];
if (argument_one->IsSmi()) {
int value = Smi::cast(argument_one)->value();
- if (value < 0 || value >= JSObject::kInitialMaxFastElementArray) {
+ if (value < 0 || value >= JSObject::InitialMaxFastElementArray(heap)) {
// the array is a dictionary in this case.
can_use_type_feedback = false;
} else if (value != 0) {
@@ -14538,7 +14539,7 @@ static MaybeObject* ArrayConstructorCommon(Isolate* isolate,
JSArray* array;
MaybeObject* maybe_array;
if (!type_info.is_null() &&
- *type_info != isolate->heap()->undefined_value() &&
+ *type_info != heap->undefined_value() &&
Cell::cast(*type_info)->value()->IsAllocationSite() &&
can_use_type_feedback) {
Handle<Cell> cell = Handle<Cell>::cast(type_info);
@@ -14552,11 +14553,11 @@ static MaybeObject* ArrayConstructorCommon(Isolate* isolate,
site->SetElementsKind(to_kind);
}
- maybe_array = isolate->heap()->AllocateJSObjectWithAllocationSite(
+ maybe_array = heap->AllocateJSObjectWithAllocationSite(
*constructor, site);
if (!maybe_array->To(&array)) return maybe_array;
} else {
- maybe_array = isolate->heap()->AllocateJSObject(*constructor);
+ maybe_array = heap->AllocateJSObject(*constructor);
if (!maybe_array->To(&array)) return maybe_array;
// We might need to transition to holey
ElementsKind kind = constructor->initial_map()->elements_kind();
@@ -14567,7 +14568,7 @@ static MaybeObject* ArrayConstructorCommon(Isolate* isolate,
}
}
- maybe_array = isolate->heap()->AllocateJSArrayStorage(array, 0, 0,
+ maybe_array = heap->AllocateJSArrayStorage(array, 0, 0,
DONT_INITIALIZE_ARRAY_ELEMENTS);
if (maybe_array->IsFailure()) return maybe_array;
maybe_array = ArrayConstructInitializeElements(array, caller_args);
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698