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

Unified Diff: src/type-feedback-vector.cc

Issue 1912593002: [ic] Restore PROPERTY key tracking in keyed ICs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/type-feedback-vector.cc
diff --git a/src/type-feedback-vector.cc b/src/type-feedback-vector.cc
index 9e60fcffa768559697acabea14bc8cfe29c602b4..4519bd65c2c2d79ae6989049d7f1d70070577f07 100644
--- a/src/type-feedback-vector.cc
+++ b/src/type-feedback-vector.cc
@@ -340,6 +340,10 @@ void FeedbackNexus::ConfigurePremonomorphic() {
void FeedbackNexus::ConfigureMegamorphic() {
+ // Keyed ICs must use ConfigureMegamorphicKeyed.
+ DCHECK_NE(FeedbackVectorSlotKind::KEYED_LOAD_IC, vector()->GetKind(slot()));
+ DCHECK_NE(FeedbackVectorSlotKind::KEYED_STORE_IC, vector()->GetKind(slot()));
+
Isolate* isolate = GetIsolate();
SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(isolate),
SKIP_WRITE_BARRIER);
@@ -347,6 +351,21 @@ void FeedbackNexus::ConfigureMegamorphic() {
SKIP_WRITE_BARRIER);
}
+void KeyedLoadICNexus::ConfigureMegamorphicKeyed(IcCheckType property_type) {
+ Isolate* isolate = GetIsolate();
+ SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(isolate),
+ SKIP_WRITE_BARRIER);
+ SetFeedbackExtra(Smi::FromInt(static_cast<int>(property_type)),
+ SKIP_WRITE_BARRIER);
+}
+
+void KeyedStoreICNexus::ConfigureMegamorphicKeyed(IcCheckType property_type) {
+ Isolate* isolate = GetIsolate();
+ SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(isolate),
+ SKIP_WRITE_BARRIER);
+ SetFeedbackExtra(Smi::FromInt(static_cast<int>(property_type)),
+ SKIP_WRITE_BARRIER);
+}
InlineCacheState LoadICNexus::StateFromFeedback() const {
Isolate* isolate = GetIsolate();
@@ -824,10 +843,20 @@ KeyedAccessStoreMode KeyedStoreICNexus::GetKeyedAccessStoreMode() const {
return mode;
}
+IcCheckType KeyedLoadICNexus::GetKeyType() const {
+ Object* feedback = GetFeedback();
+ if (feedback == *TypeFeedbackVector::MegamorphicSentinel(GetIsolate())) {
+ return static_cast<IcCheckType>(Smi::cast(GetFeedbackExtra())->value());
+ }
+ return IsPropertyNameFeedback(feedback) ? PROPERTY : ELEMENT;
+}
IcCheckType KeyedStoreICNexus::GetKeyType() const {
- // The structure of the vector slots tells us the type.
- return GetFeedback()->IsName() ? PROPERTY : ELEMENT;
+ Object* feedback = GetFeedback();
+ if (feedback == *TypeFeedbackVector::MegamorphicSentinel(GetIsolate())) {
+ return static_cast<IcCheckType>(Smi::cast(GetFeedbackExtra())->value());
+ }
+ return IsPropertyNameFeedback(feedback) ? PROPERTY : ELEMENT;
}
} // namespace internal
} // namespace v8
« src/ic/ic.h ('K') | « src/type-feedback-vector.h ('k') | src/type-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698