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

Unified Diff: src/builtins.cc

Issue 12767004: In ArrayConstructor_StubFailure the transition elements kind was (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review updates Created 7 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698