• Clemens Backes's avatar
    [wasm] Avoid repeated checking for stack growing · fa955653
    Clemens Backes authored
    The vast majority of operations increases the stack size by at most one.
    Many opcode (e.g. all unary and binary operations) never grow the stack
    at all. Still, for every "push" operation, they check whether the
    storage for the vector that holds the stack values needs to grow.
    
    This CL avoids those redundant checks by ensuring that there is space
    for at least one more stack element before decoding each instruction.
    
    By centralizing this check, we not only improve performance, but also
    reduce code size significantly (~49 kB on x64 release).
    
    R=thibaudm@chromium.org
    
    Bug: chromium:1096565, v8:10933
    Change-Id: I986dcac734b986d1ce953b7ec3bde8ad31b4f2b7
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2431525
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#70177}
    fa955653
value-type.h 21.1 KB