Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(663)

Unified Diff: src/ic/ic.cc

Issue 859943003: Let KeyedStoreIC go megamorphic (instead of generic) when the same map misses twice (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic.cc
diff --git a/src/ic/ic.cc b/src/ic/ic.cc
index c729dfd17983a7119d3d037a39ca111b13a4c8bc..0324d992144247bba016d8eb01e4cb0faeb85a81 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -1865,9 +1865,13 @@ Handle<Code> KeyedStoreIC::StoreElementStub(Handle<JSObject> receiver,
if (!map_added) {
// If the miss wasn't due to an unseen map, a polymorphic stub
- // won't help, use the generic stub.
+ // won't help. In theory we should use the generic stub, but in
+ // practice there are a number of hard-to-avoid reasons why this
+ // can happen occasionally, and where the additional logic in the
+ // megamorphic stub is beneficial because it can handle most cases
+ // without calling into the runtime.
TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "same map added twice");
- return generic_stub();
+ return megamorphic_stub();
}
// If the maximum number of receiver maps has been exceeded, use the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698