Commit 113527b6 authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[ic] Internalize strings on the fly in KeyedStoreICGeneric

Internalizing a key in the KeyedStoreICGeneric avoids an expensive SetProperty runtime call. 
This improves the prepack benchmark by ~5%. 
In the micro-benchmark copy-object.js attached to the bug, it surfaces as a ~2.5x improvement.
The performance improvement currently relies on the stub cache, since we don't search for 
transitions from within the CSA. As this CL puts additional stress on the stub cache, 
performance regressions wouldn't be too surprising.

Bug: v8:6936, v8:6997
Change-Id: Id1469499a3ae5450519ff40d3c5a0915c6de0d45
Reviewed-on: https://chromium-review.googlesource.com/749951Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49097}
parent b48f850a
......@@ -982,7 +982,8 @@ void KeyedStoreGenericAssembler::KeyedStoreGeneric() {
VARIABLE(var_index, MachineType::PointerRepresentation());
VARIABLE(var_unique, MachineRepresentation::kTagged);
var_unique.Bind(name); // Dummy initialization.
Label if_index(this), if_unique_name(this), slow(this);
Label if_index(this), if_unique_name(this), not_internalized(this),
slow(this);
GotoIf(TaggedIsSmi(receiver), &slow);
Node* receiver_map = LoadMap(receiver);
......@@ -993,7 +994,8 @@ void KeyedStoreGenericAssembler::KeyedStoreGeneric() {
Int32Constant(LAST_CUSTOM_ELEMENTS_RECEIVER)),
&slow);
TryToName(name, &if_index, &var_index, &if_unique_name, &var_unique, &slow);
TryToName(name, &if_index, &var_index, &if_unique_name, &var_unique, &slow,
&not_internalized);
BIND(&if_index);
{
......@@ -1010,6 +1012,16 @@ void KeyedStoreGenericAssembler::KeyedStoreGeneric() {
EmitGenericPropertyStore(receiver, receiver_map, &p, &slow);
}
BIND(&not_internalized);
{
if (FLAG_internalize_on_the_fly) {
TryInternalizeString(name, &if_index, &var_index, &if_unique_name,
&var_unique, &slow, &slow);
} else {
Goto(&slow);
}
}
BIND(&slow);
{
Comment("KeyedStoreGeneric_slow");
......
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