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

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

Issue 2337123003: [turbofan] Collect invocation counts and compute relative call frequencies. (Closed)
Patch Set: Address feedback. 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
« no previous file with comments | « src/profiler/heap-snapshot-generator.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 ffadcb899414449acc1061a014d2c3de6b060b46..a633fd2cafdecf4dc72fadd461ae7c9ececf4a13 100644
--- a/src/type-feedback-vector.h
+++ b/src/type-feedback-vector.h
@@ -222,9 +222,10 @@ class TypeFeedbackMetadata : public FixedArray {
// The shape of the TypeFeedbackVector is an array with:
// 0: feedback metadata
-// 1: feedback slot #0
+// 1: invocation count
+// 2: feedback slot #0
// ...
-// 1 + slot_count - 1: feedback slot #(slot_count-1)
+// 2 + slot_count - 1: feedback slot #(slot_count-1)
//
class TypeFeedbackVector : public FixedArray {
public:
@@ -232,7 +233,8 @@ class TypeFeedbackVector : public FixedArray {
static inline TypeFeedbackVector* cast(Object* obj);
static const int kMetadataIndex = 0;
- static const int kReservedIndexCount = 1;
+ static const int kInvocationCountIndex = 1;
+ static const int kReservedIndexCount = 2;
inline void ComputeCounts(int* with_type_info, int* generic);
@@ -242,6 +244,7 @@ class TypeFeedbackVector : public FixedArray {
inline int slot_count() const;
inline TypeFeedbackMetadata* metadata() const;
+ inline int invocation_count() const;
// Conversion from a slot to an integer index to the underlying array.
static int GetIndex(FeedbackVectorSlot slot) {
@@ -480,6 +483,10 @@ class CallICNexus final : public FeedbackNexus {
}
int ExtractCallCount();
+
+ // Compute the call frequency based on the call count and the invocation
+ // count (taken from the type feedback vector).
+ float ComputeCallFrequency();
};
« no previous file with comments | « src/profiler/heap-snapshot-generator.cc ('k') | src/type-feedback-vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698