Chromium Code Reviews| Index: src/runtime.cc |
| diff --git a/src/runtime.cc b/src/runtime.cc |
| index 08b944a8a1b00fdc3908d9f66d4ea74a76c20245..d8cf3df9cc134d9a1b71487ac22cbdf119b57bd2 100644 |
| --- a/src/runtime.cc |
| +++ b/src/runtime.cc |
| @@ -9695,6 +9695,7 @@ static uint32_t EstimateElementCount(Handle<JSArray> array) { |
| uint32_t length = static_cast<uint32_t>(array->length()->Number()); |
| int element_count = 0; |
| switch (array->GetElementsKind()) { |
| + case FAST_SMI_ONLY_ELEMENTS: |
|
danno
2011/11/04 10:02:04
Add all of the other elements kinds explicitly to
|
| case FAST_ELEMENTS: { |
| // Fast elements can't have lengths that are not representable by |
| // a 32-bit signed integer. |
| @@ -9796,6 +9797,11 @@ static void CollectElementIndices(Handle<JSObject> object, |
| } |
| break; |
| } |
| + case FAST_DOUBLE_ELEMENTS: { |
| + // TODO(1810): Decide if it's worthwhile to implement this. |
| + UNREACHABLE(); |
| + break; |
| + } |
| case DICTIONARY_ELEMENTS: { |
| Handle<NumberDictionary> dict(NumberDictionary::cast(object->elements())); |
| uint32_t capacity = dict->Capacity(); |
| @@ -9926,6 +9932,11 @@ static bool IterateElements(Isolate* isolate, |
| } |
| break; |
| } |
| + case FAST_DOUBLE_ELEMENTS: { |
| + // TODO(1810): Decide if it's worthwhile to implement this. |
| + UNREACHABLE(); |
| + break; |
| + } |
| case DICTIONARY_ELEMENTS: { |
| Handle<NumberDictionary> dict(receiver->element_dictionary()); |
| List<uint32_t> indices(dict->Capacity() / 2); |
| @@ -10036,6 +10047,13 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ArrayConcat) { |
| uint32_t element_estimate; |
| if (obj->IsJSArray()) { |
| Handle<JSArray> array(Handle<JSArray>::cast(obj)); |
| + // TODO(1810): Find out if it's worthwhile to properly support |
| + // arbitrary ElementsKinds. For now, pessimistically transition to |
| + // FAST_ELEMENTS. |
| + if (array->HasFastDoubleElements()) { |
| + array = Handle<JSArray>::cast( |
| + TransitionElementsKind(array, FAST_ELEMENTS)); |
| + } |
| length_estimate = |
| static_cast<uint32_t>(array->length()->Number()); |
| element_estimate = |