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

deoptimization problem with -XX:+DeoptimizeALot

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • hs16
    • 7
    • hotspot
    • b02
    • generic
    • generic
    • Verified

        With the internal testing option -XX:+DeoptimizeALot, running the SPECJVM98
        test _213_javac fails with NullPointerException. While this started occurring
        with the 20070413103655.jrose.dolphin-intrinsics putback, it is actually an
        existing incompatibility between the deoptimization support and the intrinsic
        inlining of the server compiler. The following program demonstrates the problem:

        import java.util.Vector;
        class deoptTest {

          Vector<Integer> _numbers;

          deoptTest(Vector<Integer> numbers) {
            _numbers = numbers;
          }

          void addElements(int start, int end) {
            for (int i = start; i < end; i++) {
              _numbers.add(Integer.valueOf(i));
              int sz = _numbers.size();
              if ((sz % 10000) == 0)
                System.out.println("+++ vector size = " + sz);
            }
          }

          static public void main(String args[]) {
            // create a Vector with an absurdly low initial size and capacity increment
            // to force constant reallocation
            Vector<Integer> numbers = new Vector<Integer>(100, 10);
            deoptTest dot = new deoptTest(numbers);

            for (int i = 0; i < 100; i++) {
              dot.addElements(0, 999);
            }
            for (int i = 0; i < 100; i++) {
              dot.addElements(0, 999);
            }
            for (int i = 0; i < 1000; i++) {
              dot.addElements(0, 999);
            }
            for (int i = 0; i < 1000; i++) {
              dot.addElements(0, 999);
            }
          }
        }

        When the fastdebug VM is run with the -XX:+DeoptimizeALot flag, it will fail with an
        assertion that indicates that the interpreter stack is corrupted. If the -XX:+VerifyStack
        option is added, it will fail an assert at the deoptimization point.

              cfang Changpeng Fang (Inactive)
              sdeversunw Steve Dever (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: