Commit 9ba8c337 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[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/666922Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48015}
parent b1cd08da
...@@ -1453,9 +1453,13 @@ TF_BUILTIN(SetHas, CollectionsBuiltinsAssembler) { ...@@ -1453,9 +1453,13 @@ TF_BUILTIN(SetHas, CollectionsBuiltinsAssembler) {
if_key_bigint(this), entry_found(this), not_found(this), done(this); if_key_bigint(this), entry_found(this), not_found(this), done(this);
GotoIf(TaggedIsSmi(key), &if_key_smi); GotoIf(TaggedIsSmi(key), &if_key_smi);
GotoIf(IsString(key), &if_key_string);
GotoIf(IsHeapNumber(key), &if_key_heap_number); Node* key_map = LoadMap(key);
GotoIf(IsBigInt(key), &if_key_bigint); 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>( FindOrderedHashTableEntryForOtherKey<OrderedHashSet>(
context, table, key, &entry_start_position, &entry_found, &not_found); context, table, key, &entry_start_position, &entry_found, &not_found);
...@@ -1648,9 +1652,13 @@ void CollectionsBuiltinsAssembler::TryLookupOrderedHashTableIndex( ...@@ -1648,9 +1652,13 @@ void CollectionsBuiltinsAssembler::TryLookupOrderedHashTableIndex(
if_key_bigint(this); if_key_bigint(this);
GotoIf(TaggedIsSmi(key), &if_key_smi); GotoIf(TaggedIsSmi(key), &if_key_smi);
GotoIf(IsString(key), &if_key_string);
GotoIf(IsHeapNumber(key), &if_key_heap_number); Node* key_map = LoadMap(key);
GotoIf(IsBigInt(key), &if_key_bigint); 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>( FindOrderedHashTableEntryForOtherKey<CollectionType>(
context, table, key, result, if_entry_found, if_not_found); context, table, key, result, if_entry_found, if_not_found);
......
...@@ -3809,8 +3809,7 @@ Node* CodeStubAssembler::IsName(Node* object) { ...@@ -3809,8 +3809,7 @@ Node* CodeStubAssembler::IsName(Node* object) {
} }
Node* CodeStubAssembler::IsString(Node* object) { Node* CodeStubAssembler::IsString(Node* object) {
return Int32LessThan(LoadInstanceType(object), return IsStringInstanceType(LoadInstanceType(object));
Int32Constant(FIRST_NONSTRING_TYPE));
} }
Node* CodeStubAssembler::IsSymbolInstanceType(Node* instance_type) { Node* CodeStubAssembler::IsSymbolInstanceType(Node* instance_type) {
......
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