• Clemens Hammacher's avatar
    [wasm] [decoder] Templatize decode function for unchecked decoding · eeaceccb
    Clemens Hammacher authored
    In the C++ wasm interpreter, we decode LEB encoded immediates each time
    we execute the respective instruction. The whole instruction sequence
    was validated before, thus we know that all integers are valid.
    This CL refactors several Decoder methods to allow for either checked
    or unchecked decoding. In the checked case, an error is set if a check
    fails, in the unchecked case, a DCHECK will fail.
    
    This improves performance of the interpreter by 20.5%.
    
    R=ahaas@chromium.org
    BUG=v8:5822
    
    Change-Id: If69efd4f6fbe19d84bfc2f4aa000f429a8e22bf5
    Reviewed-on: https://chromium-review.googlesource.com/468786
    Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
    Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#44406}
    eeaceccb
module-decoder.cc 47.9 KB