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

SYMCJIT.DLL optimizes/executes method incorrectly on 1.1.6 and crashes on 1.2

XMLWordPrintable

    • 1.2fcs
    • x86
    • windows_95
    • Not verified



      Name: tb29552 Date: 06/25/98


      /*
       * I have verified this bug on JDK 1.1.6 using the original SYMCJIT.DLL and
       * the Early Access Release 2 SYMCJIT.DLL from the JDC.
       *
       * Compile and execute the following code:
       *
       */
      // testFor.java

      public final class testFor {
        public static final int Iterations = 1000000;
        public static final int CheckPoint = 100000;

        public static void main(String[] args) {
          long start = System.currentTimeMillis();
          testFor t = new testFor();
          int j = 0;
          int k = 0;

          for (int i =0 ; i < Iterations; ++i) {
            try {
      int a = t.foo(null);
            } catch (Exception m) {
                  
            }
            ++j;
            if (j == CheckPoint) {
      ++k;
      System.err.println((k * j));
      j = 0;
            }
          }
          long finish = System.currentTimeMillis();
          long elapsed = finish - start;

          System.err.println(elapsed + " milliseconds");
        }

        int foo(String str) {
          return str.length();
        }
      }
      /*
       * My console looks like this:
       *
       * (Original 1.1.6 JIT)
       *
       * E:\dnload\temp2>set JAVA_COMPCMD=FORCE_SIGNON
       *
       * E:\dnload\temp2>javac testFor.java
       * Symantec Java! JustInTime Compiler Version 3.00.039(x) for JDK 1.1.x
       * Copyright (C) 1996-98 Symantec Corporation
       *
       *
       * E:\dnload\temp2>java testFor
       * Symantec Java! JustInTime Compiler Version 3.00.039(x) for JDK 1.1.x
       * Copyright (C) 1996-98 Symantec Corporation
       *
       * 32 milliseconds
       *
       * E:\dnload\temp2>java -nojit testFor
       * 100000
       * 200000
       * 300000
       * 400000
       * 500000
       * 600000
       * 700000
       * 800000
       * 900000
       * 1000000
       * 23891 milliseconds
       *
       *
       * (EA 2 JIT)
       *
       * E:\dnload\temp2>set JAVA_COMPCMD=FORCE_SIGNON
       *
       * E:\dnload\temp2>javac testFor.java
       * Symantec Java! JustInTime Compiler Version 3.00.050(x) for JDK 1.1.x
       * Copyright (C) 1996-98 Symantec Corporation
       *
       *
       * E:\dnload\temp2>java testFor
       * Symantec Java! JustInTime Compiler Version 3.00.050(x) for JDK 1.1.x
       * Copyright (C) 1996-98 Symantec Corporation
       *
       * 31 milliseconds
       *
       * E:\dnload\temp2>java -nojit testFor
       * 100000
       * 200000
       * 300000
       * 400000
       * 500000
       * 600000
       * 700000
       * 800000
       * 900000
       * 1000000
       * 23828 milliseconds
       *
       *
       * Clearly, the JIT-enabled execution is flawed. Even if it optimizes out the
       * try/catch block, the System.err output should still be written.
       */

      (Review ID: 34304)
      ======================================================================

            dviswanasunw Deepa Viswanathan (Inactive)
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: