Commit 1785fc36 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[StoreIC] Don't create handlers for fresh transitions

This is a performance experiment. We will revert it if it causes
regressions.
The idea is that many map transitions are only performed once; but if
they are done by a non-UNINITIALIZED StoreIC, we would always create
a handler for them. With this CL, handler creation is postponed until
the second time a given transition is done. The first time, the IC
simply remains in its previous state.

Change-Id: I0fb2989bb675a09ed7b329520346048ad2049f94
Reviewed-on: https://chromium-review.googlesource.com/622147Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47483}
parent 9e839fce
......@@ -1683,6 +1683,12 @@ void StoreIC::UpdateCaches(LookupIterator* lookup, Handle<Object> value,
if (!cached_handler.is_null()) {
handler = cached_handler.ToHandleChecked();
} else if (LookupForWrite(lookup, value, store_mode)) {
if (created_new_transition_) {
// The first time a transition is performed, there's a good chance that
// it won't be taken again, so don't bother creating a handler.
TRACE_IC("StoreIC", lookup->name());
return;
}
handler = ComputeHandler(lookup);
} else {
TRACE_GENERIC_IC("LookupForWrite said 'false'");
......@@ -1795,10 +1801,8 @@ Handle<Object> StoreIC::GetMapIndependentHandler(LookupIterator* lookup) {
TRACE_HANDLER_STATS(isolate(), StoreIC_StoreTransitionDH);
Handle<Object> handler =
StoreTransition(receiver_map(), holder, transition, lookup->name());
if (!created_new_transition_) {
TransitionsAccessor(receiver_map())
.UpdateHandler(*lookup->name(), *handler);
}
TransitionsAccessor(receiver_map())
.UpdateHandler(*lookup->name(), *handler);
return handler;
}
......
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