1. 07 Jan, 2019 3 commits
    • Clemens Hammacher's avatar
      [Liftoff] Avoid quadratic behaviour in stack transfers · 23a85a33
      Clemens Hammacher authored
      We currently iterate the list of unexecuted register moves repeatedly,
      always executing the moves whose destination register is not being used
      as source register any more. This can lead to quadratic execution times
      if only a small number of moves is processed in every iteration.
      
      This CL refactors this such that we iterate the moves at most three
      times: Once for executing moves which can be executed right away (fast
      path) and for computing the source register use counts. A second time
      to execute all remaining non-cyclic moves, and a third time to execute
      cyclic moves.
      During the second and third iteration, whenever we decrement the source
      register use count, we check whether it drops to zero and execute the
      respective move right away.
      
      R=ahaas@chromium.org
      
      Bug: v8:6600, v8:8423
      Change-Id: I503328f5ae5f0208e35d53c71b4c289d75799892
      Reviewed-on: https://chromium-review.googlesource.com/c/1397703
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58588}
      23a85a33
    • Clemens Hammacher's avatar
      [Liftoff] Change the way we store stack transfers · 96671ab2
      Clemens Hammacher authored
      Stack transfers consist of a number of register moves plus a number of
      register loads. We currently store both in separate vectors. This CL
      changes that to be stored in arrays indexed by the destination register
      (such that it behaves like a map). This avoids any dynamically growing
      structures.
      
      Measured locally, this speeds up stack transfer processing by ~10%,
      which translates to ~0.5% of overall Liftoff compilation time.
      
      R=ahaas@chromium.org
      
      Bug: v8:6600, v8:8423
      Change-Id: Id532960dcc12f228507ed75e392ad4c57710593f
      Reviewed-on: https://chromium-review.googlesource.com/c/1396278
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58587}
      96671ab2
    • Clemens Hammacher's avatar
      [Liftoff] Restructure execution of stack transfers · b962c071
      Clemens Hammacher authored
      This is a fully semantically preserving CL, it just moves code around a
      bit to make the follow-up CL easier to review.
      
      R=ahaas@chromium.org
      
      Bug: v8:6600, v8:8423
      Change-Id: I0de80b18faa3ae570894cbd8073c495a5731d255
      Reviewed-on: https://chromium-review.googlesource.com/c/1396096Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58569}
      b962c071
  2. 04 Jan, 2019 2 commits
  3. 03 Jan, 2019 5 commits
    • Clemens Hammacher's avatar
      [Liftoff] Use int for liftoff register codes · 0f867644
      Clemens Hammacher authored
      The number of registers is very small, so any integer type is big
      enough anyway. Just use the simplest one, which is int.
      
      R=ahaas@chromium.org
      
      Bug: v8:6600
      Change-Id: I9762a5c934848b810b7937ee603cd183f883d557
      Reviewed-on: https://chromium-review.googlesource.com/c/1394548Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58524}
      0f867644
    • Clemens Hammacher's avatar
      [Liftoff] Keep consistent register mapping in non-merged regions · 20b63300
      Clemens Hammacher authored
      We currently de-duplicate used registers also in regions which do not
      need merging. In those regions though it can never happen that we need
      to pass different values from any merge input. Apart from introducing
      unnecessary register moves, this also causes a DCHECK to fail, because
      we might later want to merge back different registers into one.
      
      Assume this initial stack state (where each letter is a register):
      [A B B C]
      If in any child block the two Bs get de-duplicated so something like
      [A B D C]
      then we run into trouble when merging back this state into the parent
      state, because both B and D would need to be put into B.
      In this case we can statically infer that B and D must hold the same
      value anyway, but having this situation does not make much sense in the
      first place, so the DCHECK fires correctly.
      
      R=titzer@chromium.org
      
      Bug: v8:8423, chromium:917412
      Change-Id: I24c36b062e04a134cf7051725afab98126753f31
      Reviewed-on: https://chromium-review.googlesource.com/c/1392190
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58522}
      20b63300
    • Clemens Hammacher's avatar
      [Liftoff] Fix moving stack values · 14faced4
      Clemens Hammacher authored
      On x64 the {kScratchRegister} cannot be held in a {LiftoffRegister},
      since it is not a valid cache register. Also, the code unnecessarily
      checked whether there is an unused cache register, but then didn't use
      it. Simplify the logic to always use the scratch register, just
      distinguish between 4-byte and 8-byte moves.
      On ia32 we did not move 64-bit values correctly if we didn't have
      unused registers and needed to move via the stack.
      
      R=titzer@chromium.org
      
      Bug: v8:6600, chromium:917588, chromium:917450
      Change-Id: I0bbe946c6ac8fca62f85711ae47afdac9c02ae6b
      Reviewed-on: https://chromium-review.googlesource.com/c/1391755Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58521}
      14faced4
    • Clemens Hammacher's avatar
      [Liftoff] Remove all computation of "half indexes" · 5ea59597
      Clemens Hammacher authored
      Instead, always pass an index and an enum pointing to either half.
      
      R=titzer@chromium.org
      
      Bug: v8:6600, v8:8562
      Change-Id: I7e73bd97bfc7ebf644b242980aa0a73cd5f18949
      Reviewed-on: https://chromium-review.googlesource.com/c/1392189
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58516}
      5ea59597
    • Clemens Hammacher's avatar
      [Liftoff][mips] Clean up "half stack slot" accesses · 84bda68f
      Clemens Hammacher authored
      Bring mips in line with the ia32 and arm implementions. Instead of
      computing the "half index" manually, pass the index and an enum
      pointing to either half.
      
      R=titzer@chromium.org
      
      Bug: v8:6600
      Change-Id: Id8812114df84fbddd4aa2570306526d291bface6
      Reviewed-on: https://chromium-review.googlesource.com/c/1392188
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58514}
      84bda68f
  4. 02 Jan, 2019 2 commits
  5. 27 Dec, 2018 1 commit
  6. 21 Dec, 2018 5 commits
  7. 20 Dec, 2018 2 commits
  8. 19 Dec, 2018 2 commits
  9. 18 Dec, 2018 1 commit
  10. 17 Dec, 2018 3 commits
    • Sigurd Schneider's avatar
      Reland "[assembler] Split out CPUFeatures into its own file" · 01b0afd5
      Sigurd Schneider authored
      This is a reland of 3ad101f5
      
      Original change's description:
      > [assembler] Split out CPUFeatures into its own file
      >
      > This reduces the preprocessor expanded source size by 84,675 LoC:
      >
      > gen         (   20 files):    71,349 to    1,523,934 (   21x)
      > src         (  624 files):   367,410 to   53,253,894 (  145x)
      > test        (  392 files):   490,503 to   37,436,176 (   76x)
      > third_party (  432 files):   239,085 to    9,547,902 (   40x)
      > total       ( 1520 files): 1,183,031 to  102,736,424 (   87x)
      >
      > to
      >
      > gen         (   20 files):    71,349 to    1,523,794 (   21x)
      > src         (  624 files):   367,411 to   53,186,896 (  145x)
      > test        (  392 files):   490,504 to   37,418,639 (   76x)
      > third_party (  432 files):   239,085 to    9,547,902 (   40x)
      > total       ( 1520 files): 1,183,033 to  102,651,749 (   87x)
      >
      >
      > Change-Id: Ia8a79092051a42815b65e86a0784297915368c9b
      > Reviewed-on: https://chromium-review.googlesource.com/c/1291471
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
      > Reviewed-by: Marja Hölttä <marja@chromium.org>
      > Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#58266}
      
      TBR=marja@chromium.org,clemensh@chromium.org,ulan@chromium.org
      
      Change-Id: I5b857666508b1c80dcadd0b470aada37dd49077e
      Reviewed-on: https://chromium-review.googlesource.com/c/1379872Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
      Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58278}
      01b0afd5
    • Maya Lekova's avatar
      Revert "[assembler] Split out CPUFeatures into its own file" · 316b152a
      Maya Lekova authored
      This reverts commit 3ad101f5.
      
      Reason for revert: Broken Android Arm64 debug builder - https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Android%20Arm64%20-%20debug%20builder/3089
      
      Original change's description:
      > [assembler] Split out CPUFeatures into its own file
      > 
      > This reduces the preprocessor expanded source size by 84,675 LoC:
      > 
      > gen         (   20 files):    71,349 to    1,523,934 (   21x)
      > src         (  624 files):   367,410 to   53,253,894 (  145x)
      > test        (  392 files):   490,503 to   37,436,176 (   76x)
      > third_party (  432 files):   239,085 to    9,547,902 (   40x)
      > total       ( 1520 files): 1,183,031 to  102,736,424 (   87x)
      > 
      > to
      > 
      > gen         (   20 files):    71,349 to    1,523,794 (   21x)
      > src         (  624 files):   367,411 to   53,186,896 (  145x)
      > test        (  392 files):   490,504 to   37,418,639 (   76x)
      > third_party (  432 files):   239,085 to    9,547,902 (   40x)
      > total       ( 1520 files): 1,183,033 to  102,651,749 (   87x)
      > 
      > 
      > Change-Id: Ia8a79092051a42815b65e86a0784297915368c9b
      > Reviewed-on: https://chromium-review.googlesource.com/c/1291471
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
      > Reviewed-by: Marja Hölttä <marja@chromium.org>
      > Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#58266}
      
      TBR=ulan@chromium.org,marja@chromium.org,sigurds@chromium.org,clemensh@chromium.org
      
      Change-Id: I111f9bbef9e66cd1ee7f4206b6af1097f7c50e66
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/1379933Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
      Commit-Queue: Maya Lekova <mslekova@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58268}
      316b152a
    • Sigurd Schneider's avatar
      [assembler] Split out CPUFeatures into its own file · 3ad101f5
      Sigurd Schneider authored
      This reduces the preprocessor expanded source size by 84,675 LoC:
      
      gen         (   20 files):    71,349 to    1,523,934 (   21x)
      src         (  624 files):   367,410 to   53,253,894 (  145x)
      test        (  392 files):   490,503 to   37,436,176 (   76x)
      third_party (  432 files):   239,085 to    9,547,902 (   40x)
      total       ( 1520 files): 1,183,031 to  102,736,424 (   87x)
      
      to
      
      gen         (   20 files):    71,349 to    1,523,794 (   21x)
      src         (  624 files):   367,411 to   53,186,896 (  145x)
      test        (  392 files):   490,504 to   37,418,639 (   76x)
      third_party (  432 files):   239,085 to    9,547,902 (   40x)
      total       ( 1520 files): 1,183,033 to  102,651,749 (   87x)
      
      
      Change-Id: Ia8a79092051a42815b65e86a0784297915368c9b
      Reviewed-on: https://chromium-review.googlesource.com/c/1291471Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58266}
      3ad101f5
  11. 13 Dec, 2018 1 commit
    • Clemens Hammacher's avatar
      [Liftoff] Avoid unneeded CacheState Steal · acc4ed88
      Clemens Hammacher authored
      When finishing a one-armed if, the else state has to be merged into the
      end state. We did this before by switching to the else state, then
      doing the merge. This CL changes this to avoid the switch.
      
      Drive-by: Add a few missing "const" qualifiers. The style guide forbids
      non-const l-value references.
      
      R=titzer@chromium.org
      
      Bug: v8:8423, v8:6600
      Change-Id: Iab2aeca393147fba55493bebabd27bc4d77baa0f
      Reviewed-on: https://chromium-review.googlesource.com/c/1375656Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58222}
      acc4ed88
  12. 12 Dec, 2018 4 commits
  13. 11 Dec, 2018 1 commit
  14. 10 Dec, 2018 2 commits
  15. 04 Dec, 2018 2 commits
    • Clemens Hammacher's avatar
      Reland "[wasm][liftoff] Optimize one-armed ifs" · 7768b245
      Clemens Hammacher authored
      This is a reland of c2aaf0a6
      
      Original change's description:
      > [wasm][liftoff] Optimize one-armed ifs
      > 
      > Do not implement one-armed ifs by emulating an empty else branch. In
      > Liftoff, we can generate better code and save compile time by handling
      > this specially. If the merge point at the end of the if is not reached
      > by the if-branch, we do not need to generate any merge code.
      > 
      > R=titzer@chromium.org
      > 
      > Bug: v8:6600, v8:8423
      > Change-Id: Ie8ea69dd7491f225605a8e1b986d275d869aa90b
      > Reviewed-on: https://chromium-review.googlesource.com/c/1356508
      > Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      > Reviewed-by: Ben Titzer <titzer@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#57968}
      
      Bug: v8:6600, v8:8423
      Change-Id: I6d5eea9f860486768779a33bf6bd7b87cbfc2af0
      Reviewed-on: https://chromium-review.googlesource.com/c/1361040Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58024}
      7768b245
    • Clemens Hammacher's avatar
      Revert "[wasm][liftoff] Optimize one-armed ifs" · 0536ee43
      Clemens Hammacher authored
      This reverts commit c2aaf0a6.
      
      Reason for revert: Benchmarks fail, and ClusterFuzz is not happy (issue 911406, issue 911271)
      
      Original change's description:
      > [wasm][liftoff] Optimize one-armed ifs
      > 
      > Do not implement one-armed ifs by emulating an empty else branch. In
      > Liftoff, we can generate better code and save compile time by handling
      > this specially. If the merge point at the end of the if is not reached
      > by the if-branch, we do not need to generate any merge code.
      > 
      > R=​titzer@chromium.org
      > 
      > Bug: v8:6600, v8:8423
      > Change-Id: Ie8ea69dd7491f225605a8e1b986d275d869aa90b
      > Reviewed-on: https://chromium-review.googlesource.com/c/1356508
      > Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      > Reviewed-by: Ben Titzer <titzer@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#57968}
      
      TBR=titzer@chromium.org,clemensh@chromium.org
      
      # Not skipping CQ checks because original CL landed > 1 day ago.
      
      Bug: v8:6600, v8:8423
      Change-Id: I5cb3b069f40e34f34da4013e666f6ff293752567
      Reviewed-on: https://chromium-review.googlesource.com/c/1360633Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#58012}
      0536ee43
  16. 03 Dec, 2018 2 commits
  17. 30 Nov, 2018 1 commit
    • Clemens Hammacher's avatar
      [wasm][liftoff] Optimize one-armed ifs · c2aaf0a6
      Clemens Hammacher authored
      Do not implement one-armed ifs by emulating an empty else branch. In
      Liftoff, we can generate better code and save compile time by handling
      this specially. If the merge point at the end of the if is not reached
      by the if-branch, we do not need to generate any merge code.
      
      R=titzer@chromium.org
      
      Bug: v8:6600, v8:8423
      Change-Id: Ie8ea69dd7491f225605a8e1b986d275d869aa90b
      Reviewed-on: https://chromium-review.googlesource.com/c/1356508
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#57968}
      c2aaf0a6
  18. 29 Nov, 2018 1 commit
    • Clemens Hammacher's avatar
      [wasm] Pass offset instead of pc to error functions · fd7d6b8b
      Clemens Hammacher authored
      This adds error functions that receive offsets instead of pc, since the
      streaming compiler stores different sections in different buffers, so
      computing pointer differences between different sections does not work.
      We keep the pc-based methods for now to reduce code-churn and
      complexity at the different call sites.
      
      R=ahaas@chromium.org
      CC=binji@chromium.org
      
      Bug: v8:8238
      Change-Id: I1aa68740bdda93c3341431aa7a81ac01ecfb71bb
      Reviewed-on: https://chromium-review.googlesource.com/c/1354463Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#57944}
      fd7d6b8b