Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8274983: C1 optimizes the invocation of private interface methods #6445

Closed
wants to merge 6 commits into from

Commits on Nov 18, 2021

  1. 8274983: Pattern.matcher performance regression after JDK-823835

    This patch allows c1 to generate the optimized virtual call for invokeinterface
    whose targets are the private interface methods.
    
    Before JDK-823835, LambdaMetaFactory generates invokespecial in this case. Because the private
    interface methods can not be overrided, c1 generates the optimized virtual call. After JDK-823835,
    LambdaMetaFactory generates invokeinterface instead. C1 generates the regular virtual call because
    it can not recognize the new pattern. If a multiple of subclasses all implement a same interface,
    it is possible that they trash the IC stub using their own concrete klass in runtime.
    
    Optimized virtual call uses relocInfo::opt_virtual_call_type(3), It will call VM
    'resolve_opt_virtual_call_C' once and resolve the target to the VEP of the nmethod.
    Therefore, this patch can prevent the callsite from trashing.
    Xin Liu committed Nov 18, 2021
    Configuration menu
    Copy the full SHA
    5a00e1f View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2021

  1. Merge branch 'master' into JDK-8274983

    Xin Liu committed Nov 24, 2021
    Configuration menu
    Copy the full SHA
    4ab4e3a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    acf7b9f View commit details
    Browse the repository at this point in the history
  3. Call set_invokespecial_receiver_check() so invokespecial throws Illeg…

    …alAccessError.
    
    We need to checkcast for invokespecial even target->can_be_statically_bound() is false.
    eg. https://github.com/openjdk/jdk/blob/master/test/jdk/java/lang/invoke/SpecialInterfaceCallI4.jasm#L33
    Xin Liu committed Nov 24, 2021
    Configuration menu
    Copy the full SHA
    6a10e77 View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2021

  1. Add a microbenchmark for the case.

    Xin Liu committed Nov 29, 2021
    Configuration menu
    Copy the full SHA
    56133c5 View commit details
    Browse the repository at this point in the history
  2. Fix the whitespace issue of the microbenchmark.

    Xin Liu committed Nov 29, 2021
    Configuration menu
    Copy the full SHA
    01e48da View commit details
    Browse the repository at this point in the history