Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index aa6920375b1a015d5a15e9ebea7f62719da599cb..f8d562b34b60faf4941f133a0f21460de9fbd2e4 100644 |
--- a/src/builtins.cc |
+++ b/src/builtins.cc |
@@ -203,12 +203,6 @@ RUNTIME_FUNCTION(MaybeObject*, ArrayConstructor_StubFailure) { |
holey = (value > 0 && value < JSObject::kInitialMaxFastElementArray); |
} |
- ASSERT(function->has_initial_map()); |
- ElementsKind kind = function->initial_map()->elements_kind(); |
- if (holey) { |
- kind = GetHoleyElementsKind(kind); |
- } |
- |
MaybeObject* maybe_array; |
if (*type_info != isolate->heap()->undefined_value()) { |
JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(*type_info); |
@@ -224,14 +218,20 @@ RUNTIME_FUNCTION(MaybeObject*, ArrayConstructor_StubFailure) { |
AllocationSiteMode mode = AllocationSiteInfo::GetMode(to_kind); |
if (mode == TRACK_ALLOCATION_SITE) { |
maybe_array = isolate->heap()->AllocateEmptyJSArrayWithAllocationSite( |
- kind, type_info); |
+ to_kind, type_info); |
} else { |
- maybe_array = isolate->heap()->AllocateEmptyJSArray(kind); |
+ maybe_array = isolate->heap()->AllocateEmptyJSArray(to_kind); |
} |
if (!maybe_array->To(&array)) return maybe_array; |
} |
} |
+ ASSERT(function->has_initial_map()); |
+ ElementsKind kind = function->initial_map()->elements_kind(); |
+ if (holey) { |
+ kind = GetHoleyElementsKind(kind); |
+ } |
+ |
if (array == NULL) { |
maybe_array = isolate->heap()->AllocateEmptyJSArray(kind); |
if (!maybe_array->To(&array)) return maybe_array; |