1. 31 Jan, 2018 1 commit
    • Benedikt Meurer's avatar
      [builtins] Refactor promises to reduce GC overhead. · 8e7737cb
      Benedikt Meurer authored
      This implements the ideas outlined in the section "Microtask queue"
      of the exploration document "Promise and async/await performance" (at
      https://goo.gl/WHRar2), except that the microtask queue stays a linear
      FixedArray for now, to avoid running into trouble with the parallel
      scavenger. This way we can already save a significant amount of
      allocations, thereby reducing the GC frequency quite a bit.
      
      All items on the microtask queue are now proper structs that subclass
      Microtask, i.e. we also wrap JSFunction and MicrotaskCallback jobs
      into structs. We also consistently remember the context for every
      microtask (except for MicrotaskCallback where we don't have a
      context), and execute it later in exactly that context (as required
      by the spec anyways for the Promise related jobs). Particularly
      interesting is the PromiseReactionJobTask and its subclasses, since
      they are designed to have the same size as the PromiseReaction. When
      we resolve a JSPromise we just take the existing PromiseReaction
      instances and morph them into PromiseFulfillReactionJobTask or
      PromiseRejectReactionJobTask (depending whether you "Fulfill" or
      "Reject"). That way the JSPromise class is now only 6 words instead
      of 10 words.
      
      Also the PromiseReaction and the reaction tasks can either carry a
      JSPromise (for the fast native case) or a PromiseCapability (for the
      generic case), which means we don't always pay the overhead of having
      to also remember the "deferred resolve" and "deferred reject" handlers
      that are only relevant for the generic case anyways.
      
      It also fixes a spec violation where we called "then" before we actually
      enqueued the PromiseResolveThenableJob, which is observably wrong.
      Calling it later has the advantage that it should be fairly
      straight-forward now to completely avoid it for native Promise
      instances.
      
      This seems to save around 10-20% on the various Promise benchmarks and
      micro-benchmarks. We expect to gain even more as we're now able to
      inline various operations into TurboFan optimized code easily.
      
      Bug: v8:7253
      Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      Change-Id: I893d24ca5bb046974b4f5826a8f6dd22f1210b6a
      Reviewed-on: https://chromium-review.googlesource.com/892819
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
      Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#50980}
      8e7737cb
  2. 25 Jan, 2018 1 commit
    • Yang Guo's avatar
      Introduce SimpleNumberDictionary. · 3857b44e
      Yang Guo authored
      This is somewhat of a revival of what used to be
      UnseededNumberDictionary. The difference to NumberDictionary is that
      each entry only has two fields (no field for property details) and there
      is no header field for a bitfield.
      
      The reason for this change is memory regression introduced when we
      removed UnseededNumberDictionary (6e1c57ea). We now use
      SimpleNumberDictionary for
      - slow template instantiation cache
      - code stubs table
      - value serializer map
      - stack frame cache
      - type profile source positions
      
      R=ishell@chromium.org, ulan@chromium.org
      
      Bug: chromium:783695
      Change-Id: I3cd32e485060bb379fb2279eeefbbbded7455f0e
      Reviewed-on: https://chromium-review.googlesource.com/885811Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Commit-Queue: Yang Guo <yangguo@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#50869}
      3857b44e
  3. 13 Jan, 2018 1 commit
    • Michael Achenbach's avatar
      Revert "Simplify FunctionKind, saving 4 bits in SharedFunctionInfo" · bb7138f6
      Michael Achenbach authored
      This reverts commit 42667bab.
      
      Reason for revert: Breaks msvc compile:
      https://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20msvc/builds/908
      
      Original change's description:
      > Simplify FunctionKind, saving 4 bits in SharedFunctionInfo
      > 
      > Since we only need to store 18 different function kinds,
      > the bitfield approach was wasting space (requiring 11 bits).
      > 
      > This patch replaces the bitfield with a regular enum, and
      > updates all the FunctionKind predicates to use comparisons
      > instead of bitwise ops.
      > 
      > For the small amount of builtin code that depended upon being
      > able to do masking to determine whether something is a class
      > constructor, we still store two extra bits on FunctionKind,
      > which are computed when the SFI is initialized.
      > 
      > If this approach causes performance regressions (i.e., if it
      > turns out that other code was implicitly depending on masking
      > for fast checks), we can revert this or address it in
      > other ways (e.g., by doing similar caching of repeated checks
      > in the caller).
      > 
      > Change-Id: Iebb3214f564ea8bd7b21e78fda33517d63247124
      > Reviewed-on: https://chromium-review.googlesource.com/860896
      > Commit-Queue: Adam Klein <adamk@chromium.org>
      > Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#50559}
      
      TBR=adamk@chromium.org,gsathya@chromium.org
      
      Change-Id: I8e1faa0ca6213d1e70a00fcb417b1bfa35ebd643
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/866310Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
      Commit-Queue: Michael Achenbach <machenbach@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#50561}
      bb7138f6
  4. 12 Jan, 2018 2 commits
  5. 09 Jan, 2018 1 commit
  6. 18 Dec, 2017 2 commits
  7. 14 Dec, 2017 1 commit
  8. 07 Dec, 2017 2 commits
  9. 06 Dec, 2017 1 commit
  10. 01 Dec, 2017 1 commit
  11. 24 Nov, 2017 1 commit
  12. 21 Nov, 2017 2 commits
  13. 17 Nov, 2017 3 commits
  14. 16 Nov, 2017 1 commit
  15. 15 Nov, 2017 1 commit
  16. 14 Nov, 2017 1 commit
  17. 13 Nov, 2017 1 commit
  18. 10 Nov, 2017 2 commits
  19. 08 Nov, 2017 2 commits
    • jgruber's avatar
      [factory] Simplify JSFunction creation · 72230246
      jgruber authored
      There's three common situations in which we need to create JSFunction
      objects.  1) from the compiler, 2) from tests, and 3) everything else
      (mostly during bootstrapping).
      
      This is an attempt to simplify case 3), which previously relied on
      several Factory::NewFunction overloads where it was not clear how the
      semantics of each overload differed.
      
      This CL removes all but one overload, and packs arguments into a new
      NewFunctionArgs helper class.
      
      It also removes the hacks around
      SFI::set_lazy_deserialization_builtin_id by explicitly passing
      builtin_id into Factory::NewSharedFunctionInfo.
      
      Drive-by-fix: Properly set is_constructor hint in
      SimpleCreateSharedFunctionInfo.
      
      Bug: v8:6624
      Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      Change-Id: Ica94d95e72e443055db5e7ff9e8cdf4115201ef1
      Reviewed-on: https://chromium-review.googlesource.com/757094
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49224}
      72230246
    • Clemens Hammacher's avatar
      [wasm] Mark C_WASM_ENTRY as no tagged_params · 3c483de7
      Clemens Hammacher authored
      The C_WASM_ENTRY only calls wasm code, so (outgoing) parameters of this
      code are always untagged.
      
      R=ahaas@chromium.org
      
      Bug: v8:7049
      Change-Id: I989908eea668bd56aa88f3f1744105d218584ef1
      Reviewed-on: https://chromium-review.googlesource.com/758245
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#49221}
      3c483de7
  20. 07 Nov, 2017 2 commits
  21. 06 Nov, 2017 1 commit
  22. 02 Nov, 2017 1 commit
  23. 31 Oct, 2017 2 commits
  24. 27 Oct, 2017 2 commits
  25. 26 Oct, 2017 4 commits
  26. 25 Oct, 2017 1 commit