1. 02 May, 2022 1 commit
  2. 27 Apr, 2022 1 commit
  3. 09 Mar, 2022 1 commit
    • Camillo Bruni's avatar
      [runtime] Clean up runtime function Arguments accesses · cead6573
      Camillo Bruni authored
      Replace all CONVERT_XXX_ARG_XXX() macros from runtime-util.h with direct
      calls to Arguments or the fully expanded equivalent.
      
      - This replaces many of the hard CHECKs with DCHECK (as is common
        practice in most V8 code)
      - Instead of relying on verbose comments we now have readable code
      - Rename Arguments.::xxx_at with Arguments::xxx_value_at since these
        methods don't return the Object but rather their double/int value
      
      - Add Oddball::ToBool helper
      - Add and use v8::internal::PropertyAttributesFromInt helper
      - Add stronger DCHECK for PropertyAttributes returned in
        GetPropertyAttributesWithInterceptorInternal
      
      
      
      Bug: v8:11263
      Change-Id: I8d531857e05d19f3198753b05af28d993a391854
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497768Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Camillo Bruni <cbruni@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#79418}
      cead6573
  4. 29 Sep, 2021 1 commit
  5. 14 Sep, 2021 1 commit
  6. 22 Jul, 2021 1 commit
  7. 24 Jun, 2021 3 commits
  8. 18 Jun, 2021 1 commit
  9. 14 May, 2021 1 commit
    • Vicky Kontoura's avatar
      [web snapshot] Support RegExp · add69092
      Vicky Kontoura authored
      This CL adds support for regular expressions. To serialize a regular
      expression, the pattern and flags are extracted and serialized as
      strings.
      
      Also, JSRegExp::StringFromFlags() is introduced to allow for
      transforming back from JSRegExp::Flags to the corresponding flag string.
      To verify that this implementation is on par with
      RegExp.prototype.flags, unittests are introduced under
      regexp/regexp-unittest.cc and RegExpBuiltinsAssembler::FlagsGetter()
      is updated to include a slow path that calls JSRegExp::StringFromFlags()
      through a runtime function.
      
      Bug: v8:11525, v8:11706
      Change-Id: I9cad4c464129ba1cbf64672130d8410730d7d679
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2878751
      Commit-Queue: Vicky Kontoura <vkont@google.com>
      Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#74566}
      add69092
  10. 26 Apr, 2021 1 commit
  11. 11 Mar, 2021 1 commit
  12. 11 Feb, 2021 1 commit
    • Jakob Gruber's avatar
      [regexp] Don't update last match info in @@split special case · 51fcfd58
      Jakob Gruber authored
      V8 implements a fast-path for RegExp.prototype.split which diverges
      from the spec: instead of creating a new sticky regexp instance
      `splitter` and running it in a loop, we reuse the existing non-sticky
      regexp without looping through each character.
      
      This works fine in most cases, but we run into issues when matching at
      the very end of the string. According to the spec, matches at the end
      of the string are impossible in @@split, but in our fast-path
      implementation they can happen.
      
      The obvious fix would be to remove our fast-path but this comes with
      high performance costs. The fix implemented in this CL adds a special
      flag to `exec` s.t. matches at the end of the string can be treated as
      failures. This is only relevant for @@split.
      
      Bug: chromium:1075514
      Change-Id: Ifb790ed116793998d7aeb37e307f3f3f764023d3
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2681950
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Auto-Submit: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72644}
      51fcfd58
  13. 26 Jan, 2021 1 commit
  14. 20 Nov, 2020 1 commit
  15. 14 Oct, 2020 1 commit
    • Martin Bidlingmaier's avatar
      [regexp] Use experimental engine if backtrack limit exceeded · d4febb6b
      Martin Bidlingmaier authored
      We fall back from irregexp to the experimental engine if a backtrack
      limit is exceeded and the experimental engine can handle the regexp.
      The feature can be turned on with a boolean flag, and an uint-valued
      flag controls the default backtrack limit.  For regexps that are
      constructed with an explicit backtrack limit (API,
      %NewRegExpWithBacktrackLimit), we choose the lower of the explicit and
      default backtrack limits.
      The default backtrack limit does not apply to regexps that can't be
      handled by the experimental engine, and for such regexps an explicitly
      specified backtrack limit is handled as before by returning null if we
      exceed it.
      
      Cq-Include-Trybots: luci.v8.try:v8_linux64_fyi_rel_ng
      Bug: v8:10765
      Change-Id: I580df79bd847520985b6c2c2159bc427315c89d1
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436341
      Commit-Queue: Martin Bidlingmaier <mbid@google.com>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70500}
      d4febb6b
  16. 23 Sep, 2020 1 commit
    • Martin Bidlingmaier's avatar
      [regexp] Support the msy flags in experimental engine · e6e9cbac
      Martin Bidlingmaier authored
      The m (multiline) and s (dotall) flags just needed to be marked as
      allowed; the required logic was already in the regexp parser.
      
      A regexp /<x>/ without the y (sticky) flag is equivalent to the sticky
      regexp /.*?<x>/y.  The interpreter now assumes that every regexp is
      sticky, and the compiler appends a preamble corresponding to /.*?/
      before non-sticky regexps.  To reuse existing code for compiling this
      preamble, the logic for each kind of quantifier is now in a separate
      function and called from VisitQuantifier and for the preamble.
      
      The commit also includes some improvements/fixes for character ranges:
      - Empty character ranges/disjunctions should never match, but before
        this commit they would *always* match.
      - The check of the range bounds in CanBeHandledVisitor was unncessary;
        without the unicode flag this can't be a range that can't be specified
        in 2-byte codepoints, and once we support unicode we simply support
        all codepoints.
      - The capacity of the list containing the complementary intervals of a
        character range is now calculated more accurately.
      
      Cq-Include-Trybots: luci.v8.try:v8_linux64_fyi_rel_ng
      Bug: v8:10765
      Change-Id: I71a0e07279b4e1140c0ed1651b3714200c801de9
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2404766
      Commit-Queue: Martin Bidlingmaier <mbid@google.com>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#70082}
      e6e9cbac
  17. 16 Sep, 2020 1 commit
    • Martin Bidlingmaier's avatar
      [regexp] Support capture groups in experimental engine · 98b8ca89
      Martin Bidlingmaier authored
      This commit adds support for capture groups (as in e.g. /x(123|abc)y/)
      in the experimental regexp engine.  Now every InterpreterThread owns a
      register array containing (sub)match boundaries. There is a new
      instruction to record the current input index in some register.
      
      Submatches in quantifier bodies should be reported only if they occur
      during the last repetition.  Thus we reset those registers before
      attempting to match the body of a quantifier.  This is implemented with
      another new instruction.
      
      Because of concerns for the growing sizeof the NfaInterpreter object
      (which is allocated on the stack), this commit replaces the
      `SmallVector` members of the NfaInterpreter with zone-allocated arrays.
      Register arrays, which for a fixed regexp are all the same size, are
      allocated with a RecyclingZoneAllocator for cheap memory reclamation via
      a linked list of equally-sized free blocks.
      
      Possible optimizations for management of register array memory:
      1. If there are few register per thread, then it is likely faster to
         store them inline in the InterpreterThread struct.
      2. re2 implements copy-on-write:  InterpreterThreads can share the same
         register array. If a thread attempts to write to shared register
         array, the register array is cloned first.
      3. The register at index 1 contains the end of the match; this is only
         written to right before an ACCEPT statement.  We could make ACCEPT
         equivalent to what's currently CAPTURE 1 followed by ACCEPT.  We
         could then save the memory for register 1 for threads that haven't
         finished yet.  This is particularly interesting if now optimization 1
         kicks in.
      
      Cq-Include-Trybots: luci.v8.try:v8_linux64_fyi_rel_ng
      Bug: v8:10765
      Change-Id: I2c0503206ce331e13ac9912945bb66736d740197
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2390770
      Commit-Queue: Martin Bidlingmaier <mbid@google.com>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69929}
      98b8ca89
  18. 12 May, 2020 1 commit
  19. 21 Apr, 2020 1 commit
    • Jakob Gruber's avatar
      [regexp] Consistent expectations for output registers · fe609139
      Jakob Gruber authored
      ... between the interpreter and generated code.
      
      Prior to this CL, pre- and post conditions on the output register
      array differed between the interpreter and generated code.
      
      Interpreter
      Pre: `output` fits captures and temporary registers.
      Post: None.
      
      Generated code
      Pre:  `output` fits capture registers.
      Post: `output` is modified if and only if the match succeeded.
      
      This CL changes the interpreter to match generated code pre- and
      post conditions by allocating space for temporary registers inside
      the interpreter.
      
      Drive-by: Add MaxRegisterCount, RegistersForCaptureCount helpers.
      
      Bug: chromium:1067270
      Change-Id: I2900ef2f31207d817ec7ead3e0e2215b23b398f0
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2135642
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67268}
      fe609139
  20. 15 Apr, 2020 1 commit
  21. 15 Nov, 2019 1 commit
  22. 30 Oct, 2019 1 commit
    • Jakob Gruber's avatar
      [regexp] Fix invalid DCHECK in named capture logic · 5d5a6595
      Jakob Gruber authored
      The `capture_ix` refers to all captures while `capture_count` only
      refers to named captures. Clarified by renaming `capture_count` to
      `named_capture_count` and removing the incorrect part of the DCHECK.
      
      The `>= 1` part of the condition must still hold since named captures
      can only refer to explicit capture groups, which start at index 1.
      
      Tbr: petermarshall@chromium.org
      Bug: chromium:1018592
      Change-Id: If8a26f6661ba0483d585f74270b3b4a3853e2ca8
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1886810Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Auto-Submit: Jakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#64629}
      5d5a6595
  23. 30 Sep, 2019 1 commit
  24. 22 Aug, 2019 1 commit
  25. 20 Aug, 2019 1 commit
  26. 19 Aug, 2019 2 commits
    • Dominik Inführ's avatar
      Revert "Use list of invalidated objects for old-to-new refs" · 9a9ba762
      Dominik Inführ authored
      This reverts commit 60843b42.
      
      Reason for revert: TSAN detected issue between Scavenge workers.
      One task could invoke RefillFreeList(), while the other task iterates the remembered set of a swept page.
      
      Original change's description:
      > Use list of invalidated objects for old-to-new refs
      > 
      > Instead of inserting "deletion" entries into the store buffer, keep a
      > list of invalidated objects to filter out invalid old-to-new slots.
      > 
      > The first CL https://crrev.com/c/1704109 got reverted because both the
      > sweeper and the main task were modifying the invalidated slots data
      > structure concurrently. This CL changes this, such that the sweeper
      > only modifies the invalidated slots during the final atomic pause when
      > the main thread is not running. The sweeper does not need to clean this
      > data structure after the pause, since the "update pointers" phase
      > already removed all invalidated slots.
      > 
      > The second CL https://crrev.com/c/1733081 got reverted because the
      > sweeper might find more free space than the full GC before it. If an
      > object shrinks after the pause but before the sweep, the invalidated
      > object might span free memory and potentially new allocated objects.
      > Therefore shrink invalidated objects when processing swept pages on
      > the main thread. Also clean recorded slots in the gap.
      > 
      > TBR=petermarshall@chromium.org
      > 
      > Bug: v8:9454
      > Change-Id: I80d1fa3bbc24e97f7c97a373aaad66f105456f12
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1751795
      > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#63239}
      
      TBR=ulan@chromium.org,hpayer@chromium.org,dinfuehr@chromium.org
      
      Change-Id: I9c6a371ebe36a1873acbe0d6c6a75dd2f5a55f4e
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:9454
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1760817Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63253}
      9a9ba762
    • Dominik Inführ's avatar
      Use list of invalidated objects for old-to-new refs · 60843b42
      Dominik Inführ authored
      Instead of inserting "deletion" entries into the store buffer, keep a
      list of invalidated objects to filter out invalid old-to-new slots.
      
      The first CL https://crrev.com/c/1704109 got reverted because both the
      sweeper and the main task were modifying the invalidated slots data
      structure concurrently. This CL changes this, such that the sweeper
      only modifies the invalidated slots during the final atomic pause when
      the main thread is not running. The sweeper does not need to clean this
      data structure after the pause, since the "update pointers" phase
      already removed all invalidated slots.
      
      The second CL https://crrev.com/c/1733081 got reverted because the
      sweeper might find more free space than the full GC before it. If an
      object shrinks after the pause but before the sweep, the invalidated
      object might span free memory and potentially new allocated objects.
      Therefore shrink invalidated objects when processing swept pages on
      the main thread. Also clean recorded slots in the gap.
      
      TBR=petermarshall@chromium.org
      
      Bug: v8:9454
      Change-Id: I80d1fa3bbc24e97f7c97a373aaad66f105456f12
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1751795
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63239}
      60843b42
  27. 12 Aug, 2019 1 commit
  28. 08 Aug, 2019 1 commit
    • Dominik Inführ's avatar
      Revert "Use list of invalidated objects for old-to-new refs" · c9f9d1b0
      Dominik Inführ authored
      This reverts commit e2f98ec2.
      
      Reason for revert: Caused performance regression in ArrayLiteralInitialSpreadSmallHoley.
      
      Original change's description:
      > Use list of invalidated objects for old-to-new refs
      >
      > Instead of inserting "deletion" entries into the store buffer, keep
      > a list of invalidated objects to filter out invalid old-to-new slots.
      >
      > The first CL https://crrev.com/c/1704109 got reverted because both the sweeper and the main task were modifying the invalidated slots data structure concurrently. This CL changes this, such that the sweeper only modifies the invalidated slots during the final atomic pause when the main thread is not running. The sweeper does not need to clean this data structure after the pause, since the "update pointers" phase already removed all invalidated slots.
      >
      > Bug: v8:9454
      > Change-Id: Iffb5bf96de2c89eee1ee1231a3414a0f2a155cbc
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1733081
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Reviewed-by: Peter Marshall <petermarshall@chromium.org>
      > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#63087}
      
      TBR=ulan@chromium.org,petermarshall@chromium.org,dinfuehr@chromium.org
      
      # Not skipping CQ checks because original CL landed > 1 day ago.
      
      Bug: v8:9454
      Change-Id: I328b9f72df45fc9570d4a4d1b5389eac010638c7
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1743970
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63131}
      c9f9d1b0
  29. 06 Aug, 2019 1 commit
  30. 16 Jul, 2019 2 commits
  31. 26 Jun, 2019 1 commit
  32. 18 Jun, 2019 1 commit
  33. 17 Jun, 2019 1 commit
    • Jakob Gruber's avatar
      [regexp] Reduce public API surface · c7d57dd3
      Jakob Gruber authored
      This further reduces the number of things declared in the public
      regexp API file, currently still named jsregexp.h.
      
      * Move JSRegExp::Flags convenience functions to regexp-compiler.h.
      * Set RegExpImpl methods private if possible (these will later be
        moved to a new hidden impl class).
      * Merge RegExpEngine::CompilationResult into RegExpCompileData.
      * Move remaining RegExpEngine methods to RegExpImpl and delete
        RegExpEngine.
      * Extract RegExpGlobalCache.
      * Document a few data structures.
      
      Upcoming CLs will rename RegExpImpl to RegExp and jsregexp.h to
      regexp.h. This should then be the only header included from other
      directories.
      
      Bug: v8:9359
      Change-Id: I78c8f4cca495a2b95735a48b6181583bc3310bdf
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1662294Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#62218}
      c7d57dd3
  34. 23 May, 2019 1 commit
  35. 22 May, 2019 1 commit
  36. 21 May, 2019 1 commit