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

CHA::analyze_call() misses some monomorphic cases

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 6
    • hotspot
    • None
    • b19
    • sparc
    • solaris_9

      The test came from _the mtrt specjvm98 test where I found this case
      when we not inlining monomorphic call.
      Note: the test should be compiled with 1.3.1 javac.

      Ouput with additional CHA prints (I added):

      C:\share>c:/jdk1.5.0_01/bin/java_g -server -XX:+PrintCompilation -XX:+PrintInlining test3
      VM option '+PrintCompilation'
      VM option '+PrintInlining'
        1 B::getXp1 (7 bytes)
      CHA: 2 targets, 3 receivers
      0: A::getX (0x143d5698)
      1: A::getX (0x143d5698)
                'virtual call' -> @ 1 A::getX (10000 counts) (10000 rc) (5 bytes)
        2 C::check (24 bytes)
            @ 9 B::getXp1 inline (hot)
      CHA: monomorphic A::getX
              @ 1 A::getX inline (hot)

      abstract class A {
        int X;
        public int getX() { return X; }
      }

      abstract class B extends A {
        public int getXp1() { return getX() + 1; }
      }

      class C extends B {
        void B() { X = 3; }
        int check(int N) {
          int j = 0;
          for (int i=0; i<N; i++)
            j += super.getXp1();
          return j;
        }
      }

      public class test3 extends B {
        public static void main(String[] args) {
          C c = new C();
          int ic1 = c.check(10000); // warmup
          int ic2 = c.check(10000); // compile
        }
      }


      ###@###.### 2004-12-21 23:13:57 GMT

            kvn Vladimir Kozlov
            kvn Vladimir Kozlov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: