diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2014-11-14 00:52:27 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2014-11-14 16:34:58 +0100 |
commit | 5d1b6d3e0fa4b97a490ef964be48aed9872e3ec1 (patch) | |
tree | ab5f510c4d83b175681de629395525bf7ec7cedb /deps/v8/src/runtime-profiler.cc | |
parent | 3b3d89bad26f5dfebe73fef6ae284ee78acbd5c9 (diff) | |
download | node-new-5d1b6d3e0fa4b97a490ef964be48aed9872e3ec1.tar.gz |
deps: upgrade v8 to 3.30.37
Diffstat (limited to 'deps/v8/src/runtime-profiler.cc')
-rw-r--r-- | deps/v8/src/runtime-profiler.cc | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/deps/v8/src/runtime-profiler.cc b/deps/v8/src/runtime-profiler.cc index d6099d43be..f786846b36 100644 --- a/deps/v8/src/runtime-profiler.cc +++ b/deps/v8/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) { |