• jbroman's avatar
    Generate less code in v8::internal::Counters constructor · 53562fd9
    jbroman authored
    This saves 72 KiB (approximately 0.1%) of the Chrome APK size of for ARM/Android.
    
    In Counters, each similar group of counters generates a compact data structure,
    which a loop then iterates over, rather than having the full loop unrolled
    (though the compiler will automatically unroll small ones).
    
    In RuntimeCallStats, the compiler was not being clever enough to avoid
    initializing count_ and time_ to zero individually, even after the initialization
    of names was moved into a loop. As a result, RuntimeCallCounter was modified
    to have a non-initializing constructor for exclusive use by RuntimeCallStats,
    which explicitly initializes the counters in a loop. Since v8::base::TimeDelta
    does not support an uninitialized state, time_ was changed to be stored as
    int64_t microseconds internally, which generates the same code (it's the same
    representation as TimeDelta).
    
    BUG=v8:6119
    
    Review-Url: https://codereview.chromium.org/2759033002
    Cr-Commit-Position: refs/heads/master@{#43996}
    53562fd9
counters.cc 15 KB