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

Unified Diff: src/ic/ic.cc

Issue 2065113002: [ic] LoadGlobalIC caches PropertyCells in the feedback vector. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing Created 4 years, 6 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 | « src/ia32/interface-descriptors-ia32.cc ('k') | src/interface-descriptors.h » ('j') | 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 2d3aaa0fe8d7456f037e188e52d438b1ece46186..e9d4de70960ec73d5aef3e44aee44d26034b153a 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -467,7 +467,11 @@ void LoadIC::Clear(Isolate* isolate, Code* host, LoadICNexus* nexus) {
void LoadGlobalIC::Clear(Isolate* isolate, Code* host,
LoadGlobalICNexus* nexus) {
if (IsCleared(nexus)) return;
- nexus->ConfigureUninitialized();
+ if (FLAG_new_load_global_ic) {
+ nexus->ConfigureUninitialized();
+ } else {
+ nexus->ConfigurePremonomorphic();
+ }
OnTypeFeedbackChanged(isolate, host);
}
@@ -549,7 +553,11 @@ void IC::ConfigureVectorState(Handle<Name> name, Handle<Map> map,
nexus->ConfigureMonomorphic(map, handler);
} else if (kind() == Code::LOAD_GLOBAL_IC) {
LoadGlobalICNexus* nexus = casted_nexus<LoadGlobalICNexus>();
- nexus->ConfigureMonomorphic(map, handler);
+ if (FLAG_new_load_global_ic) {
+ nexus->ConfigureHandlerMode(handler);
+ } else {
+ nexus->ConfigureMonomorphic(map, handler);
+ }
} else if (kind() == Code::KEYED_LOAD_IC) {
KeyedLoadICNexus* nexus = casted_nexus<KeyedLoadICNexus>();
nexus->ConfigureMonomorphic(name, map, handler);
@@ -914,7 +922,8 @@ bool IsCompatibleReceiver(LookupIterator* lookup, Handle<Map> receiver_map) {
void LoadIC::UpdateCaches(LookupIterator* lookup) {
- if (state() == UNINITIALIZED) {
+ if (state() == UNINITIALIZED &&
+ (!FLAG_new_load_global_ic || kind() != Code::LOAD_GLOBAL_IC)) {
// This is the first time we execute this inline cache. Set the target to
// the pre monomorphic stub to delay setting the monomorphic state.
ConfigureVectorState(PREMONOMORPHIC, Handle<Object>());
@@ -936,7 +945,20 @@ void LoadIC::UpdateCaches(LookupIterator* lookup) {
code = slow_stub();
}
} else {
- if (lookup->state() == LookupIterator::ACCESSOR) {
+ if (FLAG_new_load_global_ic && kind() == Code::LOAD_GLOBAL_IC &&
+ lookup->state() == LookupIterator::DATA &&
+ lookup->GetHolder<Object>()->IsJSGlobalObject()) {
+#if DEBUG
+ Handle<Object> holder = lookup->GetHolder<Object>();
+ Handle<Object> receiver = lookup->GetReceiver();
+ DCHECK_EQ(*receiver, *holder);
+#endif
+ // Now update the cell in the feedback vector.
+ LoadGlobalICNexus* nexus = casted_nexus<LoadGlobalICNexus>();
+ nexus->ConfigurePropertyCellMode(lookup->GetPropertyCell());
+ TRACE_IC("LoadGlobalIC", lookup->name());
+ return;
+ } else if (lookup->state() == LookupIterator::ACCESSOR) {
if (!IsCompatibleReceiver(lookup, receiver_map())) {
TRACE_GENERIC_IC(isolate(), "LoadIC", "incompatible receiver type");
code = slow_stub();
« no previous file with comments | « src/ia32/interface-descriptors-ia32.cc ('k') | src/interface-descriptors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698