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

[ic] Stay on the fast path for JSArray::kMaxArrayIndex

... since it's still a valid index.

Change-Id: I498ff27898cefa5df752ac0ad73408ce76ac06c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2327911
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69200}
parent 02b0fc0b
...@@ -393,9 +393,10 @@ void AccessorAssembler::HandleLoadICSmiHandlerCase( ...@@ -393,9 +393,10 @@ void AccessorAssembler::HandleLoadICSmiHandlerCase(
// aren't looked up in the prototype chain. // aren't looked up in the prototype chain.
GotoIf(IsJSTypedArray(CAST(holder)), &return_undefined); GotoIf(IsJSTypedArray(CAST(holder)), &return_undefined);
if (Is64()) { if (Is64()) {
GotoIfNot(UintPtrLessThan(var_intptr_index.value(), GotoIfNot(
IntPtrConstant(JSArray::kMaxArrayIndex)), UintPtrLessThanOrEqual(var_intptr_index.value(),
miss); IntPtrConstant(JSArray::kMaxArrayIndex)),
miss);
} else { } else {
GotoIf(IntPtrLessThan(var_intptr_index.value(), IntPtrConstant(0)), GotoIf(IntPtrLessThan(var_intptr_index.value(), IntPtrConstant(0)),
miss); miss);
...@@ -2318,7 +2319,8 @@ void AccessorAssembler::GenericElementLoad(TNode<HeapObject> receiver, ...@@ -2318,7 +2319,8 @@ void AccessorAssembler::GenericElementLoad(TNode<HeapObject> receiver,
// Positive OOB indices within JSArray index range are effectively the same // Positive OOB indices within JSArray index range are effectively the same
// as hole loads. Larger keys and negative keys are named loads. // as hole loads. Larger keys and negative keys are named loads.
if (Is64()) { if (Is64()) {
Branch(UintPtrLessThan(index, IntPtrConstant(JSArray::kMaxArrayIndex)), Branch(UintPtrLessThanOrEqual(index,
IntPtrConstant(JSArray::kMaxArrayIndex)),
&if_element_hole, slow); &if_element_hole, slow);
} else { } else {
Branch(IntPtrLessThan(index, IntPtrConstant(0)), slow, &if_element_hole); Branch(IntPtrLessThan(index, IntPtrConstant(0)), slow, &if_element_hole);
......
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