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

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

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/type-feedback-vector.h ('k') | src/type-info.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 7b7b434f5600154d45b7eba03c37bed8eeb375b7..9d7169e9d6a988406d2b0d255d47df6153c2d3ed 100644
--- a/src/type-feedback-vector.cc
+++ b/src/type-feedback-vector.cc
@@ -109,6 +109,8 @@ const char* TypeFeedbackMetadata::Kind2String(FeedbackVectorSlotKind kind) {
return "INVALID";
case FeedbackVectorSlotKind::CALL_IC:
return "CALL_IC";
+ case FeedbackVectorSlotKind::CONSTRUCT_IC:
+ return "CONSTRUCT_IC";
case FeedbackVectorSlotKind::LOAD_IC:
return "LOAD_IC";
case FeedbackVectorSlotKind::KEYED_LOAD_IC:
@@ -222,6 +224,11 @@ void TypeFeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared,
nexus.Clear(shared->code());
break;
}
+ case FeedbackVectorSlotKind::CONSTRUCT_IC: {
+ ConstructICNexus nexus(this, slot);
+ nexus.Clear(shared->code());
+ break;
+ }
case FeedbackVectorSlotKind::LOAD_IC: {
LoadICNexus nexus(this, slot);
nexus.Clear(shared->code());
@@ -485,6 +492,18 @@ InlineCacheState CallICNexus::StateFromFeedback() const {
}
+Handle<Object> CallICNexus::GetCallFeedback() {
+ Object* feedback = GetFeedback();
+ if (feedback->IsWeakCell()) {
+ feedback = WeakCell::cast(feedback)->value();
+ }
+ if (!feedback->IsJSFunction() && !feedback->IsAllocationSite()) {
+ feedback = GetIsolate()->heap()->undefined_value();
+ }
+ return handle(feedback, GetIsolate());
+}
+
+
int CallICNexus::ExtractCallCount() {
Object* call_count = GetFeedbackExtra();
if (call_count->IsSmi()) {
@@ -498,6 +517,11 @@ int CallICNexus::ExtractCallCount() {
void CallICNexus::Clear(Code* host) { CallIC::Clear(GetIsolate(), host, this); }
+void ConstructICNexus::Clear(Code* host) {
+ ConstructIC::Clear(GetIsolate(), host, this);
+}
+
+
void CallICNexus::ConfigureMonomorphicArray() {
Object* feedback = GetFeedback();
if (!feedback->IsAllocationSite()) {
« no previous file with comments | « src/type-feedback-vector.h ('k') | src/type-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698