1. 25 May, 2020 1 commit
    • Andreas Haas's avatar
      [wasm] Introduce the SyncStreamingDecoder · d4bb8208
      Andreas Haas authored
      This CL introduces the SyncStreamingDecoder to support
      streaming compilation when --single-threaded is set. The
      SyncStreamingDecoder buffers all bytes it receives over
      {OnBytesReceived}, and compiles them synchronously upon {Finish}.
      
      In addition to introducing SyncStreamingDecoder, this CL does
      the following changes:
      * Redirect streaming compilation to the new streaming decoder if
        --no-wasm-async-compilation is set. This flag is set if
        --single-threaded is set.
      * Extend the test-streaming-compilation.cc tests to test also the new
        streaming decoder.
      
      R=thibaudm@chromium.org
      
      Bug: v8:10548
      Change-Id: I807e291a6060067c9835de4adf82bcb00321d995
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2209053
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67955}
      d4bb8208
  2. 20 May, 2020 1 commit
    • Andreas Haas's avatar
      [wasm] Make StreamingDecoder abstract, introduce AsyncStreamingDecoder · 6921a490
      Andreas Haas authored
      The implementation of the StreamingDecoder depends on async compilation.
      However, when the --single-threaded flag is set, async compilation is
      not available. Therefore V8 does not support streaming compilation at
      the moment if the --single-threaded flag is set.
      
      This CL is the first step to support streaming compilation in
      --single-threaded mode. This CL makes the StreamingDecoder an abstract
      class, and the current implementation a sub-class called
      AsyncStreamingDecoder. A follow-up CL will provided a second sub-class
      implementation for streaming compilation in --single-threaded mode.
      
      Bug: v8:10548
      Change-Id: Ice5c01340d3df18f836a4a05d30571207ca8ccf6
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2208869
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67931}
      6921a490
  3. 10 Dec, 2019 1 commit
  4. 08 Nov, 2019 1 commit
    • Clemens Backes's avatar
      [wasm] Improve code size estimate for streaming · 77a2b4c1
      Clemens Backes authored
      In streaming compilation, we were computing a way too low code size
      estimate, since all {WasmFunction::code} fields were still zero when we
      were calling {EstimateNativeModuleCodeSize}. This lead to many separate
      code spaces being created during compilation, creating significant
      performance and memory overhead.
      
      This CL fixes this by passing the code section length when creating the
      {NativeModule}. From this, we can compute the code size estimate just as
      before.
      
      Drive-by: Rename "functions_count" to "num_functions" in
      {ProcessCodeSectionHeader} to be consistent with the declaration.
      
      R=ahaas@chromium.org
      
      Bug: v8:9950
      Change-Id: I30a54c01ed24d0dfecb8a4b6d123015f1803ddeb
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1903439
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#64849}
      77a2b4c1
  5. 23 May, 2019 1 commit
  6. 03 Apr, 2019 1 commit
  7. 28 Feb, 2019 1 commit
  8. 26 Feb, 2019 1 commit
  9. 19 Feb, 2019 1 commit
  10. 15 Jan, 2019 1 commit
  11. 10 Jan, 2019 1 commit
    • Andreas Haas's avatar
      [wasm] Notify streaming decoder when the native module is created · bb46048a
      Andreas Haas authored
      Originally, the NativeModule and the WasmModuleObject were created
      together, and the streaming decoder was notified after the
      WasmModuleObject was created. A recent CL (https://crrev.com/c/1402544),
      however, changed that.  The NativeModule gets created before compilation
      starts, the WasmModuleObject, however, gets created after compilation.
      
      The streaming decoder only needs the NativeModule to register a callback
      before compilation. Therefore this CL we change the notification of the
      streaming decoder to receive only the NativeModule, not the
      WasmModuleObject, before starting compilation.
      
      R=clemensh@chromium.org
      CC=bbudge@chromium.org
      
      Bug: chromium:719172
      Change-Id: I4ad879e4ebd2d88174d7e2a0c6359f2836926763
      Reviewed-on: https://chromium-review.googlesource.com/c/1404442
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58703}
      bb46048a
  12. 11 Dec, 2018 1 commit
  13. 12 Nov, 2018 1 commit
    • Clemens Hammacher's avatar
      [wasm] Reset StreamingProcessor on error · 3b64603d
      Clemens Hammacher authored
      After the first decoder error, the streaming processor should not be
      called again. To enforce this, reset the {processor_} field. This also
      makes the {ok_} field redundant.
      Note that this refactoring is also necessary for a future CL which
      makes the {StreamingProcessor} keep the {AsyncCompileJob} alive. By
      resetting the processor, we also remove that link.
      
      R=ahaas@chromium.org
      
      Bug: v8:7921
      Change-Id: I42f5ed26a8f26c3dc8db5676557a0d82021e132e
      Reviewed-on: https://chromium-review.googlesource.com/c/1329179
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#57435}
      3b64603d
  14. 07 Nov, 2018 1 commit
    • Clemens Hammacher's avatar
      [wasm] Decouple wire bytes from compilation units · 014d9e4f
      Clemens Hammacher authored
      Compilation units currently contain pointers into allocated space that
      contains the code of the respective function. This requires us to keep
      the StreamingDecoder alive as long as compilation is still running
      (including tiering).
      This CL refactors this by having an additional redirection
      (WireBytesStorage) which can point to either the StreamingDecoder or
      the NativeModule. We only keep the code section buffer alive as long as
      the StreamingWireBytesStorage is still in use.
      
      I will further refactor memory ownership in a follow-up CL to not make
      the AsyncCompileJob keep the StreamingDecoder alive.
      
      R=ahaas@chromium.org
      
      Bug: v8:8343,v8:7921,v8:8050
      Change-Id: I780582c3217abf64000454f2c9c108b9ac9fbff1
      Reviewed-on: https://chromium-review.googlesource.com/c/1319588Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#57317}
      014d9e4f
  15. 06 Nov, 2018 1 commit
  16. 05 Nov, 2018 1 commit
  17. 22 Oct, 2018 1 commit
    • Clemens Hammacher's avatar
      [wasm] Turn Result methods into named constructors · 5edf567a
      Clemens Hammacher authored
      This removes the {error} and {verror} methods of {ResultBase} and
      introduces a named constructor {Error} instead. This allows to
      construct an error result in a single expression, and moves {Result}
      closer to a container that is initialized once and is immutable
      afterwards (just the {MoveErrorFrom} method is still violating this
      pattern).
      
      R=titzer@chromium.org
      
      Bug: v8:8238
      Change-Id: Iec16c8c6d66300ee82a48e8a9e941c72ae26e202
      Reviewed-on: https://chromium-review.googlesource.com/c/1293370
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#56857}
      5edf567a
  18. 12 Oct, 2018 1 commit
  19. 25 Sep, 2018 1 commit
    • Andreas Haas's avatar
      [wasm] Notify StreamingDecoder when its AsyncCompileJob is destructed · 1a5a6c36
      Andreas Haas authored
      The lifetime of the AsyncCompileJob does not depend on the lifetime of
      the stream which feeds data into it. Multiple checks guarantee that the
      AsyncCompileJob still exists when the stream wants to call it. With
      this CL we add an additional level of defense to make sure that
      streaming does not continue after the AsyncCompileJob got destructed.
      
      It is not clear if this CL fixes the bug referenced below. However, the
      crashes there could be caused when streaming accesses the
      AsyncCompileJob after it got destructed already. I was not able though
      to find a scenario where this is possible.
      
      R=clemensh@chromium.org
      
      Bug: chromium:888170
      Change-Id: Id5c6cc34842735a3adaf3e09c57cbe923cfc2630
      Reviewed-on: https://chromium-review.googlesource.com/1241961
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#56213}
      1a5a6c36
  20. 28 Jun, 2018 1 commit
  21. 21 Nov, 2017 1 commit
  22. 05 Oct, 2017 1 commit
  23. 15 Sep, 2017 1 commit
    • Andreas Haas's avatar
      [wasm] Streaming compilation for WebAssembly. · 549692cb
      Andreas Haas authored
      In this CL I implement streaming compilation for WebAssembly,
      as described in the design doc I have sent out already.
      
      In this implementation the decoding of sections other than the
      code section is done immediately on the foreground thread.
      Eventually all decoding should happen in the background. I
      think it is acceptable to do the decoding on the foreground
      thread for now because I have finished it already, and
      decoding in the background would add even more complexity to
      this CL.
      
      Bug:v8:6785
      
      Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      Change-Id: I285e1e5e1a5a243113c92571b25ee9bae551d0ed
      Reviewed-on: https://chromium-review.googlesource.com/631721Reviewed-by: 's avatarMircea Trofin <mtrofin@chromium.org>
      Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#48022}
      549692cb
  24. 11 May, 2017 1 commit