1. 21 Jul, 2020 1 commit
    • Arnaud Robin's avatar
      [wasm] Implement dynamic tiering in wasm · f181dff3
      Arnaud Robin authored
      On desktop systems, we use a very basic tiering strategy: Everything is
      initially compiled with Liftoff, and once that is done, the module can
      start being used. Concurrently to the execution, we re-compile all code
      with TurboFan, and hot-swap each function once TurboFan finishes.
      
      We should start using a more dynamic strategy where each function is
      tiered-up when judged necessary. This change will then tier-up each
      liftoff function once it has been called 5 times.
      
      I then added a counter in the native module, that is updated directly
      from Liftoff code, and a runtime call is then made when the counter
      reaches the goal.
      
      R=clemensb@chromium.org
      CC=​thibaudm@chromium.org
      
      Bug: v8:10728
      Change-Id: I8dc2b02fdff8d97781bb1cf496886594b3d7f644
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2306803
      Commit-Queue: Arnaud Robin <arobin@google.com>
      Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#68971}
      f181dff3
  2. 09 Jul, 2020 1 commit
  3. 29 Jun, 2020 2 commits
  4. 26 Jun, 2020 2 commits
    • Shu-yu Guo's avatar
      Revert "[wasm-gc] Implement rtt.sub" · 30456566
      Shu-yu Guo authored
      This reverts commit 04ce88ea.
      
      Reason for revert: TSAN failure: https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20TSAN/32135
      
      Original change's description:
      > [wasm-gc] Implement rtt.sub
      > 
      > RTTs are internally represented as Maps. To store supertype information,
      > this patch introduces a WasmTypeInfo object, which is installed on Wasm
      > objects' Maps and points at both the off-heap type information and the
      > parent RTT.
      > In this patch, rtt.sub always creates a fresh RTT. The canonicalization
      > that the proposal requires will be implemented later.
      > 
      > Bug: v8:7748
      > Change-Id: I8286dd11f520966155cd95c2bd844ec34fccd131
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2260566
      > Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
      > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#68564}
      
      TBR=ulan@chromium.org,jkummerow@chromium.org,tebbi@chromium.org
      
      Change-Id: I311732e1ced4de7a58b87d4a9b6056e0d62aa986
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:7748
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2270734Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
      Commit-Queue: Shu-yu Guo <syg@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#68567}
      30456566
    • Jakob Kummerow's avatar
      [wasm-gc] Implement rtt.sub · 04ce88ea
      Jakob Kummerow authored
      RTTs are internally represented as Maps. To store supertype information,
      this patch introduces a WasmTypeInfo object, which is installed on Wasm
      objects' Maps and points at both the off-heap type information and the
      parent RTT.
      In this patch, rtt.sub always creates a fresh RTT. The canonicalization
      that the proposal requires will be implemented later.
      
      Bug: v8:7748
      Change-Id: I8286dd11f520966155cd95c2bd844ec34fccd131
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2260566
      Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#68564}
      04ce88ea
  5. 24 Jun, 2020 1 commit
  6. 18 Jun, 2020 1 commit
    • Manos Koukoutos's avatar
      [wasm-gc] Change ValueType representation to account for new types · 52f65296
      Manos Koukoutos authored
      Motivation:
      Changes to the typed function references and gc proposals solidified
      the notion of heap type, clarified nullable vs. non-nullable reference
      types, and introduced rtts, which contain an integer depth field in
      addition to a heap type. This required us to overhaul our ValueType
      representation, which results in extensive changes.
      
      To keep this CL "small", we do not try to implement the binary encoding
      as described in the proposals, but rather devise a simpler one of our
      own (see below). Also, we do not try to implement additional
      functionality for the new types.
      
      Changes:
      - Introduce HeapType. Move heap types from ValueType to HeapType.
      - Introduce Nullability for reference types.
      - Rework ValueType helper methods.
      - Introduce rtts in ValueType with an integer depth field. Include depth
        in the ValueType encoding.
      - Make the constructor of ValueType private, instead expose static
        functions which explicitly state what they create.
      - Change every switch statement on ValueType::Kind. Sometimes, we need
        nested switches.
      - Introduce temporary constants in ValueTypeCode for nullable types,
        use them for decoding.
      - In WasmGlobalObject, split 'flags' into 'raw_type' and 'is_mutable'.
      - Change IsSubtypeOfRef to IsSubtypeOfHeap and implement changes in
        subtyping.
      - kWasmFuncRef initializers are now non-nullable. Initializers are
        only required to be subtypes of the declared global type.
      - Change tests and fuzzers as needed.
      
      Bug: v8:7748
      Change-Id: If41f783bd4128443b07e94188cea7dd53ab0bfa5
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2247657
      Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#68408}
      52f65296
  7. 10 Jun, 2020 1 commit
  8. 09 Jun, 2020 3 commits
  9. 08 May, 2020 1 commit
  10. 07 May, 2020 1 commit
  11. 06 May, 2020 1 commit
  12. 21 Apr, 2020 1 commit
  13. 18 Mar, 2020 2 commits
  14. 12 Mar, 2020 1 commit
  15. 21 Jan, 2020 1 commit
    • Clemens Backes's avatar
      Move decoded asm.js offset table off-heap · 87f09404
      Clemens Backes authored
      The asm.js offset table exists in two forms: Delta-encoded in a byte
      array, as generated during asm translation, and decoded, for faster
      lookup.
      This CL moves the encoded version from the {AsmWasmData} and
      {WasmModuleObject} to the {WasmModule}, and stores it off-heap in a C++
      array instead of a {ByteArray}.
      Also, it moves the decoded version off-heap by storing it in a C++ data
      structure that makes lookup easy, instead of encoding it again in
      another {ByteArray}.
      
      This change is a nice refactoring in itself, but it also prepares adding
      more information to the offset table. For reconstructing the source code
      of an asm.js function, we will need to store the start and end offsets
      of the whole function as well (see linked bug).
      
      R=jkummerow@chromium.org
      
      Bug: chromium:667678
      Change-Id: I79b789c3122dd8ba803cedc6bfdcc3d4b1fa0fd4
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011108
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#65900}
      87f09404
  16. 16 Jan, 2020 1 commit
    • Clemens Backes's avatar
      [wasm] Move decoded local names off-heap · c0ee1e28
      Clemens Backes authored
      We were decoding the names of locals into a C++ data structure, and then
      generated a FixedArray out of that, stored in the on-heap WasmDebugInfo.
      In order to support name lookup for debugging with Liftoff, where no
      WasmDebugInfo will be present, this CL refactors the C++ data structure
      to allow direct lookups and stores it in the C++ DebugInfo structure.
      
      With this CL, the names are still only used from the old
      interpreter-based debugging path. A follow-up CL will then also use it
      from Liftoff.
      
      R=thibaudm@chromium.org
      
      Bug: v8:10019
      Change-Id: I1397021b5d69b9346fc26f5e83653360f428c5e7
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2002541
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#65819}
      c0ee1e28
  17. 15 Jan, 2020 1 commit
  18. 03 Dec, 2019 1 commit
  19. 27 Nov, 2019 1 commit
  20. 24 Oct, 2019 1 commit
  21. 10 Oct, 2019 1 commit
  22. 09 Oct, 2019 1 commit
  23. 26 Sep, 2019 2 commits
  24. 24 Sep, 2019 1 commit
    • Andreas Haas's avatar
      [wasm][interpreter] Fix memory leak with the reference stack · 9cf9e82a
      Andreas Haas authored
      This CL fixes a memory leak in the interpreter. The leak was caused by
      a cycle the object graph that was rooted with a global object. The
      cycle was the following:
      
      A global handle, owned by the interpreter -> reference stack of the
      Interpreter -> ref.func element (WasmExportedFunction) ->
      WasmInstanceObject -> WasmDebugInfo -> InterpreterHandle -> Interpreter
      
      With this CL we get rid of the global handle. Instead we store the stack
      in the WasmDebugInfo. We then have to load the reference stack every time
      we enter the Interpreter and want access the reference stack.
      
      R=mstarzinger@chromium.org
      
      Bug: chromium:1000610
      Change-Id: If8995725f7ec35862b2f99a07582c861027daaf1
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1800582
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63953}
      9cf9e82a
  25. 29 Aug, 2019 1 commit
    • Seth Brenith's avatar
      [cleanup][torque] Use @generateCppClass in some simple cases, part 2 · a5811358
      Seth Brenith authored
      This patch is mostly mechanical. A few changes in
      implementation-visitor.cc might be worth mentioning:
      - Don't generate both field offset macros and class definitions for the
        same class. This was mostly just to keep me from forgetting to remove
        the DEFINE_FIELD_OFFSET_CONSTANTS part when converting classes, but
        also helpfully flagged that FixedArrayBase wasn't using the generated
        class that it requested.
      - Generate forward declarations for all tq-defined classes in
        internal-class-definitions-tq.h. This is helpful for making things
        compile when classes have fields of other class types.
      - When generating accessors for union types, use the nearest class type
        that contains the entire union rather than plain Object. This is
        important for compile-time type safety. It also required a few minor
        fixes elsewhere (isolate.cc, modules.cc, scope-info.cc,
        source-text-module.cc, and a correction of the field types in
        CallHandlerInfo to match how they're set in api.cc).
      
      Change-Id: I3b9280e30779ce57fb9f3629eecfec898e26d708
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1774976Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
      Cr-Commit-Position: refs/heads/master@{#63458}
      a5811358
  26. 28 Aug, 2019 1 commit
  27. 26 Aug, 2019 1 commit
    • Jakob Kummerow's avatar
      [wasm-c-api] Roll bf31edf: Fix life times of host info · 3aa4f05d
      Jakob Kummerow authored
      Host info used to be stored on the global reference underlying a Ref;
      now it is stored in a JSWeakMap and hence tied to the lifetime of the
      actual object on V8's heap.
      Additionally, the internal metadata needed for C-API functions is now
      stored on the SharedFunctionInfo and no longer overlaps with the host
      info mechanism.
      
      Bonus content:
      Roll 6db391e: Remove a few more leftover uses of _enum types
      
      Change-Id: Ibb1fa4b0dd5157fef15c030bac705a11aa3beaea
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1768368Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63400}
      3aa4f05d
  28. 22 Aug, 2019 1 commit
  29. 24 Jul, 2019 1 commit
  30. 23 Jul, 2019 1 commit
  31. 19 Jul, 2019 1 commit
  32. 15 Jul, 2019 1 commit
  33. 08 Jul, 2019 1 commit
  34. 03 Jul, 2019 1 commit
    • Andreas Haas's avatar
      [wasm] Refactor indirect function calls · 02f18b2d
      Andreas Haas authored
      This is the combined second and third step of refactoring indirect
      function calls through tables with index > 0 to work without runtime
      calls.
      
      The first CL introduces the WasmIndirectFunctionTable heap object. For
      a table of type anyfunc within a WebAssembly instance,
      WasmIndirectFunctionTable stores the size, the signature id's, the
      call targets, and the reference parameters for that table. I used the
      names that are already used for the matching fields of the
      WasmInstanceObject.
      
      The second CL expands the IndirectFunctionTableEntry to work also on
      WasmIndirectFunctionTable objects. All changes to a function table go
      through this class.
      
      The third CL introduces uses of the WasmIndirectFunctionTable. In this
      CL I change the code generation in TurboFan to replace runime calls with
      direct accesses to the new WasmIndirectFunctionTable. Additionally I
      extended the initialization of WasmIndirectFunctionTable, and also
      implement Table.grow.
      
      R=mstarzinger@chromium.org
      
      Bug: v8:7581
      Change-Id: Ic7615c0138562d27897683358ddc0943add1acfe
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1684186
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#62515}
      02f18b2d