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

NT JDK1.2.2 JIT ignores the possibility of RunTimeException

    XMLWordPrintable

Details

    Description

      My ISV is suspecting that ccertain optmizations ignore the possibility of
      a RTE when determining the scope in which the optimizations can be applied.

      This example class shows the type of error we've been seeing. The JIT
      will incorrectly optimize out the false->true->false and the wrong flag
      value is found in the exception handler.

      class Foo {
        boolean b;

        void bar() {
          b = false;
          Irrelevant.code();

          b = true;
          RTE_capable.call();
          b = false;

          Irrelevant.morecode();
        }

        void callThisEnoughTimesToTriggerTheJIT() {
          try {
            bar();
          } catch(Excption e) {
            if(b) System.out.println("Correct");
            else System.out.println("Fail");
          }
        }
      }

      This exists for JDK1,2,1, and JDK1.2.2.

      There is a workaround available, but they feel that it may cause other optimizations problem by not considering RTE.

      Attachments

        Activity

          People

            Unassigned Unassigned
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: