1. 15 Oct, 2019 1 commit
  2. 08 Oct, 2019 1 commit
    • Ingvar Stepanyan's avatar
      [wasm] Pretend that DWARF section is a fake source map · 1b5f3be0
      Ingvar Stepanyan authored
      Unfortunately, codebase contains lots of places that use one of the two
      formats as an internal representation for Wasm locations:
      1) {line: 0, column: byte offset within entire module}
      2) {line: function index, column: byte offset within function}
      
      These places choose these formats interchangeably and convert from one
      to another depending on the presence of source map URL in Wasm.
      
      This is not very convenient and makes it hard to add support for DWARF
      which should behave just like Wasm with source maps - that is, report a
      raw Wasm script instead of fake scripts per each disassembled function,
      and use representation (1) instead of (2) internally.
      
      I tried to refactor these locations and avoid checking for source map
      URLs in the previous CL - https://crrev.com/c/v8/v8/+/1833688. However,
      it quickly got out of hand, and updating code in one place just kept
      revealing yet another that gets broken by the changes, so I made a
      decision to abandon it and leave to someone who knows the codebase
      better.
      
      Instead, this CL is based on https://crrev.com/c/v8/v8/+/1809375, but,
      rather than trying to integrate DWARF separately and only for supported
      agents, it pretends that encountering DWARF section is the same as
      encountering a `sourceMappingURL` section with fake URL "wasm://dwarf".
      
      This ensures that Wasm with DWARF behaves exactly in the same way as
      Wasm with source maps, just like we want, with minimal changes to the
      codebase. The only downside is that frontends without DWARF support
      won't get even a disassembled version of Wasm that contains DWARF info.
      This is unfortunate, but, as per previous discussions, should be fine
      given current state of Wasm debugging.
      
      Change-Id: Ia7256075e4bfd2f407d001d02b96883d7267436e
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1834341
      Commit-Queue: Ingvar Stepanyan <rreverser@google.com>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#64157}
      1b5f3be0
  3. 25 Sep, 2019 1 commit
    • Ingvar Stepanyan's avatar
      Add support for reporting raw Wasm scripts · c7848612
      Ingvar Stepanyan authored
      This addition will allow to experiment with parsing DWARF information from
      WebAssembly on the frontend side for improved debugging.
      
      The frontend must explicitly opt-in to this experiment by setting
      `supportsWasmDwarf: true` in `Debugger.enable` params.
      
      When this option is present, and Wasm appears to contain DWARF information
      (heuristic: `.debug_info` custom section is present), V8 will not try to
      disassemble and report each WebAssembly function as a separate fake script, but
      instead will report Wasm module as a whole.
      
      Note that V8 already does this when Wasm is associated with a source map.
      
      Additionally, this CL adds a dedicated `Debugger.getWasmBytecode` command that
      accepts scriptId and returns raw wire bytes of the chosen WebAssembly module.
      
      Change-Id: I7a6e80daf8d91ffaaba04fa15688f2ba9552870f
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1809375
      Commit-Queue: Ingvar Stepanyan <rreverser@google.com>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63969}
      c7848612
  4. 18 Sep, 2019 3 commits
  5. 21 Aug, 2019 2 commits
  6. 20 Aug, 2019 2 commits
  7. 19 Jul, 2019 1 commit
  8. 24 May, 2019 1 commit
  9. 23 May, 2019 2 commits
  10. 22 May, 2019 1 commit
    • Andreas Haas's avatar
      [wasm][anyref] Cache export wrappers per signature · d56ee2e3
      Andreas Haas authored
      Up until now, we cached export wrappers per export index. With the
      anyref proposal potentially many more functions will need export
      wrappers, e.g. any function that is stored in a table, and any
      function accessed by the new ref.func instruction.
      
      With this CL, we change the caching scheme an do the caching per
      signature. Thereby we can guarantee that any export wrapper which
      potentially exists can be stored in the cache.
      
      For cctests which use wasm-run-utils, we don't know the size of the
      cache anymore ahead of time. However, we assume that no more than
      5 signatures will be used in any cctest. If this assumption is not
      true, we can just adjust the number.
      
      The cache is now accessed in all code paths where we need an export
      wrapper.
      
      Bug: chromium:962850
      
      Change-Id: I32df60dfa7801d1e71f7d837da091f388198af1f
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1615247
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61752}
      d56ee2e3
  11. 29 Apr, 2019 2 commits
  12. 25 Apr, 2019 1 commit
  13. 09 Apr, 2019 1 commit
  14. 03 Apr, 2019 1 commit
  15. 02 Apr, 2019 1 commit
  16. 01 Apr, 2019 2 commits
  17. 29 Mar, 2019 1 commit
  18. 21 Mar, 2019 1 commit
    • Ben Smith's avatar
      [wasm] Call through dispatch table in interpreter · 1a88414c
      Ben Smith authored
      When running wasm tests, the interpreter previously used a static
      collection of function indexes stored in WasmTable to perform
      call_indirect calls internal to that module. This has the wrong behavior
      if the table is changed (via WasmTableObject::Set, `table.copy`, or
      `table.init`).
      
      This CL changes the cctests to always generate an intepreter entry for
      all functions, and stores those entries in the dispatch table. This
      allows us to use the same execution path as for non-testing code.
      
      The interpreter entry compiler needed to be changed to support
      multi-value returns too, since a 64-bit integer return value may be
      lowered to two 32-bit integer returns.
      
      Bug: v8:9016
      Change-Id: I277df21ffde5c2eee0b691fcc9bab2b1a43eeffc
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1531137
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#60380}
      1a88414c
  19. 18 Mar, 2019 1 commit
  20. 04 Mar, 2019 1 commit
  21. 12 Feb, 2019 1 commit
    • Andreas Haas's avatar
      [wasm] Generate code for the table.get and table.set instructions · 01dc5707
      Andreas Haas authored
      This CL contains the following changes:
      (1) Allocate memory for WasmTables in the WasmInstance.
          - We extend the WasmInstance by a FixedArray which stores
            references to the WasmTables.
      (2) Rename the name of the backing store of WasmTables from `functions`
          to `elements`.
          - The name `functions` just does not fit anyref tables.
      (3) Generate code with TurboFan for table.get and table.set.
      (4) Extend wasm-module-builder.js to be able to generate modules with
          multiple tables.
      (5) Add  mjsunit tests to test table.get and table.set.
      
      R=mstarzinger@chromium.org
      
      Bug: v8:7581
      Change-Id: I44af4838ee7a37b394841a2f673ecae5734a4d1c
      Reviewed-on: https://chromium-review.googlesource.com/c/1463519
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59529}
      01dc5707
  22. 14 Jan, 2019 1 commit
  23. 18 Dec, 2018 1 commit
    • Andreas Haas's avatar
      [wasm][anyref] Implement anyref globals · 32562e91
      Andreas Haas authored
      This CL implements the global.get and global.set instruction for anyref
      globals. This includes:
      
      * Properly decode anyref globals.
      * Add a FixedArray to WasmInstanceObject to store anyref globals.
      * Initialize the FixedArray.
      * Generate code for global.get and global set.
      
      This CL does not allow to import globals yet.
      
      R=clemensh@chromium.org
      
      Bug: v8:7581
      Change-Id: I62617409271d9b6f2253a191681189865aa1f459
      Reviewed-on: https://chromium-review.googlesource.com/c/1380112Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58318}
      32562e91
  24. 11 Dec, 2018 1 commit
  25. 04 Dec, 2018 1 commit
  26. 12 Nov, 2018 2 commits
  27. 13 Sep, 2018 1 commit
  28. 10 Sep, 2018 1 commit
  29. 05 Sep, 2018 1 commit
  30. 04 Sep, 2018 1 commit
  31. 30 Aug, 2018 1 commit
  32. 02 Aug, 2018 1 commit
    • Ben L. Titzer's avatar
      [cleanup] Remove redundant wasm:: namespace prefixes · 99de47f1
      Ben L. Titzer authored
      The wasm/ directory is inconsistent in many places, often within the
      same file. For all code that exists in a v8::internal::wasm namespace,
      this CL removes any wasm:: qualifiers, which is especially helpful
      since most types are already Wasm-named, such as WasmCode, WasmModule,
      etc. Namespace qualifiers are redundant inside the wasm:: namespace and
      thus go against the main point of using namespaces. Removing the
      qualifiers for non Wasm-named classes also makes the code somewhat more
      future-proof, should we move some things that are not really WASM-specific
      (such as ErrorThrower and Decoder) into a higher namespace.
      
      R=clemensh@chromium.org,mstarzinger@chromium.org
      
      Change-Id: Ibff3e1e93c64c12dcb53c46c03d1bfb2fb0b7586
      Reviewed-on: https://chromium-review.googlesource.com/1160232
      Commit-Queue: Ben Titzer <titzer@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54862}
      99de47f1