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

Unified Diff: src/ic/ic.cc

Issue 2123983004: [ic] Split megamorphic stub cache in two caches (for loads and for stores). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@flags-fix
Patch Set: Rebasing Created 4 years, 5 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
Index: src/ic/ic.cc
diff --git a/src/ic/ic.cc b/src/ic/ic.cc
index 03f0699eb674b3b5dfa1251ed3012c434e81b3aa..f9428917ea4f197a5195989c4a5ecdd180f7d2f8 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -963,9 +963,25 @@ void LoadIC::UpdateCaches(LookupIterator* lookup) {
TRACE_IC("LoadIC", lookup->name());
}
+StubCache* IC::stub_cache() {
+ switch (kind()) {
+ case Code::LOAD_IC:
+ case Code::KEYED_LOAD_IC:
+ return isolate()->load_stub_cache();
+
+ case Code::STORE_IC:
+ case Code::KEYED_STORE_IC:
+ return isolate()->store_stub_cache();
+
+ default:
+ break;
+ }
+ UNREACHABLE();
+ return nullptr;
+}
void IC::UpdateMegamorphicCache(Map* map, Name* name, Code* code) {
- isolate()->stub_cache()->Set(name, map, code);
+ stub_cache()->Set(name, map, code);
}
@@ -1009,7 +1025,7 @@ Handle<Code> IC::ComputeHandler(LookupIterator* lookup, Handle<Object> value) {
if (state() == MEGAMORPHIC && lookup->GetReceiver()->IsHeapObject()) {
Map* map = Handle<HeapObject>::cast(lookup->GetReceiver())->map();
Code* megamorphic_cached_code =
- isolate()->stub_cache()->Get(*lookup->name(), map, code->flags());
+ stub_cache()->Get(*lookup->name(), map, code->flags());
if (megamorphic_cached_code != *code) {
TRACE_HANDLER_STATS(isolate(), IC_HandlerCacheHit);
return code;
« no previous file with comments | « src/ic/ic.h ('k') | src/ic/mips/ic-mips.cc » ('j') | src/ic/x64/stub-cache-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698