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

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

Issue 1476413003: Provide call counts for constructor calls, surface them as a vector IC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 5 years, 1 month 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/objects-printer.cc ('k') | src/type-feedback-vector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « src/objects-printer.cc ('k') | src/type-feedback-vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698