1. 17 Aug, 2020 1 commit
  2. 14 Aug, 2020 1 commit
    • Leszek Swirski's avatar
      [offthread] Change OffThreadIsolate to LocalIsolate · f1589bbe
      Leszek Swirski authored
      This patch introduces a new LocalIsolate and LocalFactory, which use
      LocalHeap and replace OffThreadIsolate and OffThreadFactory. This allows
      us to remove those classes, as well as the related OffThreadSpace,
      OffThreadLargeObjectSpace, OffThreadHeap, and OffThreadTransferHandle.
      OffThreadLogger becomes LocalLogger.
      
      LocalHeap behaves more like Heap than OffThreadHeap did, so this allows
      us to additionally remove the concept of "Finish" and "Publish" that the
      OffThreadIsolate had, and allows us to internalize strings directly with
      the newly-concurrent string table (where the implementation can now move
      to FactoryBase).
      
      This patch also removes the off-thread support from the deserializer
      entirely, as well as removing the LocalIsolateWrapper which allowed
      run-time distinction between Isolate and OffThreadIsolate. LocalHeap
      doesn't support the reservation model used by the deserializer, and we
      will likely move the deserializer to use LocalIsolate unconditionally
      once we figure out the details of how to do this.
      
      Bug: chromium:1011762
      
      Change-Id: I1a1a0a72952b19a8a4c167c11a863c153a1252fc
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2315990
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Auto-Submit: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69397}
      f1589bbe
  3. 10 Aug, 2020 1 commit
    • Sathya Gunasekaran's avatar
      [ast] Store correct source position on ThisExpression · 8a9e3f64
      Sathya Gunasekaran authored
      Previously, all ThisExpression's had kNoSourcePositions leading to
      incorrect error messages like this:
      
        ➜ d8 -e "function t() { for (const x of this) {} } t();"
        unnamed:1: TypeError: undefined is not a function
        function t() { for (const x of this) {} } t();
                  ^
        TypeError: undefined is not a function
            at t (unnamed:1:11)
            at unnamed:1:43
      
      
      This patch allows creation of a ThisExpression with a source position,
      leading to a better error message:
      
        ➜ d8  -e "function t() { for (const x of this) {} } t();"
        unnamed:1: TypeError: this is not iterable
        function t() { for (const x of this) {} } t();
                                       ^
        TypeError: this is not iterable
            at t (unnamed:1:32)
            at unnamed:1:43
      
      
      This patch does not remove the existing cached version of
      ThisExpression and instead creates a new one when required.
      
      Bug: v8:6513
      Change-Id: Idee4fe8946a9b821d06ff4a5e7eaefe54874ec59
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2345226Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69300}
      8a9e3f64
  4. 04 Aug, 2020 1 commit
  5. 03 Aug, 2020 2 commits
  6. 31 Jul, 2020 3 commits
  7. 30 Jul, 2020 1 commit
  8. 28 Jul, 2020 1 commit
  9. 24 Jul, 2020 1 commit
    • Leszek Swirski's avatar
      [compiler] Off-thread finalize each function immediately · 198deea2
      Leszek Swirski authored
      Allow "iterative" finalization when off-thread finalization is enabled,
      meaning that each compiled function is finalized immediately after
      compilation, rather than all functions being first compiled and then
      finalized.
      
      This is what we do on the main thread, and it reduces peak Zone memory
      usage by being able to discard empty compilation Zones earlier.
      
      One necessary functionality for this was being able to defer the
      finalization of asm.js functions until the main thread pause, since
      they can't be finalized off-thread -- previously we would just bail
      out of doing the off-thread finalization if any inner function was
      asm.js.
      
      Bug: chromium:1011762
      Change-Id: I21ff69d62eaa93b5ff908624b7115601e36f70f1
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2282536Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Auto-Submit: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69032}
      198deea2
  10. 13 Jul, 2020 2 commits
  11. 08 Jul, 2020 1 commit
  12. 22 Jun, 2020 1 commit
  13. 18 Jun, 2020 2 commits
  14. 16 Jun, 2020 1 commit
  15. 15 Jun, 2020 1 commit
    • Jakob Gruber's avatar
      [scanner] Update outdated DCHECK · 9aa3c608
      Jakob Gruber authored
      We recently changed uc32 to be an unsigned type, and with the invalid
      marker being static_cast<uc32>(-1) this DCHECK no longer holds. After
      this CL it expicitly checks for the invalid marker.
      
      Bug: v8:10568,chromium:1094226
      Change-Id: Idd9efe055b38387e3e37b132cb786cca130767b3
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2245592
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Auto-Submit: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#68333}
      9aa3c608
  16. 11 Jun, 2020 1 commit
  17. 10 Jun, 2020 2 commits
  18. 04 Jun, 2020 1 commit
  19. 03 Jun, 2020 1 commit
  20. 02 Jun, 2020 2 commits
  21. 11 May, 2020 1 commit
  22. 08 May, 2020 3 commits
  23. 06 May, 2020 2 commits
    • Leszek Swirski's avatar
      [offthread] Unify compiler.cc finalization logic · 58b12f63
      Leszek Swirski authored
      This patch unfies the finalization logic between the various unoptimized
      compilation paths in compiler.cc, taking the various post-processings and
      fixups needed for off-thread finalization and performing them in the same
      order for the other finalizations.
      
      It also unifies the general compilation path between streaming script
      compilation, main-thread script compilation, and main-thread lazy
      compilation, making the main-thread paths both use an iterative execution
      and finalization, and making all three use the same job helper methods
      and overall finalization helper.
      
      Bug: chromium:1011762
      Change-Id: Ibe56f6d2f75a2deffbe9e0b600ded8a02293b722
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2172790
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67609}
      58b12f63
    • Leszek Swirski's avatar
      [parser] Move Compiler::Analyze into Parser · 65d738d4
      Leszek Swirski authored
      Move rewriting, scope analysis, and internalization, to be unconditional
      operations done after parsing rather than a separate compile phase. This
      removes some of the complexity about rememberering when to call
      Compiler::Analyze, and makes these paths a bit more uniform.
      
      Also, forbid allocating any more AST strings after AstValueFactory
      internalization, by nulling out the Zone. Add an InternalizePartial
      method which doesn't null out the zone for those cases where we do want
      to be able to allocate after internalizing (e.g. internalization before
      scope analysis).
      
      Change-Id: Id444246d8362a1d169baf664fc37657d9576fd96
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2182458Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67608}
      65d738d4
  24. 24 Apr, 2020 3 commits
    • Leszek Swirski's avatar
      [offthread] Move line-end init to FinalizeScriptCompilation · 9f43850f
      Leszek Swirski authored
      Moves the Script line-end initialization for profiling out of
      CreateScript and into FinalizeScriptCompilation. This ensures that
      scripts created off-thread still get line-ends when necessary.
      
      Bug: chormium:1011762
      Change-Id: If16ad17b2b3ec96908420107bd5f9161eab9492f
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2122020
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67363}
      9f43850f
    • Leszek Swirski's avatar
      Reland "[offthread] Move stress-background-compile to compiler.cc" · 471b2001
      Leszek Swirski authored
      This is a reland of a441cbfb
      
      Disabling cctest/test-compiler/DeepEagerCompilationPeakMemory in stress
      mode since allocation is no longer deterministic.
      
      Original change's description:
      > [offthread] Move stress-background-compile to compiler.cc
      >
      > Make --stress-background-compile a V8 flag rather than a d8 flag, so
      > that it also tests unittests/cctests.
      >
      > Now, with this flag, every top-level script compile (that fulfills a
      > couple of restrictions) will be both main-thread and background-thread
      > compiled, taking the result of the background compile. In the future,
      > we'll probably want to verify that the two results are equivalent.
      >
      > One of the necessary changes to allow tests to pass was to introduce a
      > concept of a "temporary" script (with a temporary script id), which
      > doesn't get added to the script list. This is to avoid the main-thread
      > compile part of the stress-test having a debugger-visible side-effect,
      > e.g. in tests that enumerate scripts. We can't just create new ids for
      > such scripts, as then script-id expectation files no longer match.
      >
      > Bug: chromium:1011762
      > Change-Id: I500bbf2cabea762e69aca3dbae247daae71192cb
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2120541
      > Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      > Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#67332}
      
      TBR=rmcilroy@chromium.org
      
      Bug: chromium:1011762
      Change-Id: I5f9f0eb71caa4829e72b4a6d2824cbebd3698bd5
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2162876Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67356}
      471b2001
    • Leszek Swirski's avatar
      [offthread] Allow errors in off-thread compile · d1d35f9b
      Leszek Swirski authored
      Use the PendingCompilationErrorHandler in the UnoptimizedCompileState
      class to prepare compilation errors off-thread, and report them during
      the merge into the main thread.
      
      Bug: chromium:1011762
      Change-Id: I3ad5078e25c176aa30743500714b2fad838d3ce8
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2105354
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67353}
      d1d35f9b
  25. 23 Apr, 2020 4 commits
    • Bill Budge's avatar
      Revert "[offthread] Move stress-background-compile to compiler.cc" · 5f040f9b
      Bill Budge authored
      This reverts commit a441cbfb.
      
      Reason for revert: causes DeepEagerCompilationPeakMemory to fail.
      
      https://ci.chromium.org/p/v8/builders/ci/V8%20Linux/36681
      
      Original change's description:
      > [offthread] Move stress-background-compile to compiler.cc
      > 
      > Make --stress-background-compile a V8 flag rather than a d8 flag, so
      > that it also tests unittests/cctests.
      > 
      > Now, with this flag, every top-level script compile (that fulfills a
      > couple of restrictions) will be both main-thread and background-thread
      > compiled, taking the result of the background compile. In the future,
      > we'll probably want to verify that the two results are equivalent.
      > 
      > One of the necessary changes to allow tests to pass was to introduce a
      > concept of a "temporary" script (with a temporary script id), which
      > doesn't get added to the script list. This is to avoid the main-thread
      > compile part of the stress-test having a debugger-visible side-effect,
      > e.g. in tests that enumerate scripts. We can't just create new ids for
      > such scripts, as then script-id expectation files no longer match.
      > 
      > Bug: chromium:1011762
      > Change-Id: I500bbf2cabea762e69aca3dbae247daae71192cb
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2120541
      > Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      > Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#67332}
      
      TBR=rmcilroy@chromium.org,leszeks@chromium.org
      
      Change-Id: I8716b332b07fe4f394b5a32c986bbe652325582d
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: chromium:1011762
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2163143Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
      Commit-Queue: Bill Budge <bbudge@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67347}
      5f040f9b
    • Leszek Swirski's avatar
      [offthread] Move stress-background-compile to compiler.cc · a441cbfb
      Leszek Swirski authored
      Make --stress-background-compile a V8 flag rather than a d8 flag, so
      that it also tests unittests/cctests.
      
      Now, with this flag, every top-level script compile (that fulfills a
      couple of restrictions) will be both main-thread and background-thread
      compiled, taking the result of the background compile. In the future,
      we'll probably want to verify that the two results are equivalent.
      
      One of the necessary changes to allow tests to pass was to introduce a
      concept of a "temporary" script (with a temporary script id), which
      doesn't get added to the script list. This is to avoid the main-thread
      compile part of the stress-test having a debugger-visible side-effect,
      e.g. in tests that enumerate scripts. We can't just create new ids for
      such scripts, as then script-id expectation files no longer match.
      
      Bug: chromium:1011762
      Change-Id: I500bbf2cabea762e69aca3dbae247daae71192cb
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2120541
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67332}
      a441cbfb
    • Gus Caplan's avatar
      Implement logical assignment · b151d8db
      Gus Caplan authored
      https://tc39.es/proposal-logical-assignment/
      
      Bug: v8:10372
      Change-Id: I538d54af6b4b24d450d1398c74f76dd57fdb0147
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2158119Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
      Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
      Commit-Queue: Marja Hölttä <marja@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67330}
      b151d8db
    • Leszek Swirski's avatar
      [compile] Add an UnoptimizedCompileState class · 6458a529
      Leszek Swirski authored
      Move the persistent compilation state and Isolate inputs (such as the
      allocator, shared AST constants, hash seed, logger, etc.) which survives
      across both parse and compile, out of ParseInfo and into a new
      UnoptimizedCompileState class. Also add UnoptimizedCompilePerThreadState
      for per-thread state such as stack limit and RCS.
      
      In particular, this new state survives the ParseInfo being destructed,
      which means it is available after off-thread finalization. This allows a
      followup to access the PendingCompilationErrorHandler after finalization
      and report errors on merge.
      
      Bug: v8:10314
      Change-Id: Ia186bc0f267c704efd771aa1895f50a4525a8364
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2105636
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67329}
      6458a529