1. 11 Apr, 2022 1 commit
    • Jakob Gruber's avatar
      Reland "[osr] Add an install-by-offset mechanism" · b8473c52
      Jakob Gruber authored
      This is a reland of commit 51b99213
      
      Fixed in reland:
      - bytecode_age was incorrectly still accessed as an int8 (instead
        of int16).
      - age and osr state were incorrectly reset on ia32 (16-bit write
        instead of 32-bit).
      
      Original change's description:
      > [osr] Add an install-by-offset mechanism
      >
      > .. for concurrent OSR. There, the challenge is to hit the correct
      > JumpLoop bytecode once compilation completes, since execution has
      > moved on in the meantime.
      >
      > This CL adds a new mechanism to request installation at a specific
      > bytecode offset. We add a new `osr_install_target` field to the
      > BytecodeArray:
      >
      >   bitfield struct OSRUrgencyAndInstallTarget extends uint16 {
      >     osr_urgency: uint32: 3 bit;
      >     osr_install_target: uint32: 13 bit;
      >   }
      >
      >   // [...]
      >   osr_urgency_and_install_target: OSRUrgencyAndInstallTarget;
      >   bytecode_age: uint16;  // Only 3 bits used.
      >   // [...]
      >
      > Note urgency and install target are packed into one 16 bit field,
      > we can thus merge both checks into one comparison within JumpLoop.
      > Note also that these fields are adjacent to the bytecode age; we
      > still reset both OSR state and age with a single (now 32-bit)
      > store.
      >
      > The install target is the lowest 13 bits of the bytecode offset.
      > When set, every reached JumpLoop will check `is this my offset?`,
      > and if yes, jump into runtime to tier up.
      >
      > Drive-by: Rename BaselineAssembler::LoadByteField to LoadWord8Field.
      >
      > Bug: v8:12161
      > Change-Id: I275d468b19df3a4816392a2fec0713a8d211ef80
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571812
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Commit-Queue: Jakob Linke <jgruber@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#79853}
      
      Bug: v8:12161
      Change-Id: I7c59b2a2aacb1d7d40fdf39396ec9d8d48b0b9ac
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3578543Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Jakob Linke <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#79911}
      b8473c52
  2. 08 Apr, 2022 1 commit
  3. 07 Apr, 2022 2 commits
    • Leszek Swirski's avatar
      Revert "[osr] Add an install-by-offset mechanism" · bb5cc0d5
      Leszek Swirski authored
      This reverts commit 51b99213.
      
      Reason for revert: Speculative revert for MSAN failure  https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/43080/overview
      
      Original change's description:
      > [osr] Add an install-by-offset mechanism
      >
      > .. for concurrent OSR. There, the challenge is to hit the correct
      > JumpLoop bytecode once compilation completes, since execution has
      > moved on in the meantime.
      >
      > This CL adds a new mechanism to request installation at a specific
      > bytecode offset. We add a new `osr_install_target` field to the
      > BytecodeArray:
      >
      >   bitfield struct OSRUrgencyAndInstallTarget extends uint16 {
      >     osr_urgency: uint32: 3 bit;
      >     osr_install_target: uint32: 13 bit;
      >   }
      >
      >   // [...]
      >   osr_urgency_and_install_target: OSRUrgencyAndInstallTarget;
      >   bytecode_age: uint16;  // Only 3 bits used.
      >   // [...]
      >
      > Note urgency and install target are packed into one 16 bit field,
      > we can thus merge both checks into one comparison within JumpLoop.
      > Note also that these fields are adjacent to the bytecode age; we
      > still reset both OSR state and age with a single (now 32-bit)
      > store.
      >
      > The install target is the lowest 13 bits of the bytecode offset.
      > When set, every reached JumpLoop will check `is this my offset?`,
      > and if yes, jump into runtime to tier up.
      >
      > Drive-by: Rename BaselineAssembler::LoadByteField to LoadWord8Field.
      >
      > Bug: v8:12161
      > Change-Id: I275d468b19df3a4816392a2fec0713a8d211ef80
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571812
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Commit-Queue: Jakob Linke <jgruber@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#79853}
      
      Bug: v8:12161
      Change-Id: I0c47499544465c80b5b23a492c00ec1c62815caa
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576121
      Auto-Submit: Leszek Swirski <leszeks@chromium.org>
      Owners-Override: Leszek Swirski <leszeks@chromium.org>
      Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Cr-Commit-Position: refs/heads/main@{#79855}
      bb5cc0d5
    • Jakob Gruber's avatar
      [osr] Add an install-by-offset mechanism · 51b99213
      Jakob Gruber authored
      .. for concurrent OSR. There, the challenge is to hit the correct
      JumpLoop bytecode once compilation completes, since execution has
      moved on in the meantime.
      
      This CL adds a new mechanism to request installation at a specific
      bytecode offset. We add a new `osr_install_target` field to the
      BytecodeArray:
      
        bitfield struct OSRUrgencyAndInstallTarget extends uint16 {
          osr_urgency: uint32: 3 bit;
          osr_install_target: uint32: 13 bit;
        }
      
        // [...]
        osr_urgency_and_install_target: OSRUrgencyAndInstallTarget;
        bytecode_age: uint16;  // Only 3 bits used.
        // [...]
      
      Note urgency and install target are packed into one 16 bit field,
      we can thus merge both checks into one comparison within JumpLoop.
      Note also that these fields are adjacent to the bytecode age; we
      still reset both OSR state and age with a single (now 32-bit)
      store.
      
      The install target is the lowest 13 bits of the bytecode offset.
      When set, every reached JumpLoop will check `is this my offset?`,
      and if yes, jump into runtime to tier up.
      
      Drive-by: Rename BaselineAssembler::LoadByteField to LoadWord8Field.
      
      Bug: v8:12161
      Change-Id: I275d468b19df3a4816392a2fec0713a8d211ef80
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571812Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Jakob Linke <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#79853}
      51b99213
  4. 06 Apr, 2022 1 commit
  5. 04 Apr, 2022 5 commits
    • Jakob Gruber's avatar
      [compiler] Remove ContinuationForConcurrentOptimization · 5f3ed078
      Jakob Gruber authored
      .. to simplify logic within compiler.cc. GetOrCompileOptimized now only
      returns Code object if the requested optimized Code object is available.
      
      This change also required updating CompileLazy to install the
      appropriate Code object before potentially calling CompileOptimized_*
      runtime functions in order to satisfy the is_compiled precondition.
      
      Bug: v8:12161
      Change-Id: I991dbcc0ba8f3d635aa1e1f06e4cffd89e08a47b
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3562978Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Jakob Linke <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#79762}
      5f3ed078
    • Jakob Gruber's avatar
      [osr] Fall back to synchronous OSR on cache mismatches · 3f5a3df6
      Jakob Gruber authored
      If we've already cached OSR'd code for the current function but with a
      different osr offset, fall back to synchronous compilation. This avoids
      degenerate cases where we repeatedly spawn OSR jobs but then fail to
      install them.
      
      Drive-by: More consistent --trace-osr output.
      Drive-by: Rename kCompileForOnStackReplacement to kCompileOptimizeOSR
      for name consistency.
      Drive-by: Add JSFunction::DebugNameCStr() for more convenient PrintF's.
      
      Bug: v8:12161
      Change-Id: I2b4a65bc9e082d85d7048a3e92ef86b07d396687
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3560431Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Jakob Linke <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#79761}
      3f5a3df6
    • Jakob Gruber's avatar
      Reland "Refactor OSROptimizedCodeCache" · e35d7e61
      Jakob Gruber authored
      Tweak a few names, remove a few GetIsolate calls, other minor
      usability refactors.
      
      It may be worth taking a closer look at the impl in the future,
      currently the design choices don't seem ideal (see the added TODO
      on top of the class).
      
      The reland is unchanged from the original CL.
      
      Bug: v8:12161
      Change-Id: I9971f7f2fb08b7a1ec2d57b2a0e4accdc11191ca
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3568444Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Jakob Linke <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#79759}
      e35d7e61
    • Jakob Gruber's avatar
      Reland "Address comments from `[osr] Basic support for concurrent OSR`" · 66f8f20a
      Jakob Gruber authored
      - Unhandlify OSROptimizedCodeCache::GetOptimizedCode.
      - Unstatic-fy FeedbackVector::SetOptimizedCode.
      - Remove frame-walking logic during the OSR tierup decision.
      
      The reland is unchanged from the original CL.
      
      Bug: v8:12161
      Change-Id: Ibf03a9dd9a6fcd38c0664e5d5014a26d0240e035
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3568463Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Jakob Linke <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#79752}
      66f8f20a
    • Jakob Gruber's avatar
      Reland "[osr] Basic support for concurrent OSR" · d187c6c2
      Jakob Gruber authored
      This is a reland of commit 3ce690ee
      
      Changed for the reland:
      - Remove the currently-unused BytecodeArray member to avoid MSAN
        failures.
      - s/return/continue/ in optimizing-compile-dispatcher.
      
      Original change's description:
      > [osr] Basic support for concurrent OSR
      >
      > This CL adds basic support behind --concurrent-osr,
      > disabled by default.
      >
      > When enabled:
      > 1) the first OSR request starts a concurrent OSR compile job.
      > 2) on completion, the code object is inserted into the OSR cache.
      > 3) the next OSR request picks up the cached code (assuming the request
      >    came from the same JumpLoop bytecode).
      >
      > We add a new osr optimization marker on the feedback vector to
      > track whether an OSR compile is currently in progress.
      >
      > One fundamental issue remains: step 3) above is not guaranteed to
      > hit the same JumpLoop, and a mismatch means the OSR'd code cannot
      > be installed. This will be addressed in a followup by targeting
      > specific bytecode offsets for the install request.
      >
      > This change is based on fanchen.kong@intel.com's earlier
      > change crrev.com/c/3369361, thank you!
      >
      > Bug: v8:12161
      > Change-Id: Ib162906dd4b6ba056f62870aea2990f1369df235
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3548820
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Commit-Queue: Jakob Linke <jgruber@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#79685}
      
      Bug: v8:12161
      Change-Id: I48b100e5980c909ec5e79d190aaea730c83e9386
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3565720Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Jakob Linke <jgruber@chromium.org>
      Auto-Submit: Jakob Linke <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#79746}
      d187c6c2
  6. 01 Apr, 2022 3 commits
    • Adam Klein's avatar
      Revert "[osr] Basic support for concurrent OSR" · 32f28553
      Adam Klein authored
      This reverts commit 3ce690ee.
      
      Reason for revert: failures on CrOS MSan build: https://crbug.com/1312188
      
      Original change's description:
      > [osr] Basic support for concurrent OSR
      >
      > This CL adds basic support behind --concurrent-osr,
      > disabled by default.
      >
      > When enabled:
      > 1) the first OSR request starts a concurrent OSR compile job.
      > 2) on completion, the code object is inserted into the OSR cache.
      > 3) the next OSR request picks up the cached code (assuming the request
      >    came from the same JumpLoop bytecode).
      >
      > We add a new osr optimization marker on the feedback vector to
      > track whether an OSR compile is currently in progress.
      >
      > One fundamental issue remains: step 3) above is not guaranteed to
      > hit the same JumpLoop, and a mismatch means the OSR'd code cannot
      > be installed. This will be addressed in a followup by targeting
      > specific bytecode offsets for the install request.
      >
      > This change is based on fanchen.kong@intel.com's earlier
      > change crrev.com/c/3369361, thank you!
      >
      > Bug: v8:12161
      > Change-Id: Ib162906dd4b6ba056f62870aea2990f1369df235
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3548820
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Commit-Queue: Jakob Linke <jgruber@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#79685}
      
      Bug: v8:12161, chromium:1312188
      Change-Id: Iac1e3fd67ecc658a1cdee8f4d13354c097ed6697
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3564983
      Auto-Submit: Adam Klein <adamk@chromium.org>
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Commit-Queue: Adam Klein <adamk@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#79702}
      32f28553
    • Adam Klein's avatar
      Revert "Address comments from `[osr] Basic support for concurrent OSR`" · ef83c9e8
      Adam Klein authored
      This reverts commit dc9b48e4.
      
      Reason for revert: https://crbug.com/1312188
      
      Original change's description:
      > Address comments from `[osr] Basic support for concurrent OSR`
      >
      > - Unhandlify OSROptimizedCodeCache::GetOptimizedCode.
      > - Unstatic-fy FeedbackVector::SetOptimizedCode.
      > - Remove frame-walking logic during the OSR tierup decision.
      >
      > Bug: v8:12161
      > Change-Id: I4fa8c972cb50d369b17898ba57e1909c86e933df
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3560478
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Commit-Queue: Jakob Linke <jgruber@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#79686}
      
      Bug: v8:12161, chromium:1312188
      Change-Id: Ia64c4204f9f65f19aa858c61f32658cee310033e
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3564990
      Auto-Submit: Adam Klein <adamk@chromium.org>
      Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Cr-Commit-Position: refs/heads/main@{#79701}
      ef83c9e8
    • Adam Klein's avatar
      Revert "Refactor OSROptimizedCodeCache" · b591fccb
      Adam Klein authored
      This reverts commit d368dcf4.
      
      Reason for revert: https://crbug.com/1312188
      
      Original change's description:
      > Refactor OSROptimizedCodeCache
      >
      > Tweak a few names, remove a few GetIsolate calls, other minor
      > usability refactors.
      >
      > It may be worth taking a closer look at the impl in the future,
      > currently the design choices don't seem ideal (see the added TODO
      > on top of the class).
      >
      > Bug: v8:12161
      > Change-Id: Ib34e372aa58a30c68c9c5cdd0d1da0ec3e86717c
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3560447
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Commit-Queue: Jakob Linke <jgruber@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#79687}
      
      Bug: v8:12161, chromium:1312188
      Change-Id: Ieb3a91682845a23536fdfdf3208af74b3c6585f8
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3564989
      Auto-Submit: Adam Klein <adamk@chromium.org>
      Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Cr-Commit-Position: refs/heads/main@{#79700}
      b591fccb
  7. 31 Mar, 2022 3 commits
    • Jakob Gruber's avatar
      Refactor OSROptimizedCodeCache · d368dcf4
      Jakob Gruber authored
      Tweak a few names, remove a few GetIsolate calls, other minor
      usability refactors.
      
      It may be worth taking a closer look at the impl in the future,
      currently the design choices don't seem ideal (see the added TODO
      on top of the class).
      
      Bug: v8:12161
      Change-Id: Ib34e372aa58a30c68c9c5cdd0d1da0ec3e86717c
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3560447Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Jakob Linke <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#79687}
      d368dcf4
    • Jakob Gruber's avatar
      Address comments from `[osr] Basic support for concurrent OSR` · dc9b48e4
      Jakob Gruber authored
      - Unhandlify OSROptimizedCodeCache::GetOptimizedCode.
      - Unstatic-fy FeedbackVector::SetOptimizedCode.
      - Remove frame-walking logic during the OSR tierup decision.
      
      Bug: v8:12161
      Change-Id: I4fa8c972cb50d369b17898ba57e1909c86e933df
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3560478Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Jakob Linke <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#79686}
      dc9b48e4
    • Jakob Gruber's avatar
      [osr] Basic support for concurrent OSR · 3ce690ee
      Jakob Gruber authored
      This CL adds basic support behind --concurrent-osr,
      disabled by default.
      
      When enabled:
      1) the first OSR request starts a concurrent OSR compile job.
      2) on completion, the code object is inserted into the OSR cache.
      3) the next OSR request picks up the cached code (assuming the request
         came from the same JumpLoop bytecode).
      
      We add a new osr optimization marker on the feedback vector to
      track whether an OSR compile is currently in progress.
      
      One fundamental issue remains: step 3) above is not guaranteed to
      hit the same JumpLoop, and a mismatch means the OSR'd code cannot
      be installed. This will be addressed in a followup by targeting
      specific bytecode offsets for the install request.
      
      This change is based on fanchen.kong@intel.com's earlier
      change crrev.com/c/3369361, thank you!
      
      Bug: v8:12161
      Change-Id: Ib162906dd4b6ba056f62870aea2990f1369df235
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3548820Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Jakob Linke <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#79685}
      3ce690ee
  8. 30 Mar, 2022 2 commits
  9. 23 Mar, 2022 1 commit
  10. 18 Mar, 2022 1 commit
  11. 17 Mar, 2022 2 commits
  12. 16 Mar, 2022 1 commit
  13. 02 Mar, 2022 1 commit
  14. 01 Mar, 2022 1 commit
    • Jakob Gruber's avatar
      Refactor tiering-related JSFunction methods · aad3e727
      Jakob Gruber authored
      - Add the Isolate as an explicit param (we already have it at all
        callsites)
      - Pass an explicit CodeKind param to MarkForOptimization in preparation
        for Maglev.
      - Split EnsureFeedbackVector into that, plus
        CreateAndAttachFeedbackVector for when we know it has to be created.
      
      Bug: v8:7700
      Change-Id: Ie9022deccd31d472d6df3d442b25583af5569ab0
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497383
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Auto-Submit: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#79318}
      aad3e727
  15. 24 Feb, 2022 1 commit
  16. 21 Feb, 2022 2 commits
  17. 16 Feb, 2022 1 commit
  18. 15 Feb, 2022 2 commits
  19. 05 Feb, 2022 1 commit
  20. 27 Jan, 2022 1 commit
  21. 20 Jan, 2022 1 commit
  22. 17 Jan, 2022 1 commit
  23. 16 Dec, 2021 2 commits
  24. 14 Dec, 2021 2 commits
  25. 10 Dec, 2021 1 commit