Commit a79ec0e3 authored by dcheng's avatar dcheng Committed by Commit bot

Uninline RuntimeCallStatEntries::Add to save binary size.

RuntimeCallStats::Print invokes this function many times. The uses of
STL all get inlined as a result, causing the Print() function to take up
156KB of binary size. Out-of-lining this method reduces the size to
under 18KB!

BUG=v8:5240

Review-Url: https://codereview.chromium.org/2188953003
Cr-Commit-Position: refs/heads/master@{#38182}
parent 1326de9d
......@@ -212,7 +212,10 @@ class RuntimeCallStatEntries {
Entry("Total", total_time, total_call_count).Print(os);
}
void Add(RuntimeCallCounter* counter) {
// By default, the compiler will usually inline this, which results in a large
// binary size increase: std::vector::push_back expands to a large amount of
// instructions, and this function is invoked repeatedly by macros.
V8_NOINLINE void Add(RuntimeCallCounter* counter) {
if (counter->count == 0) return;
entries.push_back(Entry(counter->name, counter->time, counter->count));
total_time += counter->time;
......
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