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

Can't inline a monomorphic call site when using default (package) visibility

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 6
    • 6
    • hotspot
    • None
    • b53
    • 6
    • b79
    • generic
    • generic

      Can't inline a monomorphic call site when using default (package) visibility.

      Reported on forum thread:
          http://forums.java.net/jive/thread.jspa?threadID=13130&tstart=0

      The call to B.getx() is not inlined using 6.0 but is inlined using 5.0.
      class A {
        int x;
        int getx() { return x; }
      }
      class B extends A {
        int y;
      }

      The call to "protected" E.getx() is inlined using both 6.0 and 5.0.
      class D {
        int x;
        protected int getx() { return x; }
      }
      class E extends D {
        int y;
      }

      > /export/jdk/5.0/jdk1.5.0_06/bin/java_g -XX:CompileOnly=Kiwi.runfast -XX:CompileOnly=Kiwi.runslow -XX:+PrintCompilation -XX:+PrintInlining Kiwi
      VM option 'CompileOnly=Kiwi.runfast'
      VM option 'CompileOnly=Kiwi.runslow'
      VM option '+PrintCompilation'
      VM option '+PrintInlining'
        1% Kiwi::runslow @ 4 (24 bytes)
            @ 11 A::getx inline (hot)
        2% Kiwi::runfast @ 4 (24 bytes)
            @ 11 D::getx inline (hot)
      Warmup done. Runninng...
      B.getx 85ms
      E.getx 84ms

      > /export/jdk/6.0/jdk1.6.0/fastdebug/bin/java -XX:CompileOnly=Kiwi.runfast -XX:CompileOnly=Kiwi.runslow -XX:+PrintCompilation -XX:+PrintInlining Kiwi
      VM option 'CompileOnly=Kiwi.runfast'
      VM option 'CompileOnly=Kiwi.runslow'
      VM option '+PrintCompilation'
      VM option '+PrintInlining'
        1% Kiwi::runslow @ 4 (24 bytes)
        1 Kiwi::runslow (24 bytes)
        2% Kiwi::runfast @ 4 (24 bytes)
            @ 11 D::getx inline (hot)
        2 Kiwi::runfast (24 bytes)
            @ 11 D::getx inline (hot)
      Warmup done. Runninng...
      B.getx 5289ms
      E.getx 99ms

            jrose John Rose
            rknippelsunw Ross Knippel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: