Index: src/type-feedback-vector.h |
diff --git a/src/type-feedback-vector.h b/src/type-feedback-vector.h |
index 05dfff7dba302b9b54279bf931f3f2ab60ba889b..7fb4cf326cbc741982fca2fc65e602322aeb13b5 100644 |
--- a/src/type-feedback-vector.h |
+++ b/src/type-feedback-vector.h |
@@ -23,6 +23,7 @@ enum class FeedbackVectorSlotKind { |
INVALID, |
CALL_IC, |
+ CONSTRUCT_IC, |
LOAD_IC, |
KEYED_LOAD_IC, |
STORE_IC, |
@@ -47,6 +48,10 @@ class FeedbackVectorSpecBase { |
return AddSlot(FeedbackVectorSlotKind::CALL_IC); |
} |
+ FeedbackVectorSlot AddConstructICSlot() { |
+ return AddSlot(FeedbackVectorSlotKind::CONSTRUCT_IC); |
+ } |
+ |
FeedbackVectorSlot AddLoadICSlot() { |
return AddSlot(FeedbackVectorSlotKind::LOAD_IC); |
} |
@@ -155,7 +160,7 @@ class TypeFeedbackMetadata : public FixedArray { |
static const char* Kind2String(FeedbackVectorSlotKind kind); |
private: |
- static const int kFeedbackVectorSlotKindBits = 3; |
+ static const int kFeedbackVectorSlotKindBits = 4; |
STATIC_ASSERT(static_cast<int>(FeedbackVectorSlotKind::KINDS_NUMBER) < |
(1 << kFeedbackVectorSlotKindBits)); |
@@ -399,7 +404,7 @@ class FeedbackNexus { |
}; |
-class CallICNexus final : public FeedbackNexus { |
+class CallICNexus : public FeedbackNexus { |
public: |
// Monomorphic call ics store call counts. Platform code needs to increment |
// the count appropriately (ie, by 2). |
@@ -407,11 +412,13 @@ class CallICNexus final : public FeedbackNexus { |
CallICNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot) |
: FeedbackNexus(vector, slot) { |
- DCHECK_EQ(FeedbackVectorSlotKind::CALL_IC, vector->GetKind(slot)); |
+ DCHECK(vector->GetKind(slot) == FeedbackVectorSlotKind::CALL_IC || |
+ vector->GetKind(slot) == FeedbackVectorSlotKind::CONSTRUCT_IC); |
} |
CallICNexus(TypeFeedbackVector* vector, FeedbackVectorSlot slot) |
: FeedbackNexus(vector, slot) { |
- DCHECK_EQ(FeedbackVectorSlotKind::CALL_IC, vector->GetKind(slot)); |
+ DCHECK(vector->GetKind(slot) == FeedbackVectorSlotKind::CALL_IC || |
+ vector->GetKind(slot) == FeedbackVectorSlotKind::CONSTRUCT_IC); |
} |
void Clear(Code* host); |
@@ -434,10 +441,22 @@ class CallICNexus final : public FeedbackNexus { |
return length == 0; |
} |
+ Handle<Object> GetCallFeedback(); |
int ExtractCallCount(); |
}; |
+class ConstructICNexus final : public CallICNexus { |
+ public: |
+ ConstructICNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot) |
+ : CallICNexus(vector, slot) {} |
+ ConstructICNexus(TypeFeedbackVector* vector, FeedbackVectorSlot slot) |
+ : CallICNexus(vector, slot) {} |
+ |
+ void Clear(Code* host); |
+}; |
+ |
+ |
class LoadICNexus : public FeedbackNexus { |
public: |
LoadICNexus(Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot) |