1. 27 May, 2019 1 commit
    • Clemens Hammacher's avatar
      [wasm] Fix alloc/dealloc size mismatch · 22b8fe3b
      Clemens Hammacher authored
      On newer compilers the {operator delete} with explicit {size_t}
      argument would be instantiated for {CompilationState} and used in the
      destructor of {std::unique_ptr<CompilationState>}. The {size_t}
      argument is wrong though, since the pointer actually points to a
      {CompilationStateImpl} object.
      Hence avoid this operator from being created by explicitly providing an
      {operator delete}.
      
      R=ulan@chromium.org
      
      Change-Id: I54fef07179b3106f3154ddd43df040fe8e3cdde8
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1631426Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61859}
      22b8fe3b
  2. 30 Apr, 2019 1 commit
  3. 29 Apr, 2019 1 commit
  4. 25 Apr, 2019 1 commit
  5. 05 Apr, 2019 1 commit
  6. 02 Apr, 2019 1 commit
  7. 01 Apr, 2019 2 commits
  8. 27 Mar, 2019 1 commit
  9. 14 Mar, 2019 1 commit
    • Clemens Hammacher's avatar
      [wasm] Make error messages deterministic · eb1d2d70
      Clemens Hammacher authored
      Compilation only stores whether an error has been found, but not the
      exact error or it's location. This is generated by running a validation
      pass once all wire bytes have been received.
      This unifies error messages by removing one more location where we
      generate compilation error messages, and makes it deterministic because
      a) we always report the error in the first failing function, and
      b) if names are present, the error message will always contain the
         function name.
      
      R=titzer@chromium.org
      
      Bug: chromium:926311, v8:8814
      Change-Id: I79551b8bb73dcee503484de343a3ada60a6add4f
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1521112
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#60242}
      eb1d2d70
  10. 13 Mar, 2019 1 commit
    • Clemens Hammacher's avatar
      [wasm] Keep NativeModule alive in BackgroundCompileScope · 3df442d7
      Clemens Hammacher authored
      We need to ensure that the NativeModule stays alive while any
      {BackgroundCompileScope} exists, because during that time we hold
      shared ownership of the mutex in the {BackgroundCompileToken}. If the
      {NativeModule} dies during that period, we would need to get exclusive
      ownership of the mutex and deadlock.
      
      This change requires holding a {std::weak_ptr<NativeModule>} in the
      BackgroundCompileToken instead of a raw pointer, hence it can only be
      initialized after the NativeModule was created. This is done via a
      separate {InitCompilationState} method.
      
      R=ahaas@chromium.org
      
      Bug: v8:8979
      Change-Id: Ia14bd272ea0bc47aec547024da6020608418c9d2
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1518178
      Auto-Submit: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#60203}
      3df442d7
  11. 05 Feb, 2019 1 commit
  12. 04 Feb, 2019 1 commit
  13. 01 Feb, 2019 1 commit
    • Clemens Hammacher's avatar
      Reland "[wasm] Remove finisher task" · 84f17076
      Clemens Hammacher authored
      This is a reland of ac2fb66b.
      Crashes were fixed in https://crrev.com/c/1429862.
      
      Original change's description:
      > [wasm] Remove finisher task
      >
      > This removes the finisher task and instead finishes compilation units
      > from the background.
      > It also changes ownership of the AsyncCompileJob to be shared among all
      > tasks that still operate on it. The AsyncCompileJob dies when the last
      > reference dies.
      >
      > R=ahaas@chromium.org
      > CC=​​mstarzinger@chromium.org
      >
      > Bug: v8:7921, v8:8423
      > Change-Id: Id09378327dfc146459ef41bc97176a8716756ae4
      > Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_rel
      > Reviewed-on: https://chromium-review.googlesource.com/c/1335553
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#58630}
      
      Bug: v8:7921, v8:8423
      Change-Id: I3dcee4e8e56d2a524d302af91b5cb4a7a9ceb8ce
      Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_rel
      Reviewed-on: https://chromium-review.googlesource.com/c/1400781
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59302}
      84f17076
  14. 30 Jan, 2019 1 commit
    • Clemens Hammacher's avatar
      [wasm] Do not pass the error to callbacks · d928d25c
      Clemens Hammacher authored
      Instead of passing the error explicitly, make the callbacks get the
      error from the CompilationState. This prepares a change to call the
      callbacks asynchronously, because from the background we cannot
      construct the final error message (because this requires access to the
      wire bytes). Thus the callbacks will have to get the actual compile
      error from the CompilationState from a foreground task if they need it.
      
      R=mstarzinger@chromium.org
      
      Bug: v8:8689
      Change-Id: I22accabf895bf21fa7492e2f5cb8bac93237c765
      Reviewed-on: https://chromium-review.googlesource.com/c/1445975
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59216}
      d928d25c
  15. 23 Jan, 2019 3 commits
    • Clemens Hammacher's avatar
      Reland "[wasm] Decouple background compile jobs from NativeModule" · eab3508a
      Clemens Hammacher authored
      This is a reland of 92d9b09c.
      Patch unchanged, errors fixed by https://crrev.com/c/1430059.
      
      Original change's description:
      > [wasm] Decouple background compile jobs from NativeModule
      >
      > Background compile jobs should not keep the NativeModule alive, for two
      > reasons:
      > 1) We sometimes have to wait for background compilation to finish (from
      >    a foreground task!). This introduces unnecessary latency.
      > 2) Giving the background compile tasks shared ownership of the
      >    NativeModule causes the NativeModule (and the CompilationState) to
      >    be freed from background tasks, which is error-prone (see
      >    https://crrev.com/c/1400420).
      >
      > Instead, this CL introduces a BackgroundCompileToken which is held
      > alive by the NativeModule and all background compile jobs. The initial
      > and the final phase of compilation (getting and submitting work)
      > synchronize on this token to check and ensure that the NativeModule is
      > and stays alive. During compilation itself, the mutex is released, such
      > that the NativeModule can die.
      > The destructor of the NativeModule cancels the BackgroundCompileToken.
      > Immediately afterwards, the NativeModule and the CompilationState can
      > die.
      >
      > This change allows to remove two hacks introduced previously: The atomic
      > {aborted_} flag and the {FreeCallbacksTask}.
      >
      > R=mstarzinger@chromium.org
      > CC=titzer@chromium.org
      >
      > Bug: v8:8689, v8:7921
      > Change-Id: I42e06eab3c944b0988286f2ce18e3c294535dfb6
      > Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_rel
      > Reviewed-on: https://chromium-review.googlesource.com/c/1421364
      > Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      > Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#59020}
      
      TBR=mstarzinger@chromium.org
      
      Bug: v8:8689, v8:7921
      Change-Id: Iead972ef77c8503da7246cab48e7693b176d8f02
      Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_rel
      Reviewed-on: https://chromium-review.googlesource.com/c/1429862Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59035}
      eab3508a
    • Clemens Hammacher's avatar
      Revert "[wasm] Decouple background compile jobs from NativeModule" · ea513ab8
      Clemens Hammacher authored
      This reverts commit 92d9b09c.
      
      Reason for revert: Crashes on several bots, e.g. https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux64%20UBSan/4237
      
      Original change's description:
      > [wasm] Decouple background compile jobs from NativeModule
      > 
      > Background compile jobs should not keep the NativeModule alive, for two
      > reasons:
      > 1) We sometimes have to wait for background compilation to finish (from
      >    a foreground task!). This introduces unnecessary latency.
      > 2) Giving the background compile tasks shared ownership of the
      >    NativeModule causes the NativeModule (and the CompilationState) to
      >    be freed from background tasks, which is error-prone (see
      >    https://crrev.com/c/1400420).
      > 
      > Instead, this CL introduces a BackgroundCompileToken which is held
      > alive by the NativeModule and all background compile jobs. The initial
      > and the final phase of compilation (getting and submitting work)
      > synchronize on this token to check and ensure that the NativeModule is
      > and stays alive. During compilation itself, the mutex is released, such
      > that the NativeModule can die.
      > The destructor of the NativeModule cancels the BackgroundCompileToken.
      > Immediately afterwards, the NativeModule and the CompilationState can
      > die.
      > 
      > This change allows to remove two hacks introduced previously: The atomic
      > {aborted_} flag and the {FreeCallbacksTask}.
      > 
      > R=​mstarzinger@chromium.org
      > CC=​titzer@chromium.org
      > 
      > Bug: v8:8689, v8:7921
      > Change-Id: I42e06eab3c944b0988286f2ce18e3c294535dfb6
      > Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_rel
      > Reviewed-on: https://chromium-review.googlesource.com/c/1421364
      > Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      > Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#59020}
      
      TBR=mstarzinger@chromium.org,clemensh@chromium.org
      
      Change-Id: I724f460f5aa654a9e75d3ce73d351214e69e2d96
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:8689, v8:7921
      Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_rel
      Reviewed-on: https://chromium-review.googlesource.com/c/1429861Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59022}
      ea513ab8
    • Clemens Hammacher's avatar
      [wasm] Decouple background compile jobs from NativeModule · 92d9b09c
      Clemens Hammacher authored
      Background compile jobs should not keep the NativeModule alive, for two
      reasons:
      1) We sometimes have to wait for background compilation to finish (from
         a foreground task!). This introduces unnecessary latency.
      2) Giving the background compile tasks shared ownership of the
         NativeModule causes the NativeModule (and the CompilationState) to
         be freed from background tasks, which is error-prone (see
         https://crrev.com/c/1400420).
      
      Instead, this CL introduces a BackgroundCompileToken which is held
      alive by the NativeModule and all background compile jobs. The initial
      and the final phase of compilation (getting and submitting work)
      synchronize on this token to check and ensure that the NativeModule is
      and stays alive. During compilation itself, the mutex is released, such
      that the NativeModule can die.
      The destructor of the NativeModule cancels the BackgroundCompileToken.
      Immediately afterwards, the NativeModule and the CompilationState can
      die.
      
      This change allows to remove two hacks introduced previously: The atomic
      {aborted_} flag and the {FreeCallbacksTask}.
      
      R=mstarzinger@chromium.org
      CC=titzer@chromium.org
      
      Bug: v8:8689, v8:7921
      Change-Id: I42e06eab3c944b0988286f2ce18e3c294535dfb6
      Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_rel
      Reviewed-on: https://chromium-review.googlesource.com/c/1421364
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59020}
      92d9b09c
  16. 21 Jan, 2019 1 commit
    • Clemens Hammacher's avatar
      Reland "[wasm] Split compilation in three stages" · 6c2e35b9
      Clemens Hammacher authored
      This is a reland of 4e1d7c87.
      Failure on arm and arm64 is fixed by https://crrev.com/c/1411885.
      
      Original change's description:
      > [wasm] Split compilation in three stages
      >
      > In order to refactor ownership between objects in wasm compilation, the
      > compilation (executed by background tasks) is split in three stages:
      > getting a compilation unit (while holding a mutex), executing the work
      > (without any mutex and without keeping the NativeModule alive), and
      > submitting the work (with a mutex again).
      >
      > This CL prepares this design by splitting compilation from submission.
      > Both steps are still executed right after each other. This will be
      > changed in a follow-up CL.
      >
      > R=titzer@chromium.org
      > CC=mstarzinger@chromium.org
      >
      > Bug: v8:8689
      > Change-Id: I2f92aee8e2f2d45470d8c63314ed026341630902
      > Reviewed-on: https://chromium-review.googlesource.com/c/1414920
      > Reviewed-by: Ben Titzer <titzer@chromium.org>
      > Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#58929}
      
      TBR=titzer@chromium.org
      
      Bug: v8:8689
      Change-Id: I58ff07d0e0ac8df0f6ee23c416f992954f4673d2
      Reviewed-on: https://chromium-review.googlesource.com/c/1422748Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58959}
      6c2e35b9
  17. 18 Jan, 2019 2 commits
    • Michael Achenbach's avatar
      Revert "[wasm] Split compilation in three stages" · b7cc4f7a
      Michael Achenbach authored
      This reverts commit 4e1d7c87.
      
      Reason for revert:
      https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20arm%20-%20sim%20-%20debug/14986
      
      Original change's description:
      > [wasm] Split compilation in three stages
      > 
      > In order to refactor ownership between objects in wasm compilation, the
      > compilation (executed by background tasks) is split in three stages:
      > getting a compilation unit (while holding a mutex), executing the work
      > (without any mutex and without keeping the NativeModule alive), and
      > submitting the work (with a mutex again).
      > 
      > This CL prepares this design by splitting compilation from submission.
      > Both steps are still executed right after each other. This will be
      > changed in a follow-up CL.
      > 
      > R=​titzer@chromium.org
      > CC=​mstarzinger@chromium.org
      > 
      > Bug: v8:8689
      > Change-Id: I2f92aee8e2f2d45470d8c63314ed026341630902
      > Reviewed-on: https://chromium-review.googlesource.com/c/1414920
      > Reviewed-by: Ben Titzer <titzer@chromium.org>
      > Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#58929}
      
      TBR=titzer@chromium.org,clemensh@chromium.org
      
      Change-Id: Ic3d0287b354ef5f834b76bc2cdc096d2231f4477
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:8689
      Reviewed-on: https://chromium-review.googlesource.com/c/1422917Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
      Commit-Queue: Michael Achenbach <machenbach@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58932}
      b7cc4f7a
    • Clemens Hammacher's avatar
      [wasm] Split compilation in three stages · 4e1d7c87
      Clemens Hammacher authored
      In order to refactor ownership between objects in wasm compilation, the
      compilation (executed by background tasks) is split in three stages:
      getting a compilation unit (while holding a mutex), executing the work
      (without any mutex and without keeping the NativeModule alive), and
      submitting the work (with a mutex again).
      
      This CL prepares this design by splitting compilation from submission.
      Both steps are still executed right after each other. This will be
      changed in a follow-up CL.
      
      R=titzer@chromium.org
      CC=mstarzinger@chromium.org
      
      Bug: v8:8689
      Change-Id: I2f92aee8e2f2d45470d8c63314ed026341630902
      Reviewed-on: https://chromium-review.googlesource.com/c/1414920Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58929}
      4e1d7c87
  18. 15 Jan, 2019 1 commit
  19. 14 Jan, 2019 1 commit
  20. 08 Jan, 2019 2 commits
  21. 12 Dec, 2018 1 commit
  22. 11 Dec, 2018 2 commits
  23. 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
  24. 30 Oct, 2018 2 commits
    • Clemens Hammacher's avatar
      [wasm] Fix memory limit checks · fac176d8
      Clemens Hammacher authored
      For memory limit checks, we should use the minimum of the
      --wasm-max-mem-pages flag and kV8MaxWasmMemoryPages. The former is a
      limit set by the user, the latter is the maximum we can handle
      internally.
      
      R=titzer@chromium.org
      
      Bug: chromium:898677
      Change-Id: I3c549f4e90dd016b5d07475d9353f30134f76dcc
      Reviewed-on: https://chromium-review.googlesource.com/c/1305274
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#57127}
      fac176d8
    • Clemens Hammacher's avatar
      Reland "[wasm] Store compile errors in CompilationState" · 1ff80455
      Clemens Hammacher authored
      This is a reland of bf3d7b9a
      
      Original change's description:
      > [wasm] Store compile errors in CompilationState
      > 
      > We are currently storing compilation errors in the individual
      > compilation units and pass it to the ErrorThrower during finishing.
      > This CL changes that to store errors on the CompilationState directly.
      > From there, it is propagated to the ErrorThrower in the compilation
      > state callback.
      > This removes more work from the finisher task and slims down the
      > WasmCompilationUnits.
      > 
      > R=mstarzinger@chromium.org
      > 
      > Bug: v8:8343, v8:7921
      > Change-Id: Id332add43d4219d2a30fee653ed4e53a9b2698d9
      > Reviewed-on: https://chromium-review.googlesource.com/c/1303720
      > Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
      > Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#57091}
      
      Bug: v8:8343, v8:7921
      Change-Id: Iaa5c89d224cb2bcfca2d12eba305413a9ad95618
      Reviewed-on: https://chromium-review.googlesource.com/c/1304547
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#57126}
      1ff80455
  25. 29 Oct, 2018 3 commits
  26. 25 Oct, 2018 1 commit
  27. 23 Oct, 2018 4 commits
  28. 19 Oct, 2018 1 commit