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

Improve performance of catchException combinator

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 8
    • core-libs
    • None
    • b04
    • generic
    • generic

        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).

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

                Created:
                Updated:
                Resolved: