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

[leyden] Fix klass dependency recording

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • repo-leyden
    • repo-leyden
    • hotspot
    • None

      I was following up on Leyden performance regression, which readily manifests on javac:

      Benchmark 1: build/linux-x86_64-server-release/images/jdk/bin/java -Xms64m -Xmx1g -XX:+UseSerialGC -cp JavacBenchApp.jar -XX:AOTCache=app.aot JavacBenchApp 50

      # premain
        Time (mean ± σ): 567.5 ms ± 16.5 ms [User: 1757.1 ms, System: 149.9 ms]
        Range (min ... max): 547.0 ms ... 599.3 ms 10 runs
        
      # 506af854234ed9eeec5543e60f2a0d41b73bc93d
       Time (mean ± σ): 331.7 ms ± 2.3 ms [User: 660.7 ms, System: 104.6 ms]
        Range (min ... max): 328.4 ms ... 335.2 ms 10 runs

      I finally was able to bisect this to:
      https://github.com/openjdk/leyden/commit/7b7648a4c9f67be509c6fccbcbc0502648388fdc

      commit 7b7648a4c9f67be509c6fccbcbc0502648388fdc
      Author: Vladimir Kozlov <vladimir.kozlov@oracle.com>
      Date: Wed Aug 6 11:09:53 2025 -0700
      Summary: Fix not initialized klass use in AOT code

      That change effectively changed the code that was "always" trusting that AOT classes are initialized with the actual dependency checks. But that exposes a problem in dependency recording now: we are apparently missing quite a few dependencies, so AP4 -> A4 transition seems to happen prematurely, and then A4 often traps.

      This looks to be the root cause for the issue that JDK-8366681 mitigates.

      I have a fix in CI that fixes dependency recording, and restores the performance back.

            shade Aleksey Shipilev
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: