Commit 28235e94 authored by cbruni's avatar cbruni Committed by Commit bot

Using GetMoreGeneralElementsKind in more places

BUG=

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

Cr-Commit-Position: refs/heads/master@{#30715}
parent 8f403270
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment