Commit 0cf6ca26 authored by Marja Hölttä's avatar Marja Hölttä Committed by V8 LUCI CQ

[rab/gsab] Add fast path for 'has property'

(No new tests since this is covered by existing tests.)

Bug: v8:11111
Change-Id: I274c54faec24d414e7c99199b32a1a3b88d63aa2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3053587Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75915}
parent c1f438f8
...@@ -9696,7 +9696,7 @@ void CodeStubAssembler::TryLookupElement( ...@@ -9696,7 +9696,7 @@ void CodeStubAssembler::TryLookupElement(
// TODO(verwaest): Support other elements kinds as well. // TODO(verwaest): Support other elements kinds as well.
Label if_isobjectorsmi(this), if_isdouble(this), if_isdictionary(this), Label if_isobjectorsmi(this), if_isdouble(this), if_isdictionary(this),
if_isfaststringwrapper(this), if_isslowstringwrapper(this), if_oob(this), if_isfaststringwrapper(this), if_isslowstringwrapper(this), if_oob(this),
if_typedarray(this); if_typedarray(this), if_rab_gsab_typedarray(this);
// clang-format off // clang-format off
int32_t values[] = { int32_t values[] = {
// Handled by {if_isobjectorsmi}. // Handled by {if_isobjectorsmi}.
...@@ -9726,8 +9726,18 @@ void CodeStubAssembler::TryLookupElement( ...@@ -9726,8 +9726,18 @@ void CodeStubAssembler::TryLookupElement(
UINT8_CLAMPED_ELEMENTS, UINT8_CLAMPED_ELEMENTS,
BIGUINT64_ELEMENTS, BIGUINT64_ELEMENTS,
BIGINT64_ELEMENTS, BIGINT64_ELEMENTS,
RAB_GSAB_UINT8_ELEMENTS,
RAB_GSAB_INT8_ELEMENTS,
RAB_GSAB_UINT16_ELEMENTS,
RAB_GSAB_INT16_ELEMENTS,
RAB_GSAB_UINT32_ELEMENTS,
RAB_GSAB_INT32_ELEMENTS,
RAB_GSAB_FLOAT32_ELEMENTS,
RAB_GSAB_FLOAT64_ELEMENTS,
RAB_GSAB_UINT8_CLAMPED_ELEMENTS,
RAB_GSAB_BIGUINT64_ELEMENTS,
RAB_GSAB_BIGINT64_ELEMENTS,
}; };
// TODO(v8:11111): Support RAB / GSAB.
Label* labels[] = { Label* labels[] = {
&if_isobjectorsmi, &if_isobjectorsmi, &if_isobjectorsmi, &if_isobjectorsmi, &if_isobjectorsmi, &if_isobjectorsmi,
&if_isobjectorsmi, &if_isobjectorsmi, &if_isobjectorsmi, &if_isobjectorsmi, &if_isobjectorsmi, &if_isobjectorsmi,
...@@ -9749,6 +9759,17 @@ void CodeStubAssembler::TryLookupElement( ...@@ -9749,6 +9759,17 @@ void CodeStubAssembler::TryLookupElement(
&if_typedarray, &if_typedarray,
&if_typedarray, &if_typedarray,
&if_typedarray, &if_typedarray,
&if_rab_gsab_typedarray,
&if_rab_gsab_typedarray,
&if_rab_gsab_typedarray,
&if_rab_gsab_typedarray,
&if_rab_gsab_typedarray,
&if_rab_gsab_typedarray,
&if_rab_gsab_typedarray,
&if_rab_gsab_typedarray,
&if_rab_gsab_typedarray,
&if_rab_gsab_typedarray,
&if_rab_gsab_typedarray,
}; };
// clang-format on // clang-format on
STATIC_ASSERT(arraysize(values) == arraysize(labels)); STATIC_ASSERT(arraysize(values) == arraysize(labels));
...@@ -9815,6 +9836,13 @@ void CodeStubAssembler::TryLookupElement( ...@@ -9815,6 +9836,13 @@ void CodeStubAssembler::TryLookupElement(
TNode<UintPtrT> length = LoadJSTypedArrayLength(CAST(object)); TNode<UintPtrT> length = LoadJSTypedArrayLength(CAST(object));
Branch(UintPtrLessThan(intptr_index, length), if_found, if_absent); Branch(UintPtrLessThan(intptr_index, length), if_found, if_absent);
} }
BIND(&if_rab_gsab_typedarray);
{
TNode<JSArrayBuffer> buffer = LoadJSArrayBufferViewBuffer(CAST(object));
TNode<UintPtrT> length =
LoadVariableLengthJSTypedArrayLength(CAST(object), buffer, if_absent);
Branch(UintPtrLessThan(intptr_index, length), if_found, if_absent);
}
BIND(&if_oob); BIND(&if_oob);
{ {
// Positive OOB indices mean "not found", negative indices and indices // Positive OOB indices mean "not found", negative indices and indices
......
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