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

Unified Diff: src/runtime/runtime-array.cc

Issue 1307743011: Adding GetMoreGeneralElementsKind in elements-kind.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix? Created 5 years, 3 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 | « src/objects.cc ('k') | src/runtime/runtime-literals.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-array.cc
diff --git a/src/runtime/runtime-array.cc b/src/runtime/runtime-array.cc
index c93f4423669ce7b14332fc8c06d3b41237f216d8..49eb1ad7024d9b643bccf150a56664bee0cc56a4 100644
--- a/src/runtime/runtime-array.cc
+++ b/src/runtime/runtime-array.cc
@@ -730,21 +730,16 @@ RUNTIME_FUNCTION(Runtime_ArrayConcat) {
Handle<JSArray> array(Handle<JSArray>::cast(obj));
length_estimate = static_cast<uint32_t>(array->length()->Number());
if (length_estimate != 0) {
- ElementsKind array_kind =
- GetPackedElementsKind(array->map()->elements_kind());
- if (IsMoreGeneralElementsKindTransition(kind, array_kind)) {
- kind = array_kind;
- }
+ kind = GetMoreGeneralElementsKind(
+ kind, GetPackedElementsKind(array->map()->elements_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;
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime-literals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698