[compiler] Make --trace-opt-verbose more useful.

When passing --trace-opt-verbose print more information about why we
decide not to optimize certain functions.

R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2800623002
Cr-Commit-Position: refs/heads/master@{#44408}
This commit is contained in:
bmeurer 2017-04-05 04:29:58 -07:00 committed by Commit bot
parent ab56c22339
commit 16df0ea63c
2 changed files with 30 additions and 2 deletions

View File

@ -437,6 +437,14 @@ void IC::OnFeedbackChanged(Isolate* isolate, JSFunction* host_function) {
info->change_own_type_change_checksum();
host->set_profiler_ticks(0);
} else if (host_function->IsInterpreted()) {
if (FLAG_trace_opt_verbose) {
if (host_function->shared()->profiler_ticks() != 0) {
PrintF("[resetting ticks for ");
host_function->PrintName();
PrintF(" due from %d due to IC change]\n",
host_function->shared()->profiler_ticks());
}
}
host_function->shared()->set_profiler_ticks(0);
}
isolate->runtime_profiler()->NotifyICChanged();

View File

@ -402,8 +402,28 @@ OptimizationReason RuntimeProfiler::ShouldOptimizeIgnition(
int typeinfo, generic, total, type_percentage, generic_percentage;
GetICCounts(function, &typeinfo, &generic, &total, &type_percentage,
&generic_percentage);
if (type_percentage >= FLAG_type_info_threshold) {
return OptimizationReason::kSmallFunction;
if (type_percentage < FLAG_type_info_threshold) {
if (FLAG_trace_opt_verbose) {
PrintF("[not yet optimizing ");
function->PrintName();
PrintF(
", not enough type info for small function optimization: %d/%d "
"(%d%%)]\n",
typeinfo, total, type_percentage);
}
return OptimizationReason::kDoNotOptimize;
}
return OptimizationReason::kSmallFunction;
} else if (FLAG_trace_opt_verbose) {
PrintF("[not yet optimizing ");
function->PrintName();
PrintF(", not enough ticks: %d/%d and ", ticks,
kProfilerTicksBeforeOptimization);
if (any_ic_changed_) {
PrintF("ICs changed]\n");
} else {
PrintF(" too large for small function optimization: %d/%d]\n",
shared->bytecode_array()->Size(), kMaxSizeEarlyOptIgnition);
}
}
return OptimizationReason::kDoNotOptimize;