Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8262994

Refactor String.split to help method inlining

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • None
    • core-libs
    • None
    • b08

      The method String.split contains a fast-path when the regular expression parameter is not really a regular expression, but just a single split character.
      This fast path vs. slow path check can be constant folded when the regular expression parameter is a literal constant - a quite frequent pattern (for example, all usages of String.split have a constant expression parameter). But method inlining in JIT and AOT compilers can usually not inline String.split because the method body is too large. Factoring out the actual fast-path splitting logic into a separate method solves this problem: the JIT or AOT compiler can inline String.split, constant-fold the fast/slow path check, and then only the invoke of either the fast path or the slow path remains.

            cwimmer Christian Wimmer (Inactive)
            cwimmer Christian Wimmer (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: