Index: src/builtins/builtins-array.cc |
diff --git a/src/builtins/builtins-array.cc b/src/builtins/builtins-array.cc |
index 3880d8039310bab104f25521e9b748ee93518c58..1a9be329e67b144abd54d8ed924f0ed93bdce231 100644 |
--- a/src/builtins/builtins-array.cc |
+++ b/src/builtins/builtins-array.cc |
@@ -56,7 +56,13 @@ inline bool GetSloppyArgumentsLength(Isolate* isolate, Handle<JSObject> object, |
Object* len_obj = object->InObjectPropertyAt(JSArgumentsObject::kLengthIndex); |
if (!len_obj->IsSmi()) return false; |
*out = Max(0, Smi::cast(len_obj)->value()); |
- return *out <= object->elements()->length(); |
+ |
+ FixedArray* parameters = FixedArray::cast(object->elements()); |
+ if (object->HasSloppyArgumentsElements()) { |
+ FixedArray* arguments = FixedArray::cast(parameters->get(1)); |
+ return *out <= arguments->length(); |
+ } |
+ return *out <= parameters->length(); |
} |
inline bool IsJSArrayFastElementMovingAllowed(Isolate* isolate, |