Index: src/type-feedback-vector.cc |
diff --git a/src/type-feedback-vector.cc b/src/type-feedback-vector.cc |
index b4886ce2cfab28d570a076d3c57b5df7dd1a9dc7..e21ad93ba6dfff57abe0111222f679598ea88664 100644 |
--- a/src/type-feedback-vector.cc |
+++ b/src/type-feedback-vector.cc |
@@ -230,11 +230,13 @@ Handle<TypeFeedbackVector> TypeFeedbackVector::New( |
const int slot_count = metadata->slot_count(); |
const int length = slot_count + kReservedIndexCount; |
if (length == kReservedIndexCount) { |
- return Handle<TypeFeedbackVector>::cast(factory->empty_fixed_array()); |
+ return Handle<TypeFeedbackVector>::cast( |
+ factory->empty_type_feedback_vector()); |
} |
Handle<FixedArray> array = factory->NewFixedArray(length, TENURED); |
array->set(kMetadataIndex, *metadata); |
+ array->set(kInvocationCountIndex, Smi::FromInt(0)); |
DisallowHeapAllocation no_gc; |
@@ -628,6 +630,12 @@ int CallICNexus::ExtractCallCount() { |
return value; |
} |
+float CallICNexus::ComputeCallFrequency() { |
+ double const invocation_count = vector()->invocation_count(); |
+ double const call_count = ExtractCallCount(); |
+ return static_cast<float>(call_count / invocation_count); |
+} |
+ |
void CallICNexus::Clear(Code* host) { CallIC::Clear(GetIsolate(), host, this); } |
void CallICNexus::ConfigureUninitialized() { |