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

Improve performance of catchException combinator

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b04
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        We're currently working on an OSR (on stack replacement) compilation framework for Nashorn. We're compiling functions to bytecode with optimistic assumptions, and when they're invalidated during execution, we jump out of the function, recompile it without the invalidated optimistic assumption, and then resume it.

        (The mechanism of resumption is not important for the purposes of discussion here).

        The "jump out of the function" part is important though, and we can only implement it by throwing an exception in the executing method, and by linking all such methods using a catchException combinator which does the recompilation/resume magic in its exception handler.

        However, since all of our optimistically compiled functions are linked using catchException, we absolutely need it to be fast, so we need some fast, non-boxing hot paths for it.

        Optimistic compilation gets most performance when we can force all arguments to be ints, so an educated guess is that Nashorn would benefit most from hot paths of the form (Object, int, int, ..., int) and (Object, Object, int, int, ..., int) (first one or two object arguments are either "this", or "callee, this" in Nashorn's case).

          Attachments

          1. 8027827.catchException.custom.patch
            14 kB
            Vladimir Ivanov
          2. 8027827.catchException.shared_arities.patch
            14 kB
            Vladimir Ivanov
          3. CatchException.java
            18 kB
            Vladimir Ivanov

            Issue Links

              Activity

                People

                • Assignee:
                  vlivanov Vladimir Ivanov
                  Reporter:
                  attila Attila Szegedi
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: