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

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

Issue 2360913003: [interpreter] Compute and use type info percentage (Closed)
Patch Set: address 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
« no previous file with comments | « src/type-feedback-vector.h ('k') | no next file » | 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 4a1c01f1bc9fc096d1f3d2d1ee42220bf09c19f7..78db025252ec056db97d4069bd3ea8e2ea5d9282 100644
--- a/src/type-feedback-vector-inl.h
+++ b/src/type-feedback-vector-inl.h
@@ -148,6 +148,7 @@ CompareOperationHint CompareOperationHintFromFeedback(int type_feedback) {
}
void TypeFeedbackVector::ComputeCounts(int* with_type_info, int* generic,
+ int* vector_ic_count,
bool code_is_interpreted) {
Object* uninitialized_sentinel =
TypeFeedbackVector::RawUninitializedSentinel(GetIsolate());
@@ -155,14 +156,19 @@ void TypeFeedbackVector::ComputeCounts(int* with_type_info, int* generic,
*TypeFeedbackVector::MegamorphicSentinel(GetIsolate());
int with = 0;
int gen = 0;
+ int total = 0;
TypeFeedbackMetadataIterator iter(metadata());
while (iter.HasNext()) {
FeedbackVectorSlot slot = iter.Next();
FeedbackVectorSlotKind kind = iter.kind();
Object* obj = Get(slot);
- if (obj != uninitialized_sentinel &&
- kind != FeedbackVectorSlotKind::GENERAL) {
+ if (kind == FeedbackVectorSlotKind::GENERAL) {
+ continue;
+ }
+ total++;
+
+ if (obj != uninitialized_sentinel) {
if (kind == FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC ||
kind == FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC) {
// If we are not running interpreted code, we need to ignore
@@ -202,6 +208,7 @@ void TypeFeedbackVector::ComputeCounts(int* with_type_info, int* generic,
*with_type_info = with;
*generic = gen;
+ *vector_ic_count = total;
}
Handle<Symbol> TypeFeedbackVector::UninitializedSentinel(Isolate* isolate) {
« no previous file with comments | « src/type-feedback-vector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698