Commit c9ce4fb6 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[CSA][cleanup] TNodify low hanging fruits in interpreter-generator

TNodify:
 * FloatOp
 * BigIntOp
 * Loads into their respective types
 * return type of:
  * GetContextAtDepth
  * ConstructWithSpread
  * Construct
  * CallBuiltin


Also TNodify CheckEnumCache in code-stub-assembler.

Bug: v8:6949, v8:9396
Change-Id: I79a90296b4851e47f4b89ed52fadfc9b61be1e6a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1789161
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63625}
parent 0a31d508
...@@ -719,11 +719,11 @@ TF_BUILTIN(SetDataProperties, SetOrCopyDataPropertiesAssembler) { ...@@ -719,11 +719,11 @@ TF_BUILTIN(SetDataProperties, SetOrCopyDataPropertiesAssembler) {
} }
TF_BUILTIN(ForInEnumerate, CodeStubAssembler) { TF_BUILTIN(ForInEnumerate, CodeStubAssembler) {
Node* receiver = Parameter(Descriptor::kReceiver); TNode<HeapObject> receiver = CAST(Parameter(Descriptor::kReceiver));
Node* context = Parameter(Descriptor::kContext); TNode<Context> context = CAST(Parameter(Descriptor::kContext));
Label if_empty(this), if_runtime(this, Label::kDeferred); Label if_empty(this), if_runtime(this, Label::kDeferred);
Node* receiver_map = CheckEnumCache(receiver, &if_empty, &if_runtime); TNode<Map> receiver_map = CheckEnumCache(receiver, &if_empty, &if_runtime);
Return(receiver_map); Return(receiver_map);
BIND(&if_empty); BIND(&if_empty);
......
...@@ -1695,7 +1695,7 @@ void CodeStubAssembler::GotoIfMapHasSlowProperties(TNode<Map> map, ...@@ -1695,7 +1695,7 @@ void CodeStubAssembler::GotoIfMapHasSlowProperties(TNode<Map> map,
} }
TNode<HeapObject> CodeStubAssembler::LoadFastProperties( TNode<HeapObject> CodeStubAssembler::LoadFastProperties(
SloppyTNode<JSObject> object) { SloppyTNode<JSReceiver> object) {
CSA_SLOW_ASSERT(this, Word32BinaryNot(IsDictionaryMap(LoadMap(object)))); CSA_SLOW_ASSERT(this, Word32BinaryNot(IsDictionaryMap(LoadMap(object))));
TNode<Object> properties = LoadJSReceiverPropertiesOrHash(object); TNode<Object> properties = LoadJSReceiverPropertiesOrHash(object);
return Select<HeapObject>( return Select<HeapObject>(
...@@ -1704,7 +1704,7 @@ TNode<HeapObject> CodeStubAssembler::LoadFastProperties( ...@@ -1704,7 +1704,7 @@ TNode<HeapObject> CodeStubAssembler::LoadFastProperties(
} }
TNode<HeapObject> CodeStubAssembler::LoadSlowProperties( TNode<HeapObject> CodeStubAssembler::LoadSlowProperties(
SloppyTNode<JSObject> object) { SloppyTNode<JSReceiver> object) {
CSA_SLOW_ASSERT(this, IsDictionaryMap(LoadMap(object))); CSA_SLOW_ASSERT(this, IsDictionaryMap(LoadMap(object)));
TNode<Object> properties = LoadJSReceiverPropertiesOrHash(object); TNode<Object> properties = LoadJSReceiverPropertiesOrHash(object);
return Select<HeapObject>( return Select<HeapObject>(
...@@ -13977,7 +13977,8 @@ void CodeStubAssembler::CheckPrototypeEnumCache(Node* receiver, ...@@ -13977,7 +13977,8 @@ void CodeStubAssembler::CheckPrototypeEnumCache(Node* receiver,
} }
} }
Node* CodeStubAssembler::CheckEnumCache(Node* receiver, Label* if_empty, TNode<Map> CodeStubAssembler::CheckEnumCache(TNode<HeapObject> receiver,
Label* if_empty,
Label* if_runtime) { Label* if_runtime) {
Label if_fast(this), if_cache(this), if_no_cache(this, Label::kDeferred); Label if_fast(this), if_cache(this), if_no_cache(this, Label::kDeferred);
TNode<Map> receiver_map = LoadMap(receiver); TNode<Map> receiver_map = LoadMap(receiver);
...@@ -13993,7 +13994,7 @@ Node* CodeStubAssembler::CheckEnumCache(Node* receiver, Label* if_empty, ...@@ -13993,7 +13994,7 @@ Node* CodeStubAssembler::CheckEnumCache(Node* receiver, Label* if_empty,
{ {
// Avoid runtime-call for empty dictionary receivers. // Avoid runtime-call for empty dictionary receivers.
GotoIfNot(IsDictionaryMap(receiver_map), if_runtime); GotoIfNot(IsDictionaryMap(receiver_map), if_runtime);
TNode<NameDictionary> properties = CAST(LoadSlowProperties(receiver)); TNode<NameDictionary> properties = CAST(LoadSlowProperties(CAST(receiver)));
TNode<Smi> length = GetNumberOfElements(properties); TNode<Smi> length = GetNumberOfElements(properties);
GotoIfNot(TaggedEqual(length, SmiConstant(0)), if_runtime); GotoIfNot(TaggedEqual(length, SmiConstant(0)), if_runtime);
// Check that there are no elements on the {receiver} and its prototype // Check that there are no elements on the {receiver} and its prototype
......
...@@ -1061,9 +1061,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -1061,9 +1061,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<Word32T> IsStringWrapperElementsKind(TNode<Map> map); TNode<Word32T> IsStringWrapperElementsKind(TNode<Map> map);
void GotoIfMapHasSlowProperties(TNode<Map> map, Label* if_slow); void GotoIfMapHasSlowProperties(TNode<Map> map, Label* if_slow);
// Load the properties backing store of a JSObject. // Load the properties backing store of a JSReceiver.
TNode<HeapObject> LoadSlowProperties(SloppyTNode<JSObject> object); TNode<HeapObject> LoadSlowProperties(SloppyTNode<JSReceiver> object);
TNode<HeapObject> LoadFastProperties(SloppyTNode<JSObject> object); TNode<HeapObject> LoadFastProperties(SloppyTNode<JSReceiver> object);
// Load the elements backing store of a JSObject. // Load the elements backing store of a JSObject.
TNode<FixedArrayBase> LoadElements(SloppyTNode<JSObject> object) { TNode<FixedArrayBase> LoadElements(SloppyTNode<JSObject> object) {
return LoadJSObjectElements(object); return LoadJSObjectElements(object);
...@@ -3490,7 +3490,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -3490,7 +3490,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// for..in helpers // for..in helpers
void CheckPrototypeEnumCache(Node* receiver, Node* receiver_map, void CheckPrototypeEnumCache(Node* receiver, Node* receiver_map,
Label* if_fast, Label* if_slow); Label* if_fast, Label* if_slow);
Node* CheckEnumCache(Node* receiver, Label* if_empty, Label* if_runtime); TNode<Map> CheckEnumCache(TNode<HeapObject> receiver, Label* if_empty,
Label* if_runtime);
TNode<Object> GetArgumentValue(TorqueStructArguments args, TNode<Object> GetArgumentValue(TorqueStructArguments args,
TNode<IntPtrT> index); TNode<IntPtrT> index);
......
...@@ -835,7 +835,7 @@ void KeyedStoreGenericAssembler::EmitGenericPropertyStore( ...@@ -835,7 +835,7 @@ void KeyedStoreGenericAssembler::EmitGenericPropertyStore(
TVARIABLE(IntPtrT, var_name_index); TVARIABLE(IntPtrT, var_name_index);
Label dictionary_found(this, &var_name_index), not_found(this); Label dictionary_found(this, &var_name_index), not_found(this);
TNode<NameDictionary> properties = CAST(LoadSlowProperties(CAST(receiver))); TNode<NameDictionary> properties = CAST(LoadSlowProperties(receiver));
NameDictionaryLookup<NameDictionary>(properties, name, &dictionary_found, NameDictionaryLookup<NameDictionary>(properties, name, &dictionary_found,
&var_name_index, &not_found); &var_name_index, &not_found);
BIND(&dictionary_found); BIND(&dictionary_found);
......
This diff is collapsed.
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