Commit 16df0ea6 authored by bmeurer's avatar bmeurer Committed by Commit bot

[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}
parent ab56c223
......@@ -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();
......
......@@ -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) {
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment