Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 5c1e9aa653684776f9a1cf4d307b941f8dbacc35..4ca3fead1782def067a3f38d354dc2791547ebff 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -14505,8 +14505,8 @@ int JSObject::GetFastElementsUsage() { |
case FAST_SMI_ELEMENTS: |
case FAST_DOUBLE_ELEMENTS: |
case FAST_ELEMENTS: |
- // Only JSArray have packed elements. |
- return Smi::cast(JSArray::cast(this)->length())->value(); |
+ return IsJSArray() ? Smi::cast(JSArray::cast(this)->length())->value() |
+ : store->length(); |
case FAST_SLOPPY_ARGUMENTS_ELEMENTS: |
store = FixedArray::cast(FixedArray::cast(store)->get(1)); |
// Fall through. |