1. 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
  2. 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
  3. 14 Jan, 2019 1 commit
  4. 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
  5. 29 Oct, 2018 1 commit
  6. 23 Oct, 2018 2 commits
  7. 19 Oct, 2018 1 commit
    • Clemens Hammacher's avatar
      [wasm] Move error reporting out of FinishCompilation · e32daf0a
      Clemens Hammacher authored
      And remove the TurboFan/Liftoff specific {FinishCompilation}
      implementations completely. Compilation errors are now stored in the
      {WasmCompilationUnit} directly as a {Result<WasmCode*>}. They are
      retrieved via {WasmCompilationUnit::ReportError}, which moves the error
      to the {ErrorThrower}.
      This prepares more changes to completely remove the {FinishCompilation}
      phase.
      
      R=titzer@chromium.org
      
      Bug: v8:7921
      Change-Id: I4f9a6e919359aeab074880d0d38211500b76e4ec
      Reviewed-on: https://chromium-review.googlesource.com/c/1290975
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#56826}
      e32daf0a
  8. 23 Aug, 2018 3 commits
    • Ben L. Titzer's avatar
      Reland "[wasm] Add feature counter for threads and shared memory" · ab6d5ed5
      Ben L. Titzer authored
      This is a reland of b10a967f
      
      Original change's description:
      > [wasm] Add feature counter for threads and shared memory
      > 
      > This adds a feature counter for WASM shared memory (i.e. the presence
      > of the "shared" bit in a WASM module's memory section) and the usage
      > of WASM threads opcodes (i.e. wake/wait and atomics).
      > 
      > This CL also plumbs the WasmFeatures through the compilation pipeline
      > to detect features as functions are being compiled.
      > 
      > R=ahaas@chromium.org, ulan@chromium.org
      > BUG=chromium:868844
      > 
      > Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      > Change-Id: I854f932d3adb16e4fd87196fe2a193950295b856
      > Reviewed-on: https://chromium-review.googlesource.com/1186329
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Commit-Queue: Ben Titzer <titzer@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#55337}
      
      Bug: chromium:868844
      Change-Id: Iac3a38d80fa71aadd7147704669a8fd671ecfae8
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      Reviewed-on: https://chromium-review.googlesource.com/1186343
      Commit-Queue: Ben Titzer <titzer@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55363}
      ab6d5ed5
    • Maya Lekova's avatar
      Revert "[wasm] Add feature counter for threads and shared memory" · a984ccd7
      Maya Lekova authored
      This reverts commit b10a967f.
      
      Reason for revert: Breaks a TSAN bot - https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux64%20TSAN/22122
      
      Original change's description:
      > [wasm] Add feature counter for threads and shared memory
      > 
      > This adds a feature counter for WASM shared memory (i.e. the presence
      > of the "shared" bit in a WASM module's memory section) and the usage
      > of WASM threads opcodes (i.e. wake/wait and atomics).
      > 
      > This CL also plumbs the WasmFeatures through the compilation pipeline
      > to detect features as functions are being compiled.
      > 
      > R=​ahaas@chromium.org, ulan@chromium.org
      > BUG=chromium:868844
      > 
      > Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      > Change-Id: I854f932d3adb16e4fd87196fe2a193950295b856
      > Reviewed-on: https://chromium-review.googlesource.com/1186329
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Commit-Queue: Ben Titzer <titzer@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#55337}
      
      TBR=ulan@chromium.org,titzer@chromium.org,ahaas@chromium.org
      
      Change-Id: Id011b6707b3359598621b315b87171644132b0ab
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: chromium:868844
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      Reviewed-on: https://chromium-review.googlesource.com/1186421Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
      Commit-Queue: Maya Lekova <mslekova@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55340}
      a984ccd7
    • Ben L. Titzer's avatar
      [wasm] Add feature counter for threads and shared memory · b10a967f
      Ben L. Titzer authored
      This adds a feature counter for WASM shared memory (i.e. the presence
      of the "shared" bit in a WASM module's memory section) and the usage
      of WASM threads opcodes (i.e. wake/wait and atomics).
      
      This CL also plumbs the WasmFeatures through the compilation pipeline
      to detect features as functions are being compiled.
      
      R=ahaas@chromium.org, ulan@chromium.org
      BUG=chromium:868844
      
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      Change-Id: I854f932d3adb16e4fd87196fe2a193950295b856
      Reviewed-on: https://chromium-review.googlesource.com/1186329Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Commit-Queue: Ben Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55337}
      b10a967f
  9. 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
  10. 05 Jul, 2018 2 commits
  11. 03 Jul, 2018 1 commit
  12. 27 Jun, 2018 1 commit
    • Clemens Hammacher's avatar
      [wasm] Store protected instructions in an OwnedVector · ce2d01bc
      Clemens Hammacher authored
      We currently store the protected instructions per code object in a
      {std::unique_ptr<std::vector<ProtectedInstructionData>>}. This wastes
      memory, because it requires two heap allocations, plus the vector might
      over-allocate (and it currently does, because it is filled dynamically
      during compilation).
      This CL changes that to store the protected instructions in an
      {OwnedVector}. This requires one copy after generating the list of
      {ProtectedInstructionData} in an {std::vector} during compilation, but
      saves memory afterwards.
      
      R=mstarzinger@chromium.org
      
      Bug: chromium:856938
      Change-Id: Ie290a17dc32f27fbbfe0c000a52297181c954550
      Reviewed-on: https://chromium-review.googlesource.com/1116701Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54052}
      ce2d01bc
  13. 07 Jun, 2018 1 commit
  14. 26 Apr, 2018 1 commit
  15. 19 Apr, 2018 1 commit
    • Clemens Hammacher's avatar
      [wasm] Tear apart the WasmCompilationUnit · 0da7ec58
      Clemens Hammacher authored
      This refactoring is a big step towards separating Turbofan-related code
      from backend independent code. This will allow us to include way less
      headers from "src/compiler" at various places.
      
      The {WasmCompilationUnit} contained information for Turbofan
      compilation, and for Liftoff compilation. This CL tears this apart, such
      that {WasmCompilationUnit} holds backend-independent information, plus
      a pointer to either {LiftoffCompilationUnit} or
      {TurbofanWasmCompilationUnit}. These pointers are opaque, so that
      {function-compiler.h}, defining {WasmCompilationUnit}, does not need to
      include any Turbofan specific or Liftoff specific headers.
      
      R=ahaas@chromium.org, titzer@chromium.org, mstarzinger@chromium.org
      
      Bug: v8:7570, v8:6600
      Change-Id: I024c9a23508ee1b4b3cbe1d068c8e785d732daca
      Reviewed-on: https://chromium-review.googlesource.com/1016640
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52684}
      0da7ec58