• Manos Koukoutos's avatar
    [wasm] Refactor/cleanup DecodeLocals, read_value_type · a4d295ad
    Manos Koukoutos authored
    Changes:
    Cleanup:
    - Make sure read_value_type has the same interface as other
      read_* functions, i.e., returns the decoded value and writes
      the consumed length into a pointer.
    - DecodeLocals is now an instance method.
    - DecodeLocals should fail when given a wrong number of locals.
      Add tests to catch that.
    - Fix a buggy test.
    
    Refactoring in preparation of introducing the 'let'
    instruction as per [wasm-gc]:
    - DecodeLocals does not consume any input and can start from any pc.
    - DecodeLocals gives the option of not appending the decoded
      locals to local_types_.
    - Separate locals initialization from signature.
    
    Bug: v8:7748
    Change-Id: Iaaff87fdb9abe0ddd716484ea3fa87779d2d1a2f
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2202992
    Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
    Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
    Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#67845}
    a4d295ad
function-body-decoder-unittest.cc 145 KB