1. 24 Jul, 2020 1 commit
  2. 21 Jul, 2020 1 commit
  3. 16 Jul, 2020 1 commit
  4. 10 Jul, 2020 1 commit
  5. 07 Jul, 2020 1 commit
  6. 06 Jul, 2020 4 commits
  7. 04 Jul, 2020 1 commit
  8. 03 Jul, 2020 1 commit
  9. 26 Jun, 2020 1 commit
    • Manos Koukoutos's avatar
      [wasm][refactor] Rework immediate-argument abstractions · 55ddbaa0
      Manos Koukoutos authored
      Motivation:
      The immediate-argument classes defined in function-body-decoder.h were
      often adding an offset to the provided pc. This was inconsistent,
      bug-prone, and counterintuitive. This CL imposes that all immediates
      are passed as pc the start of the immediate argument they are parsing.
      Some other smaller inconsistencies are fixed as well.
      
      Changes:
      
      src/wasm/:
      - Enforce that all Immediates are passed the pc at the start of the
        argument they are parsing. Adapt all call sites.
      - Remove unneeded offset arguments from two SIMD related immediates.
      - Add a pc argument to all Validate functions for immediates instead
        of using the Decoder's current pc.
      - Remove the (unused) pc argument from all Complete functions for
        immediates.
      - Introduce Validate() for BranchOnExceptionImmediate.
      - In WasmDecoder::Decode(), make sure len is updated before breaking out
        of the loop in case of a Validate() failure.
      - Change the default prefix_len of DecodeLoadMem/DecodeStoreMem to 1.
      
      wasm-interpreter.cc:
      - Change the default prefix_len of ExecuteLoad/Store to 1.
      - Adapt offsets in calls to Immediates.
      - Remove redundant opcode_length argument from ExecuteSimdOp, use len
        in its place.
      
      function-body-decoder-unittest.cc
      - Adapt offsets in calls to Immediates.
      - Introduce and use EXPECT_OK, as is done in other tests.
      
      Change-Id: I534606c0e238af309804d4a7c8cec75b1e49c6ad
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2267381
      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@{#68559}
      55ddbaa0
  10. 25 Jun, 2020 1 commit
    • Clemens Backes's avatar
      [wasm] Remove indirection for accessing local types · c8b84754
      Clemens Backes authored
      Local type information was stored in the {WasmFullDecoder}, and a
      pointer to that vector was handed to {WasmDecoder}. Since
      {WasmFullDecoder} inherits from {WasmDecoder}, we can just move the
      vector to the {WasmDecoder} class, and save an indirection and an
      unnecessary nullptr check.
      
      Drive-by: Rename {GetLocalType} to {local_type}, since it's a simple
      accessor.
      Drive-by 2: Move fields of {WasmDecoder} to the end of the class, as
      mandated in the style guide.
      Drive-by 3: Rename some locals in the 'let' decoding to make the meaning
      more clear.
      
      R=thibaudm@chromium.org
      
      Bug: v8:10576
      Change-Id: I6ab9831f0c1955e47562e84c5fbf15807439b024
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2264360Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#68541}
      c8b84754
  11. 24 Jun, 2020 1 commit
    • Clemens Backes's avatar
      [wasm] Make opcode properties constexpr · 852f43cd
      Clemens Backes authored
      This allows the compiler to eliminate more unneeded branches. Since all
      functions just do a lookup in a static table (either directly, or via
      compiling a switch to such a lookup), they are also good candidates for
      inlining, which is made possible by this change.
      
      One DCHECK is removed instead of pulling in the inl header, which would
      require more refactoring since the check is in a non-inl header.
      
      R=thibaudm@chromium.org
      TBR=jkummerow@chromium.org
      
      Bug: v8:10576
      Change-Id: If0fd25fd62c5f30b896fc67a5458a5ae475a6351
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2259944
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#68508}
      852f43cd
  12. 23 Jun, 2020 1 commit
  13. 19 Jun, 2020 2 commits
  14. 18 Jun, 2020 1 commit
    • Manos Koukoutos's avatar
      [wasm-gc] Change ValueType representation to account for new types · 52f65296
      Manos Koukoutos authored
      Motivation:
      Changes to the typed function references and gc proposals solidified
      the notion of heap type, clarified nullable vs. non-nullable reference
      types, and introduced rtts, which contain an integer depth field in
      addition to a heap type. This required us to overhaul our ValueType
      representation, which results in extensive changes.
      
      To keep this CL "small", we do not try to implement the binary encoding
      as described in the proposals, but rather devise a simpler one of our
      own (see below). Also, we do not try to implement additional
      functionality for the new types.
      
      Changes:
      - Introduce HeapType. Move heap types from ValueType to HeapType.
      - Introduce Nullability for reference types.
      - Rework ValueType helper methods.
      - Introduce rtts in ValueType with an integer depth field. Include depth
        in the ValueType encoding.
      - Make the constructor of ValueType private, instead expose static
        functions which explicitly state what they create.
      - Change every switch statement on ValueType::Kind. Sometimes, we need
        nested switches.
      - Introduce temporary constants in ValueTypeCode for nullable types,
        use them for decoding.
      - In WasmGlobalObject, split 'flags' into 'raw_type' and 'is_mutable'.
      - Change IsSubtypeOfRef to IsSubtypeOfHeap and implement changes in
        subtyping.
      - kWasmFuncRef initializers are now non-nullable. Initializers are
        only required to be subtypes of the declared global type.
      - Change tests and fuzzers as needed.
      
      Bug: v8:7748
      Change-Id: If41f783bd4128443b07e94188cea7dd53ab0bfa5
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2247657
      Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#68408}
      52f65296
  15. 12 Jun, 2020 1 commit
  16. 10 Jun, 2020 1 commit
  17. 09 Jun, 2020 1 commit
  18. 05 Jun, 2020 2 commits
  19. 03 Jun, 2020 2 commits
  20. 02 Jun, 2020 1 commit
    • Clemens Backes's avatar
      [wasm] Disallow nullptr modules in decoder · 6b633af7
      Clemens Backes authored
      In production, we will always pass a pointer to the decoded module. The
      only reason for the existance of the nullptr checks is that tests
      sometimes don't pass a module here. Hence we pay in production code for
      a test-only feature.
      
      This CL fixes this by always passing a module pointer from the decoder
      tests. This even simplifies the code a lot by removing redundant code.
      
      The {TestModuleBuilder} class was moved before the definitions of the
      {FunctionBodyDecoderTest} class in order to be able to reuse it there.
      It's unmodified otherwise.
      
      R=ahaas@chromium.org
      
      Bug: v8:10576
      Change-Id: I7d876bfc8a27b50fe713afb8848fb4f642287cfa
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2226749Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#68116}
      6b633af7
  21. 29 May, 2020 1 commit
  22. 18 May, 2020 1 commit
    • 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
  23. 06 May, 2020 1 commit
  24. 20 Apr, 2020 1 commit
  25. 16 Apr, 2020 1 commit
    • Ng Zhi An's avatar
      [wasm] Fix wasm decoder for multi-byte opcodes · b48b82e7
      Ng Zhi An authored
      SIMD opcodes consist of the prefix byte, then an LEB128 encoded int. We
      were decoding this incorrectly as a fixed uint8. This fixes the decoder
      to properly handle multi bytes.
      
      In some cases, the multi byte logic is applied to all prefixed opcodes.
      This is not a problem, since for values < 0x80, the LEB encoding is a
      single byte, and decodes to the same int. If the prefix opcode has
      instructions with index >= 0x80, it would be required to be LEB128
      encoded anyway.
      
      There are a bunch of trivial changes to test-run-wasm-simd, to change
      the macro from BUILD to BUILD_V, the former only works for single byte
      opcodes, the latter is a new template-based macro that correct handles
      multi-byte opcodes. The only unchanged test is the shuffle fuzzer test,
      which builds its own sequence of bytes without using the BUILD macro.
      
      Bug: v8:10258
      Change-Id: Ie7377e899a7eab97ecf28176fd908babc08d0f19
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2118476
      Commit-Queue: Zhi An Ng <zhin@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67186}
      b48b82e7
  26. 12 Mar, 2020 1 commit
  27. 27 Feb, 2020 1 commit
  28. 26 Feb, 2020 1 commit
  29. 17 Feb, 2020 1 commit
  30. 23 Jan, 2020 1 commit
  31. 15 Jan, 2020 1 commit
  32. 06 Dec, 2019 1 commit
  33. 28 Nov, 2019 1 commit
    • Clemens Backes's avatar
      [wasm] Clean up WASM_CALL_INDIRECT macros · a183b8be
      Clemens Backes authored
      Fix a TODO from Ben to change the macro argument order to match the
      actual order in wasm code.
      After this fix, we can remove the individual {WASM_CALL_INDIRECT[0-5]}
      macros and implement them via a common variadic macro.
      
      Also, rename {WASM_CALL_INDIRECT_TABLE0} to {WASM_CALL_INDIRECT_TABLE}.
      The name was confusing, because this macro explictly allows to set a
      table index different from 0. Thus, just drop the "0" in the name.
      
      The individual test changes were done via a vim macro, to avoid manual
      errors.
      
      R=mstarzinger@chromium.org
      
      Bug: v8:10021
      Change-Id: I9f0f31511c5c6e20a0b07524bf75fe9cf1598eba
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1940265Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#65242}
      a183b8be
  34. 26 Nov, 2019 1 commit