Commit 593ad0f7 authored by dcheng's avatar dcheng Committed by Commit bot

object-stats.cc: Annotate PrintJSONArray with V8_NOINLINE

Sometimes, the compiler will inline this function and unroll the loop.
Forcing this to never be inlined reduces the compiled size of the
function from a potential 170KB to around 39KB.

BUG=v8:5240

Review-Url: https://codereview.chromium.org/2194843002
Cr-Commit-Position: refs/heads/master@{#38172}
parent ca4707f7
......@@ -29,7 +29,10 @@ void ObjectStats::ClearObjectStats(bool clear_last_time_stats) {
visited_fixed_array_sub_types_.clear();
}
static void PrintJSONArray(size_t* array, const int len) {
// Tell the compiler to never inline this: occasionally, the optimizer will
// decide to inline this and unroll the loop, making the compiled code more than
// 100KB larger.
V8_NOINLINE static void PrintJSONArray(size_t* array, const int len) {
PrintF("[ ");
for (int i = 0; i < len; i++) {
PrintF("%zu", array[i]);
......
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