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

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

Issue 2325083003: Record call counts also for megamorphic calls. (Closed)
Patch Set: Address test failure. 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') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-feedback-vector.cc
diff --git a/src/type-feedback-vector.cc b/src/type-feedback-vector.cc
index 61f5e8b9c7d095a74ceb34d7bd3b5be89f5652dc..5a2f2e929cec8fa622c5f6cc81ad449a3a04759a 100644
--- a/src/type-feedback-vector.cc
+++ b/src/type-feedback-vector.cc
@@ -255,7 +255,10 @@ Handle<TypeFeedbackVector> TypeFeedbackVector::New(
}
array->set(index, value, SKIP_WRITE_BARRIER);
for (int j = 1; j < entry_size; j++) {
- array->set(index + j, *uninitialized_sentinel, SKIP_WRITE_BARRIER);
+ array->set(index + j, kind == FeedbackVectorSlotKind::CALL_IC
Benedikt Meurer 2016/09/13 10:34:58 Nit: Hoist the value selection out of the loop.
+ ? Smi::FromInt(0)
+ : *uninitialized_sentinel,
+ SKIP_WRITE_BARRIER);
}
i += entry_size;
}
@@ -620,16 +623,19 @@ InlineCacheState CallICNexus::StateFromFeedback() const {
int CallICNexus::ExtractCallCount() {
Object* call_count = GetFeedbackExtra();
- if (call_count->IsSmi()) {
- int value = Smi::cast(call_count)->value();
- return value;
- }
- return -1;
+ CHECK(call_count->IsSmi());
+ int value = Smi::cast(call_count)->value();
+ return value;
}
-
void CallICNexus::Clear(Code* host) { CallIC::Clear(GetIsolate(), host, this); }
+void CallICNexus::ConfigureUninitialized() {
+ Isolate* isolate = GetIsolate();
+ SetFeedback(*TypeFeedbackVector::UninitializedSentinel(isolate),
+ SKIP_WRITE_BARRIER);
+ SetFeedbackExtra(Smi::FromInt(0), SKIP_WRITE_BARRIER);
+}
void CallICNexus::ConfigureMonomorphicArray() {
Object* feedback = GetFeedback();
@@ -650,10 +656,13 @@ void CallICNexus::ConfigureMonomorphic(Handle<JSFunction> function) {
void CallICNexus::ConfigureMegamorphic() {
- FeedbackNexus::ConfigureMegamorphic();
+ SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(GetIsolate()),
+ SKIP_WRITE_BARRIER);
+ Smi* count = Smi::cast(GetFeedbackExtra());
+ int new_count = count->value() + 1;
+ SetFeedbackExtra(Smi::FromInt(new_count), SKIP_WRITE_BARRIER);
}
-
void CallICNexus::ConfigureMegamorphic(int call_count) {
SetFeedback(*TypeFeedbackVector::MegamorphicSentinel(GetIsolate()),
SKIP_WRITE_BARRIER);
« no previous file with comments | « src/type-feedback-vector.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698