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:
parent
8f40327067
commit
28235e94cf
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user