Index: src/runtime-profiler.cc |
diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc |
index d6099d43be86001892e3f97e74bd08cca981da1c..f786846b365ba1cc43ac04a4803dbeef8c803a92 100644 |
--- a/src/runtime-profiler.cc |
+++ b/src/runtime-profiler.cc |
@@ -57,9 +57,11 @@ RuntimeProfiler::RuntimeProfiler(Isolate* isolate) |
} |
-static void GetICCounts(Code* shared_code, int* ic_with_type_info_count, |
- int* ic_generic_count, int* ic_total_count, |
- int* type_info_percentage, int* generic_percentage) { |
+static void GetICCounts(SharedFunctionInfo* shared, |
+ int* ic_with_type_info_count, int* ic_generic_count, |
+ int* ic_total_count, int* type_info_percentage, |
+ int* generic_percentage) { |
+ Code* shared_code = shared->code(); |
*ic_total_count = 0; |
*ic_generic_count = 0; |
*ic_with_type_info_count = 0; |
@@ -70,6 +72,12 @@ static void GetICCounts(Code* shared_code, int* ic_with_type_info_count, |
*ic_generic_count = info->ic_generic_count(); |
*ic_total_count = info->ic_total_count(); |
} |
+ |
+ // Harvest vector-ics as well |
+ TypeFeedbackVector* vector = shared->feedback_vector(); |
+ *ic_with_type_info_count += vector->ic_with_type_info_count(); |
+ *ic_generic_count += vector->ic_generic_count(); |
+ |
if (*ic_total_count > 0) { |
*type_info_percentage = 100 * *ic_with_type_info_count / *ic_total_count; |
*generic_percentage = 100 * *ic_generic_count / *ic_total_count; |
@@ -89,7 +97,7 @@ void RuntimeProfiler::Optimize(JSFunction* function, const char* reason) { |
PrintF(" for recompilation, reason: %s", reason); |
if (FLAG_type_info_threshold > 0) { |
int typeinfo, generic, total, type_percentage, generic_percentage; |
- GetICCounts(function->shared()->code(), &typeinfo, &generic, &total, |
+ GetICCounts(function->shared(), &typeinfo, &generic, &total, |
&type_percentage, &generic_percentage); |
PrintF(", ICs with typeinfo: %d/%d (%d%%)", typeinfo, total, |
type_percentage); |
@@ -236,7 +244,7 @@ void RuntimeProfiler::OptimizeNow() { |
if (ticks >= kProfilerTicksBeforeOptimization) { |
int typeinfo, generic, total, type_percentage, generic_percentage; |
- GetICCounts(shared_code, &typeinfo, &generic, &total, &type_percentage, |
+ GetICCounts(shared, &typeinfo, &generic, &total, &type_percentage, |
&generic_percentage); |
if (type_percentage >= FLAG_type_info_threshold && |
generic_percentage <= FLAG_generic_ic_threshold) { |
@@ -259,7 +267,7 @@ void RuntimeProfiler::OptimizeNow() { |
// If no IC was patched since the last tick and this function is very |
// small, optimistically optimize it now. |
int typeinfo, generic, total, type_percentage, generic_percentage; |
- GetICCounts(shared_code, &typeinfo, &generic, &total, &type_percentage, |
+ GetICCounts(shared, &typeinfo, &generic, &total, &type_percentage, |
&generic_percentage); |
if (type_percentage >= FLAG_type_info_threshold && |
generic_percentage <= FLAG_generic_ic_threshold) { |