1. 29 Apr, 2019 1 commit
    • Clemens Hammacher's avatar
      [cleanup] Use Vector::begin instead of Vector::start · 4b0f9c85
      Clemens Hammacher authored
      Our {Vector} template provides both {start} and {begin} methods. They
      return exactly the same value. Since the {begin} method is needed for
      iteration, and is also what standard containers provide, this CL
      switches all uses of the {start} method to use {begin} instead.
      
      Patchset 1 was auto-generated by using this clang AST matcher:
          callExpr(
              callee(
                cxxMethodDecl(
                  hasName("start"),
                  ofClass(hasName("v8::internal::Vector")))
              ),
              argumentCountIs(0))
      
      Patchset 2 was created by running clang-format. Patchset 3 then
      removes the now unused {Vector::start} method.
      
      R=jkummerow@chromium.org
      TBR=mstarzinger@chromium.org,yangguo@chromium.org,verwaest@chromium.org
      
      Bug: v8:9183
      Change-Id: Id9f01c92870872556e2bb3f6d5667463b0e3e5c6
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1587381Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61081}
      4b0f9c85
  2. 06 Mar, 2019 1 commit
  3. 28 Feb, 2019 1 commit
  4. 26 Feb, 2019 1 commit
  5. 19 Feb, 2019 1 commit
  6. 14 Feb, 2019 1 commit
  7. 31 Jan, 2019 1 commit
  8. 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
  9. 29 Jan, 2019 1 commit
    • Clemens Hammacher's avatar
      [wasm] Remove strong reference in TopTierCompiledCallback · 368bf36e
      Clemens Hammacher authored
      Registered callbacks should not keep the NativeModule alive. Otherwise,
      tiering will always run to completion, even if the NativeModule is not
      being used any more.
      This change can cause the callback to not be called if the module dies
      before it finishes top-tier compilation. This is the desired behaviour.
      
      R=ahaas@chromium.org
      CC=titzer@chromium.org, bbudge@chromium.org
      
      Bug: v8:8689, chromium:719172
      Change-Id: Ide9d639f465497c3ed3439c7ce25c76dceeb97eb
      Reviewed-on: https://chromium-review.googlesource.com/c/1435937Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#59175}
      368bf36e
  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. 08 Jan, 2019 2 commits
  13. 21 Dec, 2018 1 commit
  14. 11 Dec, 2018 1 commit
  15. 15 Nov, 2018 1 commit
    • Clemens Hammacher's avatar
      [base] Introduce VectorOf helper · 3ad032b7
      Clemens Hammacher authored
      We often need to create a {Vector} view of data owned by a container
      like {std::vector}. The canonical way to do this is this:
      Vector<T>{vec.data(), vec.size()}
      
      This pattern is repeating information which can be deduced
      automatically, like the type T.
      
      This CL introduces a {VectorOf} helper which can construct a {Vector}
      for any container providing a {data()} and {size()} accessor, and uses
      it to replace the pattern above.
      
      R=ishell@chromium.org
      
      Bug: v8:8238
      Change-Id: Ib3a11662acc82cb83f2b4afd07ba88e579d71dba
      Reviewed-on: https://chromium-review.googlesource.com/c/1337584Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#57538}
      3ad032b7
  16. 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
  17. 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
  18. 06 Nov, 2018 1 commit
  19. 05 Nov, 2018 1 commit
  20. 12 Oct, 2018 1 commit
  21. 14 Aug, 2018 1 commit
    • Andreas Haas's avatar
      Reland "[wasm] Implement the new API for WebAssembly.instantiateStreaming" · 3e545e40
      Andreas Haas authored
      The problem was that in AsyncCompileJob::FinishModule we allocate a
      handle, but when this function is called from streaming compilation, then
      there was no HandleScope around AsyncCompileJob::FinishModule. This issue
      was fixed in another CL, https://crrev.com/c/1172357. This CL is just a
      rebase of the original CL.
      
      Original change's description:
      > [wasm] Implement the new API for WebAssembly.instantiateStreaming
      
      > This is the second V8 CL to refactor WebAssembly.instantiateStreaming to
      > make it spec compliant again. The design doc where the whole change is
      > discussed is available in the tracking bug. The tracking bug also
      > references prototype implementations of the whole change, which includes
      > the changes in this CL.
      
      R=starzinger@chromium.org
      
      Bug: chromium:860637
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      Change-Id: Ib0cb25488654d2b325b4f529d33b76b846c64436
      Reviewed-on: https://chromium-review.googlesource.com/1172429Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55106}
      3e545e40
  22. 02 Aug, 2018 1 commit
    • Andreas Haas's avatar
      Revert "[wasm] Implement the new API for WebAssembly.instantiateStreaming" · fea9300d
      Andreas Haas authored
      This reverts commit b556c9ea.
      
      Reason for revert: Flakes in layout tests: https://crbug.com/870187
      
      Original change's description:
      > [wasm] Implement the new API for WebAssembly.instantiateStreaming
      > 
      > This is the second V8 CL to refactor WebAssembly.instantiateStreaming to
      > make it spec compliant again. The design doc where the whole change is
      > discussed is available in the tracking bug. The tracking bug also
      > references prototype implementations of the whole change, which includes
      > the changes in this CL.
      > 
      > R=​mstarzinger@chromium.org
      > 
      > Bug: chromium:860637
      > Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      > Change-Id: I776c0f24959ab5663727d3dfee0248a9b0642a42
      > Reviewed-on: https://chromium-review.googlesource.com/1143187
      > Commit-Queue: Andreas Haas <ahaas@chromium.org>
      > Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#54834}
      
      TBR=mstarzinger@chromium.org,ahaas@chromium.org
      
      # Not skipping CQ checks because original CL landed > 1 day ago.
      
      Bug: chromium:860637
      Change-Id: Icbf2603143068a49c61de162aa7185a753703e5d
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
      Reviewed-on: https://chromium-review.googlesource.com/1160261Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54872}
      fea9300d
  23. 01 Aug, 2018 1 commit
  24. 28 Jun, 2018 1 commit
  25. 30 Apr, 2018 1 commit
  26. 02 Dec, 2017 1 commit
    • Mathias Bynens's avatar
      Normalize casing of hexadecimal digits · 822be9b2
      Mathias Bynens authored
      This patch normalizes the casing of hexadecimal digits in escape
      sequences of the form `\xNN` and integer literals of the form
      `0xNNNN`.
      
      Previously, the V8 code base used an inconsistent mixture of uppercase
      and lowercase.
      
      Google’s C++ style guide uses uppercase in its examples:
      https://google.github.io/styleguide/cppguide.html#Non-ASCII_Characters
      
      Moreover, uppercase letters more clearly stand out from the lowercase
      `x` (or `u`) characters at the start, as well as lowercase letters
      elsewhere in strings.
      
      BUG=v8:7109
      TBR=marja@chromium.org,titzer@chromium.org,mtrofin@chromium.org,mstarzinger@chromium.org,rossberg@chromium.org,yangguo@chromium.org,mlippautz@chromium.org
      NOPRESUBMIT=true
      
      Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
      Change-Id: I790e21c25d96ad5d95c8229724eb45d2aa9e22d6
      Reviewed-on: https://chromium-review.googlesource.com/804294
      Commit-Queue: Mathias Bynens <mathias@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49810}
      822be9b2
  27. 01 Dec, 2017 1 commit
  28. 20 Nov, 2017 2 commits
  29. 15 Nov, 2017 1 commit
    • Andreas Haas's avatar
      [wasm] Check code section bytes in the streaming decoder · 0ef8da26
      Andreas Haas authored
      The streaming decoder allocates the whole section buffer of the code
      section when it reads the section length of the code section. Therefore
      we have to check that the different parts of the code section actually
      use all the bytes, and that the different parts of the code section do
      not need more bytes than available. The check that all bytes are used
      was missing in the case where the code section contained zero functions.
      
      In addition, this CL adds some tracing to the streaming decoder which
      may be useful in future debugging.
      
      R=clemensh@chromium.org
      
      Bug: chromium:783595
      Change-Id: Icf056c25a3000b4a08a791939dab0ccde9fc3f80
      Reviewed-on: https://chromium-review.googlesource.com/768788
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49380}
      0ef8da26
  30. 05 Oct, 2017 1 commit
  31. 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
  32. 31 Aug, 2017 1 commit
  33. 09 Aug, 2017 1 commit
  34. 31 Jul, 2017 1 commit
    • Clemens Hammacher's avatar
      Revert "[wasm] Allow for arbitrarily long error messages" · 20d25f40
      Clemens Hammacher authored
      This reverts commit 072d0e3e.
      
      Reason for revert: Performance regressions (https://crbug.com/749041).
      
      Original change's description:
      > [wasm] Allow for arbitrarily long error messages
      > 
      > We currently have a fixed limit of 256 characters for error messages
      > generated in the decoder. However, we sometimes embed names in it,
      > which makes it easy to generate a crash by using long names (e.g. for
      > exports) in invalid wasm modules.
      > This CL fixes this by switching to a stream based interface, allowing
      > to pass arbitrary objects to be printed. With this interface, we can
      > easily limit the length of output later.
      > 
      > R=​titzer@chromium.org
      > 
      > Bug: chromium:740023
      > Change-Id: I2848c31c63a015157e2a3a9458b54e523060cd69
      > Reviewed-on: https://chromium-review.googlesource.com/565282
      > Reviewed-by: Ben Titzer <titzer@chromium.org>
      > Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#46860}
      
      TBR=titzer@chromium.org,clemensh@chromium.org
      
      # Not skipping CQ checks because original CL landed > 1 day ago.
      
      Bug: chromium:740023, chromium:749041
      Change-Id: I005a60d55dcf01d350230f8d98f715bab9c43886
      Reviewed-on: https://chromium-review.googlesource.com/593807
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#47008}
      20d25f40
  35. 25 Jul, 2017 1 commit
    • Clemens Hammacher's avatar
      [wasm] Allow for arbitrarily long error messages · 072d0e3e
      Clemens Hammacher authored
      We currently have a fixed limit of 256 characters for error messages
      generated in the decoder. However, we sometimes embed names in it,
      which makes it easy to generate a crash by using long names (e.g. for
      exports) in invalid wasm modules.
      This CL fixes this by switching to a stream based interface, allowing
      to pass arbitrary objects to be printed. With this interface, we can
      easily limit the length of output later.
      
      R=titzer@chromium.org
      
      Bug: chromium:740023
      Change-Id: I2848c31c63a015157e2a3a9458b54e523060cd69
      Reviewed-on: https://chromium-review.googlesource.com/565282Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#46860}
      072d0e3e
  36. 09 Jun, 2017 1 commit
  37. 12 May, 2017 1 commit
  38. 11 May, 2017 1 commit
    • Andreas Haas's avatar
      [wasm] Change the error_pc in the decoder to error_offset · 47e6e260
      Andreas Haas authored
      The error_pc was only used to calculated the relative error offset.
      Switching to an error_offset directly will allow us later to give the
      decoder a base offset. Thereby we can get correct error
      positions even when the decoder is executed on multiple memory chunks,
      which will happen with streaming compilation. With this change I also
      had to provide "kind of" reasonable error position in the
      StreamingDecoder.
      
      R=clemensh@chromium.org
      
      Change-Id: I736fa082c51c64334d23771061acf97e2c47778e
      Reviewed-on: https://chromium-review.googlesource.com/502909
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#45264}
      47e6e260