[collections] Avoid repeatedly loading same map and instance type.
The difference seems to matter at least in one benchmark. R=jarin@chromium.org Bug: chromium:764644 Change-Id: I6d74fbbd8026942637d2301da805b003a9e58af7 Reviewed-on: https://chromium-review.googlesource.com/666922 Reviewed-by: Jaroslav Sevcik <jarin@chromium.org> Commit-Queue: Georg Neis <neis@chromium.org> Cr-Commit-Position: refs/heads/master@{#48015}
This commit is contained in:
parent
b1cd08daf7
commit
9ba8c3374d
@ -1453,9 +1453,13 @@ TF_BUILTIN(SetHas, CollectionsBuiltinsAssembler) {
|
||||
if_key_bigint(this), entry_found(this), not_found(this), done(this);
|
||||
|
||||
GotoIf(TaggedIsSmi(key), &if_key_smi);
|
||||
GotoIf(IsString(key), &if_key_string);
|
||||
GotoIf(IsHeapNumber(key), &if_key_heap_number);
|
||||
GotoIf(IsBigInt(key), &if_key_bigint);
|
||||
|
||||
Node* key_map = LoadMap(key);
|
||||
Node* key_instance_type = LoadMapInstanceType(key_map);
|
||||
|
||||
GotoIf(IsStringInstanceType(key_instance_type), &if_key_string);
|
||||
GotoIf(IsHeapNumberMap(key_map), &if_key_heap_number);
|
||||
GotoIf(IsBigIntInstanceType(key_instance_type), &if_key_bigint);
|
||||
|
||||
FindOrderedHashTableEntryForOtherKey<OrderedHashSet>(
|
||||
context, table, key, &entry_start_position, &entry_found, ¬_found);
|
||||
@ -1648,9 +1652,13 @@ void CollectionsBuiltinsAssembler::TryLookupOrderedHashTableIndex(
|
||||
if_key_bigint(this);
|
||||
|
||||
GotoIf(TaggedIsSmi(key), &if_key_smi);
|
||||
GotoIf(IsString(key), &if_key_string);
|
||||
GotoIf(IsHeapNumber(key), &if_key_heap_number);
|
||||
GotoIf(IsBigInt(key), &if_key_bigint);
|
||||
|
||||
Node* key_map = LoadMap(key);
|
||||
Node* key_instance_type = LoadMapInstanceType(key_map);
|
||||
|
||||
GotoIf(IsStringInstanceType(key_instance_type), &if_key_string);
|
||||
GotoIf(IsHeapNumberMap(key_map), &if_key_heap_number);
|
||||
GotoIf(IsBigIntInstanceType(key_instance_type), &if_key_bigint);
|
||||
|
||||
FindOrderedHashTableEntryForOtherKey<CollectionType>(
|
||||
context, table, key, result, if_entry_found, if_not_found);
|
||||
|
@ -3809,8 +3809,7 @@ Node* CodeStubAssembler::IsName(Node* object) {
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsString(Node* object) {
|
||||
return Int32LessThan(LoadInstanceType(object),
|
||||
Int32Constant(FIRST_NONSTRING_TYPE));
|
||||
return IsStringInstanceType(LoadInstanceType(object));
|
||||
}
|
||||
|
||||
Node* CodeStubAssembler::IsSymbolInstanceType(Node* instance_type) {
|
||||
|
Loading…
Reference in New Issue
Block a user