• 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
Name
Last commit
Last update
..
arm Loading commit data...
arm64 Loading commit data...
ia32 Loading commit data...
mips Loading commit data...
mips64 Loading commit data...
ppc Loading commit data...
s390 Loading commit data...
x64 Loading commit data...
DEPS Loading commit data...
DIR_METADATA Loading commit data...
OWNERS Loading commit data...
deoptimize-reason.cc Loading commit data...
deoptimize-reason.h Loading commit data...
deoptimized-frame-info.cc Loading commit data...
deoptimized-frame-info.h Loading commit data...
deoptimizer-cfi-builtins.cc Loading commit data...
deoptimizer-cfi-empty.cc Loading commit data...
deoptimizer.cc Loading commit data...
deoptimizer.h Loading commit data...
frame-description.h Loading commit data...
materialized-object-store.cc Loading commit data...
materialized-object-store.h Loading commit data...
translated-state.cc Loading commit data...
translated-state.h Loading commit data...
translation-array.cc Loading commit data...
translation-array.h Loading commit data...
translation-opcode.h Loading commit data...