Commit 328c166e authored by Maya Lekova's avatar Maya Lekova Committed by Commit Bot

[cleanup] TNodify TryLookupElement

Bug: v8:10021
Change-Id: Ic9fecc8cdea8457652637bc3128addc145061be0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1993965
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarSantiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65693}
parent d8fe5b9d
...@@ -398,7 +398,7 @@ TF_BUILTIN(ObjectPrototypeHasOwnProperty, ObjectBuiltinsAssembler) { ...@@ -398,7 +398,7 @@ TF_BUILTIN(ObjectPrototypeHasOwnProperty, ObjectBuiltinsAssembler) {
BIND(&if_index); BIND(&if_index);
{ {
TryLookupElement(object, map, instance_type, var_index.value(), TryLookupElement(CAST(object), map, instance_type, var_index.value(),
&return_true, &return_false, &return_false, &return_true, &return_false, &return_false,
&call_runtime); &call_runtime);
} }
......
...@@ -8863,12 +8863,10 @@ void CodeStubAssembler::TryGetOwnProperty( ...@@ -8863,12 +8863,10 @@ void CodeStubAssembler::TryGetOwnProperty(
} }
} }
void CodeStubAssembler::TryLookupElement(Node* object, Node* map, void CodeStubAssembler::TryLookupElement(
SloppyTNode<Int32T> instance_type, TNode<HeapObject> object, TNode<Map> map, SloppyTNode<Int32T> instance_type,
SloppyTNode<IntPtrT> intptr_index, SloppyTNode<IntPtrT> intptr_index, Label* if_found, Label* if_absent,
Label* if_found, Label* if_absent, Label* if_not_found, Label* if_bailout) {
Label* if_not_found,
Label* if_bailout) {
// Handle special objects in runtime. // Handle special objects in runtime.
GotoIf(IsSpecialReceiverInstanceType(instance_type), if_bailout); GotoIf(IsSpecialReceiverInstanceType(instance_type), if_bailout);
...@@ -8936,7 +8934,7 @@ void CodeStubAssembler::TryLookupElement(Node* object, Node* map, ...@@ -8936,7 +8934,7 @@ void CodeStubAssembler::TryLookupElement(Node* object, Node* map,
BIND(&if_isobjectorsmi); BIND(&if_isobjectorsmi);
{ {
TNode<FixedArray> elements = CAST(LoadElements(object)); TNode<FixedArray> elements = CAST(LoadElements(CAST(object)));
TNode<IntPtrT> length = LoadAndUntagFixedArrayBaseLength(elements); TNode<IntPtrT> length = LoadAndUntagFixedArrayBaseLength(elements);
GotoIfNot(UintPtrLessThan(intptr_index, length), &if_oob); GotoIfNot(UintPtrLessThan(intptr_index, length), &if_oob);
...@@ -8947,7 +8945,7 @@ void CodeStubAssembler::TryLookupElement(Node* object, Node* map, ...@@ -8947,7 +8945,7 @@ void CodeStubAssembler::TryLookupElement(Node* object, Node* map,
} }
BIND(&if_isdouble); BIND(&if_isdouble);
{ {
TNode<FixedArrayBase> elements = LoadElements(object); TNode<FixedArrayBase> elements = LoadElements(CAST(object));
TNode<IntPtrT> length = LoadAndUntagFixedArrayBaseLength(elements); TNode<IntPtrT> length = LoadAndUntagFixedArrayBaseLength(elements);
GotoIfNot(UintPtrLessThan(intptr_index, length), &if_oob); GotoIfNot(UintPtrLessThan(intptr_index, length), &if_oob);
...@@ -8970,7 +8968,7 @@ void CodeStubAssembler::TryLookupElement(Node* object, Node* map, ...@@ -8970,7 +8968,7 @@ void CodeStubAssembler::TryLookupElement(Node* object, Node* map,
} }
TVARIABLE(IntPtrT, var_entry); TVARIABLE(IntPtrT, var_entry);
TNode<NumberDictionary> elements = CAST(LoadElements(object)); TNode<NumberDictionary> elements = CAST(LoadElements(CAST(object)));
NumberDictionaryLookup(elements, intptr_index, if_found, &var_entry, NumberDictionaryLookup(elements, intptr_index, if_found, &var_entry,
if_not_found); if_not_found);
} }
......
...@@ -3193,7 +3193,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -3193,7 +3193,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// This method jumps to if_found if the element is known to exist. To // This method jumps to if_found if the element is known to exist. To
// if_absent if it's known to not exist. To if_not_found if the prototype // if_absent if it's known to not exist. To if_not_found if the prototype
// chain needs to be checked. And if_bailout if the lookup is unsupported. // chain needs to be checked. And if_bailout if the lookup is unsupported.
void TryLookupElement(Node* object, Node* map, void TryLookupElement(TNode<HeapObject> object, TNode<Map> map,
SloppyTNode<Int32T> instance_type, SloppyTNode<Int32T> instance_type,
SloppyTNode<IntPtrT> intptr_index, Label* if_found, SloppyTNode<IntPtrT> intptr_index, Label* if_found,
Label* if_absent, Label* if_not_found, Label* if_absent, Label* if_not_found,
......
...@@ -1617,7 +1617,7 @@ TEST(TryLookupElement) { ...@@ -1617,7 +1617,7 @@ TEST(TryLookupElement) {
enum Result { kFound, kAbsent, kNotFound, kBailout }; enum Result { kFound, kAbsent, kNotFound, kBailout };
{ {
Node* object = m.Parameter(0); TNode<HeapObject> object = m.CAST(m.Parameter(0));
TNode<IntPtrT> index = m.SmiUntag(m.Parameter(1)); TNode<IntPtrT> index = m.SmiUntag(m.Parameter(1));
TNode<MaybeObject> expected_result = TNode<MaybeObject> expected_result =
m.UncheckedCast<MaybeObject>(m.Parameter(2)); m.UncheckedCast<MaybeObject>(m.Parameter(2));
......
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