1. 04 Feb, 2021 1 commit
    • Jakob Gruber's avatar
      [deoptimizer] Add translation array compression behind a flag · b62bbd16
      Jakob Gruber authored
      TranslationArrays (TA) are large and rarely used, thus could benefit
      from compression. This CL adds a --turbo-compress-translation-arrays
      flag (off by default) to experiment with that.
      
      Each optimized Code object has an associated translation array
      (Code->DeoptimizationData->TranslationArray). These translation arrays
      have roughly the same size as the Code object itself. They are
      used only rarely: when deoptimizing, and when traversing the stack and
      looking into optimized frames. Neither of these code paths are
      especially performance critical. TA's contain only immutable, untagged
      data. They are thus good candidates for compression.
      
      The trade-off is between TA memory consumption and time spent
      in decompression/compression. This CL keeps everything on the main
      thread, but it would also be possible to move compression (the more
      expensive operation by a factor of 5 to 10) to a worker thread.
      
      Numbers from a local Octane2 run:
      
      Sum of Code instructions sizes: 4.6MB
      Sum of uncompressed TA sizes:   4.1MB
      Sum of compressed TA sizes:     0.6MB
      
      Compression times depend on the selected compression quality, but
      roughly:
      
      Compression:   50ms (40us avg per compilation)
      Decompression:        7us avg per compilation
      
      Drive-by: Translation arrays currently use run-length encoding;
      I disabled this for when --turbo-compress-translation-arrays is
      enabled (no need to compress twice).
      
      Bug: v8:11354
      Change-Id: I7828d7d91eb074816b383b02f883c5d7b7e318b7
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2652497
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72533}
      b62bbd16