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

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

Issue 2342853002: [TypeFeedbackVector] special ic slots for interpreter compare/binary ops. (Closed)
Patch Set: Code comments. Created 4 years, 3 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 e21ad93ba6dfff57abe0111222f679598ea88664..e0e6e95a14b9f3e603034b470affbefaf5262e9d 100644
--- a/src/type-feedback-vector.cc
+++ b/src/type-feedback-vector.cc
@@ -202,6 +202,10 @@ const char* TypeFeedbackMetadata::Kind2String(FeedbackVectorSlotKind kind) {
return "STORE_IC";
case FeedbackVectorSlotKind::KEYED_STORE_IC:
return "KEYED_STORE_IC";
+ case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC:
+ return "INTERPRETER_BINARYOP_IC";
+ case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC:
+ return "INTERPRETER_COMPARE_IC";
case FeedbackVectorSlotKind::GENERAL:
return "STUB";
case FeedbackVectorSlotKind::KINDS_NUMBER:
@@ -252,6 +256,9 @@ Handle<TypeFeedbackVector> TypeFeedbackVector::New(
Object* value;
if (kind == FeedbackVectorSlotKind::LOAD_GLOBAL_IC) {
value = *factory->empty_weak_cell();
+ } else if (kind == FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC ||
+ kind == FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC) {
+ value = Smi::FromInt(0);
} else {
value = *uninitialized_sentinel;
}
@@ -339,6 +346,13 @@ void TypeFeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared,
nexus.Clear(shared->code());
break;
}
+ case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC:
+ case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC: {
+ DCHECK(Get(slot)->IsSmi());
+ // don't clear these smi slots.
+ // Set(slot, Smi::FromInt(0));
+ break;
+ }
case FeedbackVectorSlotKind::GENERAL: {
if (obj->IsHeapObject()) {
InstanceType instance_type =
@@ -1037,5 +1051,38 @@ IcCheckType KeyedStoreICNexus::GetKeyType() const {
}
return IsPropertyNameFeedback(feedback) ? PROPERTY : ELEMENT;
}
+
+InlineCacheState BinaryOpICNexus::StateFromFeedback() const {
+ BinaryOperationHint hint = GetBinaryOperationFeedback();
+ if (hint == BinaryOperationHint::kNone) {
+ return UNINITIALIZED;
+ } else if (hint == BinaryOperationHint::kAny) {
+ return GENERIC;
+ }
+
+ return MONOMORPHIC;
+}
+
+InlineCacheState CompareICNexus::StateFromFeedback() const {
+ CompareOperationHint hint = GetCompareOperationFeedback();
+ if (hint == CompareOperationHint::kNone) {
+ return UNINITIALIZED;
+ } else if (hint == CompareOperationHint::kAny) {
+ return GENERIC;
+ }
+
+ return MONOMORPHIC;
+}
+
+BinaryOperationHint BinaryOpICNexus::GetBinaryOperationFeedback() const {
+ int feedback = Smi::cast(GetFeedback())->value();
+ return BinaryOperationHintFromFeedback(feedback);
+}
+
+CompareOperationHint CompareICNexus::GetCompareOperationFeedback() const {
+ int feedback = Smi::cast(GetFeedback())->value();
+ return CompareOperationHintFromFeedback(feedback);
+}
+
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698