Commit a1d7dc40 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

Array.prototype.indexOf: Don't exclude length 2**32-1 from fast path.

I see no reason why it was excluded.

Bug: v8:8386
Change-Id: I291b12444b890db1636b00dec1837e1634b23b35
Reviewed-on: https://chromium-review.googlesource.com/c/1307428Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57145}
parent 192bee6b
......@@ -896,9 +896,9 @@ RUNTIME_FUNCTION(Runtime_ArrayIndexOf) {
}
}
// If the receiver is not a special receiver type, and the length is a valid
// element index, perform fast operation tailored to specific ElementsKinds.
if (!object->map()->IsSpecialReceiverMap() && len < kMaxUInt32 &&
// If the receiver is not a special receiver type, and the length fits
// uint32_t, perform fast operation tailored to specific ElementsKinds.
if (!object->map()->IsSpecialReceiverMap() && len <= kMaxUInt32 &&
JSObject::PrototypeHasNoElements(isolate, JSObject::cast(*object))) {
Handle<JSObject> obj = Handle<JSObject>::cast(object);
ElementsAccessor* elements = obj->GetElementsAccessor();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment