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

Unified Diff: src/type-feedback-vector-inl.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/type-feedback-vector.cc ('k') | test/cctest/interpreter/bytecode_expectations/ArrayLiterals.golden » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-feedback-vector-inl.h
diff --git a/src/type-feedback-vector-inl.h b/src/type-feedback-vector-inl.h
index 771021fb99d410b56d7c7c45c553cef0624ab613..4675c62b8ccaaa6a39fc3a786e269bf318bf0305 100644
--- a/src/type-feedback-vector-inl.h
+++ b/src/type-feedback-vector-inl.h
@@ -77,22 +77,20 @@ bool TypeFeedbackMetadata::SlotRequiresName(FeedbackVectorSlotKind kind) {
}
bool TypeFeedbackVector::is_empty() const {
- if (length() == 0) return true;
- DCHECK(length() > kReservedIndexCount);
- return false;
+ return length() == kReservedIndexCount;
}
-
int TypeFeedbackVector::slot_count() const {
- if (length() == 0) return 0;
- DCHECK(length() > kReservedIndexCount);
return length() - kReservedIndexCount;
}
TypeFeedbackMetadata* TypeFeedbackVector::metadata() const {
- return is_empty() ? TypeFeedbackMetadata::cast(GetHeap()->empty_fixed_array())
- : TypeFeedbackMetadata::cast(get(kMetadataIndex));
+ return TypeFeedbackMetadata::cast(get(kMetadataIndex));
+}
+
+int TypeFeedbackVector::invocation_count() const {
+ return Smi::cast(get(kInvocationCountIndex))->value();
}
// Conversion from an integer index to either a slot or an ic slot.
« no previous file with comments | « src/type-feedback-vector.cc ('k') | test/cctest/interpreter/bytecode_expectations/ArrayLiterals.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698