1. 20 Oct, 2021 1 commit
    • Milad Fa's avatar
      PPC/s390: [regexp] Compact codegen for large character classes · 841d33a5
      Milad Fa authored
      Port 8bbb44e5
      
      Original Commit Message:
      
          Large character classes may easily be created when unicode
          properties (e.g.: /\p{L}/u and /\P{L}/u) are used - these are
          expanded internally into character classes that consist of hundreds
          of character ranges. Previously to this CL, we'd emit branching code
          for each of these ranges, leading to very large regexp code objects.
      
          This CL adds a new codegen mode for large character classes (where
          'large' currently means > 16 ranges). Instead of emitting branching
          code inline, the ranges are written into a ByteArray and we call into
          the C function IsCharacterInRangeArray for the actual branching logic.
          The ByteArray is smaller than emitted code and is deduplicated if the
          same character class is matched repeatedly in the same pattern.
      
          Note this mode is *not* implemented for the interpreter, since we
          currently don't have a constant pool for irregexp bytecode, and thus
          cannot reference ByteArrays.
      
      R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
      BUG=
      LOG=N
      
      Change-Id: I2ded01fa2767e56e72be81b949eefb5fb85b7013
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3231981Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
      Commit-Queue: Milad Fa <mfarazma@redhat.com>
      Cr-Commit-Position: refs/heads/main@{#77473}
      841d33a5
  2. 12 Oct, 2021 1 commit
  3. 06 Oct, 2021 1 commit
  4. 30 Sep, 2021 1 commit
    • Milad Fa's avatar
      PPC/s390: [regexp] Fix stack growth for global regexps · 9227a8da
      Milad Fa authored
      Port 3e3a027d
      
      Original Commit Message:
      
          Irregexp reentrancy (crrev.com/c/3162604) introduced a bug for global
          regexp execution in which each iteration would use a new stack region
          (i.e. we forgot to pop the regexp stack pointer when starting a new
          iteration).
      
          This CL fixes that by popping the stack pointer on the loop backedge.
      
          At a high level:
      
          - Initialize the backtrack_stackpointer earlier and avoid clobbering
            it by setup code.
          - Pop it on the loop backedge.
          - Slightly refactor Push/Pop operations to avoid unneeded memory
            accesses.
      
      R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
      BUG=
      LOG=N
      
      Change-Id: Iafe6814d3695e83fced6a46209accf5e712d56f6
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3198391Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
      Commit-Queue: Milad Fa <mfarazma@redhat.com>
      Cr-Commit-Position: refs/heads/main@{#77180}
      9227a8da
  5. 27 Sep, 2021 1 commit
  6. 24 Sep, 2021 1 commit
  7. 23 Sep, 2021 1 commit
    • Milad Fa's avatar
      PPC/s390 [regexp]: Allow reentrant irregexp execution · 5d3f17f4
      Milad Fa authored
      Port: bba7c09a
      
      Original Commit Message:
       .. by reusing the regexp stack from potentially multiple nested
       irregexp activations.
      
       To do this, we now maintain a stack pointer in RegExpStack. This stack
       pointer is synchronized at all boundaries between generated irregexp
       code and the outside world, i.e. when entering or returning from
       irregexp code, and when calling into C functions such as GrowStack.
      
      Fixed: v8:11382
      Change-Id: I0f97363a069c65f4fbe081b2f9fa796f9d950f43
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3179030Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
      Commit-Queue: Milad Fa <mfarazma@redhat.com>
      Cr-Commit-Position: refs/heads/main@{#77023}
      5d3f17f4
  8. 24 Jun, 2021 3 commits
  9. 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
  10. 03 Jun, 2020 1 commit
  11. 28 Apr, 2020 1 commit
  12. 21 Apr, 2020 1 commit
    • Iain Ireland's avatar
      [regexp] Hoist LoadCurrentCharacterImpl · 4536bb2e
      Iain Ireland authored
      LoadCurrentCharacterImpl is implemented once in each of the eight
      regexp-macro-assembler-<arch>.cc files. Aside from small differences
      in comment wording, those eight implementations are identical. The
      architecture-specific code for LoadCurrentCharacter is all in
      LoadCurrentCharacterUnchecked.
      
      This patch hoists the definition of LoadCurrentCharacterImpl into
      NativeRegExpMacroAssembler and turns LoadCurrentCharacterUnchecked
      into a virtual function.
      
      Note: The arm64 version of LoadCurrentCharacterImpl contained the
      following six-year-old comment, which I don't think is worth
      preserving:
      
      // TODO(pielan): Make sure long strings are caught before this, and
      // not just asserted in debug mode.
      
      R=jgruber@chromium.org
      
      Bug: v8:10406
      Change-Id: Ic81283ad3b618d6b06f4206fb77d30de617dccb7
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2140003
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67260}
      4536bb2e
  13. 02 Mar, 2020 1 commit
  14. 28 Feb, 2020 1 commit
  15. 27 Feb, 2020 1 commit
  16. 22 Oct, 2019 1 commit
  17. 29 Aug, 2019 1 commit
  18. 25 Jul, 2019 1 commit
    • Seth Brenith's avatar
      [regexp] Use stricter bounds check to avoid additional iteration · f42b1a5d
      Seth Brenith authored
      The motivating example is JetStream 2's UniPoker test, which tests
      whether a sorted string of Unicode playing cards contains a five-card
      straight using a regular expression. In the top-level generated loop for
      this RegExp, we see this loop exit condition:
      
      00000350000C2067    27  83fffe         cmpl rdi,0xfe
      00000350000C206A    2a  0f8da8e40000   jge 00000350000D0518  <+0xe4d8>
      
      Meaning if the current position is pointing at the very last (16-bit)
      character, then we exit the loop. Otherwise we go on and try to find
      various matches starting at the current position. However, we can see
      in the original expression that any possible match is at least 10
      characters (5 astral-plane Unicode values), so we're wasting a lot of
      time attempting to find matches in cases where we're too close to the
      end of the string for any match to succeed.
      
      This example might be a bit contrived, but I expect that an improvement
      in this bounds check would help a larger family of regular expressions,
      where the minimum match length is large relative to the string being
      matched and we don't meet the other necessary criteria for fast Boyer-
      Moore lookahead.
      
      To get the desired bounds check in this case, this patch does the
      following:
      1. Compute accurate EatsAtLeast values for every node during the
         analysis phase. This could end up doing more work than the current
         implementation, but analysis already has to touch every node, so it
         seems like a cache-friendly time to compute these values. In some
         cases, this might be less total work than the current implementation,
         because the current implementation might recompute the same node
         multiple times.
      2. When emitting a quick check, use the EatsAtLeast value from the
         predecessor ChoiceNode for the bounds check.
      
      This improves the UniPoker score on my machine by about 4%, because it
      cuts the time spent checking for straights roughly in half, and checking
      for straights originally accounted for about 8% of the total time.
      
      Bug: v8:9305
      Change-Id: I110b190c2578f73b2263259d5aa5750e921b01be
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1702125
      Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#62919}
      f42b1a5d
  19. 28 May, 2019 1 commit
  20. 21 May, 2019 1 commit
  21. 02 Apr, 2019 1 commit
  22. 23 Jan, 2019 1 commit
  23. 17 Jan, 2019 1 commit
    • Junliang Yan's avatar
      PPC/s390: Use forwarding constructors for MacroAssembler · 30617b77
      Junliang Yan authored
      Port edab9a20
      
      Original Commit Message:
      
          and TurboAssembler. Instead of listing all the different combinations
          of arguments (which is one more now, temporarily), just forward all
          arguments down via MacroAssembler and TurboAssembler to
          TurboAssemblerBase.
          Interestingly, this requires more specific types sometimes (int instead
          of size_t), since further down the forwarding chain, the compiler does
          not recognize any more that the value is a constant, and emits a
          warning about a possibly truncating implicit conversion.
      
      R=clemensh@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com
      BUG=
      LOG=N
      
      Change-Id: I6dddc58b81d020570087393158f4ad0f37efa9ce
      Reviewed-on: https://chromium-review.googlesource.com/c/1417379Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
      Cr-Commit-Position: refs/heads/master@{#58889}
      30617b77
  24. 12 Nov, 2018 1 commit
  25. 13 Oct, 2017 1 commit
  26. 03 Aug, 2017 1 commit
  27. 21 Apr, 2017 5 commits
  28. 18 Aug, 2016 1 commit
  29. 27 Jan, 2016 1 commit
  30. 17 Nov, 2015 1 commit
  31. 30 Sep, 2015 1 commit
  32. 26 Aug, 2015 1 commit
  33. 13 Aug, 2015 1 commit
  34. 12 Aug, 2015 1 commit