Using GetMoreGeneralElementsKind in more places

BUG=

Review URL: https://codereview.chromium.org/1338983003

Cr-Commit-Position: refs/heads/master@{#30715}
This commit is contained in:
cbruni 2015-09-14 05:16:54 -07:00 committed by Commit bot
parent 8f40327067
commit 28235e94cf
2 changed files with 5 additions and 11 deletions

View File

@ -1228,19 +1228,15 @@ Object* Slow_ArrayConcat(Arguments* args, Isolate* isolate) {
if (length_estimate != 0) {
ElementsKind array_kind =
GetPackedElementsKind(array->map()->elements_kind());
if (IsMoreGeneralElementsKindTransition(kind, array_kind)) {
kind = array_kind;
}
kind = GetMoreGeneralElementsKind(kind, array_kind);
}
element_estimate = EstimateElementCount(array);
} else {
if (obj->IsHeapObject()) {
if (obj->IsNumber()) {
if (IsMoreGeneralElementsKindTransition(kind, FAST_DOUBLE_ELEMENTS)) {
kind = FAST_DOUBLE_ELEMENTS;
}
} else if (IsMoreGeneralElementsKindTransition(kind, FAST_ELEMENTS)) {
kind = FAST_ELEMENTS;
kind = GetMoreGeneralElementsKind(kind, FAST_DOUBLE_ELEMENTS);
} else {
kind = GetMoreGeneralElementsKind(kind, FAST_ELEMENTS);
}
}
length_estimate = 1;

View File

@ -2375,9 +2375,7 @@ Handle<JSArray> ElementsAccessor::Concat(Isolate* isolate, Arguments* args,
ElementsKind arg_kind = JSArray::cast(arg)->map()->elements_kind();
has_double = has_double || IsFastDoubleElementsKind(arg_kind);
is_holey = is_holey || IsFastHoleyElementsKind(arg_kind);
if (IsMoreGeneralElementsKindTransition(elements_kind, arg_kind)) {
elements_kind = arg_kind;
}
elements_kind = GetMoreGeneralElementsKind(elements_kind, arg_kind);
}
if (is_holey) {
elements_kind = GetHoleyElementsKind(elements_kind);