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

Conflict inlining decisions by C1/C2 with the same CompileCommand

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 18
    • 17, 18
    • hotspot
    • b07

      ```
      class TestInline {
          static int sum;

          public static int caller(int a , int b) {
            return a + b;
          }

          public static void main(String[] args) {
              for (int i = 0; i < 1000; i++) {
                  for (int j = 0; j < 1000; j++) {
                      sum += caller(i, 0);
                  }
              }
          }
      }
      ```

      Run the above program with
      ```
         -XX:+PrintCompilation \
         -XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining \
         -XX:CompileCommand=quiet \
         -XX:CompileCommand=inline,TestInline::caller \
         -XX:CompileCommand=dontinline,TestInline::caller \
         -XX:CompileCommand=compileonly,TestInline::main \
      ```

      Then we get
      ```
           28 1 % 3 TestInline::main @ 11 (43 bytes)
                                    @ 23 TestInline::caller (4 bytes) disallowed by CompileCommand
           29 2 3 TestInline::main (43 bytes)
                                    @ 23 TestInline::caller (4 bytes) disallowed by CompileCommand
           31 3 % 4 TestInline::main @ 11 (43 bytes)
           33 1 % 3 TestInline::main @ 11 (43 bytes) made not entrant
                                    @ 23 TestInline::caller (4 bytes) force inline by CompileCommand
      ```

      It shows that inlining of TestInline::caller is disallowed by C1 but force-inlined by C2, which are conflict inlining decisions of C1/C2.

            jiefu Jie Fu
            jiefu Jie Fu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: