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

incorrect deopt leads to wrong execution

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.2
    • 1.4.1
    • hotspot
    • b23
    • sparc
    • solaris_8

        The debug information for doubles on the expression stack is incorrect on Sparc for C1. In 1.4.1 the ordering of the two halves of a double was swapped in the RInfo but the debug information generation code in LIREmitter wasn't updated. Here's a test case provided by Vladimir Kozlov.

        public class Testf {
          static final double value = 10000000.;

          private static void check( double l ) {
            if ( l != value )
              System.out.println("l("+l+") != Value("+value+")");
          }

          private static double foo( ) {
            double l = 0.;
            while(l < value) {
              l += 1.; // deoptimization happens here and the double 'l' value is
            } // stored to interpreter stack incorrectly on Sparc-v8plus
            return l;
          }

          public static void main(String arg[]) {
            System.out.println("Start!");
            for(int i=0; i < 100; i++) {
              System.out.println(i);
              System.gc();
              check( foo( ) );
            }
            System.out.println("Done!");
          }
        }




        This needs to be run with -XX:+DeoptimizeALot
        ###@###.### 2003-05-06

              never Tom Rodriguez
              never Tom Rodriguez
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: