| Index: src/runtime-profiler.cc
|
| diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc
|
| index 28f8c560b8017f9a08011bb4d6dc305f7c789872..2d4ee9c1a888254206aa602ffce735ea4468804c 100644
|
| --- a/src/runtime-profiler.cc
|
| +++ b/src/runtime-profiler.cc
|
| @@ -53,10 +53,12 @@
|
| any_ic_changed_(false) {
|
| }
|
|
|
| -static void GetICCounts(JSFunction* function, int* ic_with_type_info_count,
|
| - int* ic_generic_count, int* ic_total_count,
|
| - int* type_info_percentage, int* generic_percentage) {
|
| - Code* shared_code = function->shared()->code();
|
| +
|
| +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;
|
| @@ -69,7 +71,7 @@
|
| }
|
|
|
| // Harvest vector-ics as well
|
| - TypeFeedbackVector* vector = function->feedback_vector();
|
| + TypeFeedbackVector* vector = shared->feedback_vector();
|
| int with = 0, gen = 0;
|
| vector->ComputeCounts(&with, &gen);
|
| *ic_with_type_info_count += with;
|
| @@ -92,8 +94,8 @@
|
| PrintF(" for recompilation, reason: %s", reason);
|
| if (FLAG_type_info_threshold > 0) {
|
| int typeinfo, generic, total, type_percentage, generic_percentage;
|
| - GetICCounts(function, &typeinfo, &generic, &total, &type_percentage,
|
| - &generic_percentage);
|
| + GetICCounts(function->shared(), &typeinfo, &generic, &total,
|
| + &type_percentage, &generic_percentage);
|
| PrintF(", ICs with typeinfo: %d/%d (%d%%)", typeinfo, total,
|
| type_percentage);
|
| PrintF(", generic ICs: %d/%d (%d%%)", generic, total, generic_percentage);
|
| @@ -221,7 +223,7 @@
|
|
|
| if (ticks >= kProfilerTicksBeforeOptimization) {
|
| int typeinfo, generic, total, type_percentage, generic_percentage;
|
| - GetICCounts(function, &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) {
|
| @@ -244,7 +246,7 @@
|
| // 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(function, &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) {
|
|
|