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

Nightly: Assert in compile.cpp, 583: benchmarks/engr/sympents

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1 P1
    • 2.0
    • 1.0, 2.0
    • hotspot
    • None
    • beta
    • x86
    • windows_nt

      Nightly run failure:

      benchmarks/engr/sympents compile_and_execute

      In testlist: java_g

      #
      # HotSpot Virtual Machine Error, assertion failure
      #
      # assert((offset != Type::OffsetBot && tj->_base != Type::AryPtr) || (offset == Type::OffsetBot && tj->_base == Type::AryPtr) || (offset == 0 && tj->_base == Type::AryPtr) || (offset == 4 && tj->_base == Type::AryPtr) || (offset == 8 && tj->_base == Type::AryPtr), "Foroops, klasses, raw offset must be constant; for arrays the offset is never known")
      #
      # Error happened during: method compilation
      #
      # compiling Benchmarks/SymPents.mainPents
      #
      # Error ID: n:\runtime_wrkspace\src\share\vm\opto\compile.cpp, 583
      #

      To run:
      ========

      java_g -XX:-ShowMessageBoxOnError Benchmarks.SymPents


      ----------- SOURCE ------------

      package Benchmarks;

      //Pentominoes benchmark

      public class SymPents {
          
          static byte W=6;
          static byte H=10;
          static byte F[][] = new byte[12][32];
          static byte L[] = new byte[12];
          static byte S[] = new byte[12];
          static byte Z;
          static byte U[];
          static int U_x = 0;
          static byte O[] = new byte[300];
      //char *B=O+40;
      //char *B = O;
          static int B_x = 40;
          static int T,i,j;

          static int endval = 0;

          public static void init_benchmark () {
              W = 6;
              H = 10;
              for (i = 0; i < 12; i += 1) {
                  L[i] = 0;
                  S[i] = 0;
                  for (j = 0; j < 32; j += 1)
                      F[i][j] = 0;
              }
              Z = 0;
              U_x = 0;

              for (i = 0; i < 300; i += 1)
                  O[i] = 0;

              B_x = 40;

              T = 0;
              i = 0;
              j = 0;

              endval = 0;
          }



          static void G(int N, byte b[], int b_x) {
      byte o, Y, P[];
              int P_x = 0;

              if(N != 0) {
                  while(b[++b_x] != 0)
                      ;

                  for(Y=12; Y-- != 0;) {
      // System.out.println("Y="+Y);
                      if(L[Y] != 0) {
                          L[Y]=0;
                          P=F[Y];
                          P_x = 0;
                          o = S[Y];
                          U = P;
                          U_x = P_x;
                          while(o-- != 0) {
                              if(!(b[b_x + U[U_x++]] != 0 ||
                                      b[b_x + U[U_x++]] != 0 ||
                                      b[b_x + U[U_x++]] != 0 ||
                                      b[b_x + U[U_x++]] != 0)) {
                                  U=P;
                                  U_x = P_x;
                                  Z = (byte) (Y+65);
                                  b[b_x + U[U_x++]] = b[b_x]=Z;
                                  b[b_x + U[U_x++]] = Z;
                                  b[b_x + U[U_x++]] = Z;
                                  b[b_x + U[U_x++]] = Z;
                                  G(N-1, b, b_x);

                                  U=P;
                                  U_x = P_x;
                                  b[b_x + U[U_x++]]=b[b_x]=0;
                                  b[b_x + U[U_x++]]=0;
                                  b[b_x + U[U_x++]]=0;
                                  b[b_x + U[U_x++]]=0;
                              }
                              P_x += 4;
                              U = P;
                              U_x = P_x;
                          }
                          L[Y] = 1;
                      }

                  }

              }

              else {
                  ++T;
                  endval = T;
              }

          }



          static String string1 = "678=23457=>?234:78>?7=>C28>?789=2379278>78>D678>";

          static String string2 = "737040221000";

          static void mainPents () {
              byte p,t,k,Q[];
              int Q_x = 0;

              p = 0;
              //Q = F[p];
              //Q_x = 0;
              while (p < 12) {
                  Q = F[p];
                  Q_x = 0;
                  for(t = 8; t-- != 0;) {
                      byte m = (byte) (string2.charAt(p));
                      byte a[] = new byte[5];

                      if(!((t&m) != 0)) {
                          for(k=0; k < 4; k++) {
                              int c = string1.charAt(k+p*4)-48;
                              int x=c%6-1;
                              int y=c/6;

                              if((t&1) != 0) x = -x;
                              if((t&2) != 0) y = -y;
                              if((t&4) != 0) {
                                  Z=(byte) x; x=y; y= (int) Z;
                              }
                              a[k] = (byte) (x+y*9);
                          }
                          a[4]=0;
                          i = 300;
                          j = i % 4;

                          while (i-- != 0) {
                              byte temp = 0;

                              temp = 0;
                              if (i%9 == 3)
                                  temp = 22;
                              O[i] = L[i%12] = (byte) (32 - temp);//22*(i%9 == 3);
                              if(a[j+1] < a[j]) {
                                  Z = a[j]; a[j] = a[j+1]; a[j+1] = Z;
                              }
                              j = i % 4;
                          }
                          U = a;
                          U_x = 1;
                          Q[Q_x++] = (byte) (U[U_x++] - a[0]);
                          Q[Q_x++] = (byte) (U[U_x++] - a[0]);
                          Q[Q_x++] = (byte) (U[U_x++] - a[0]);
                          Q[Q_x++] = (byte) (U[U_x++] - a[0]);
                          S[p]++;
                      }
                  }
                  p++;
              }
              for(j=H; j-- != 0;)
                  for(i=W; i-- != 0; O[B_x+ i+j*9] = 0)
                      ;
              O[B_x + H*9-1] = 0;
              G(12, O, B_x-1);
          }


        public static void main (String s[]) {
          System.out.println("Pentominoes Benchmark");
          long min_time = 0;
          for (int outer = 0; outer < 5; outer++) {
            long time = System.currentTimeMillis();
            init_benchmark();
            mainPents();
            time = System.currentTimeMillis() - time;
            if (min_time == 0 || time < min_time) {
              min_time = time;
            }
            System.out.println(" " + outer + "\t" + time);
          }
          System.out.println("Pentominoes=\t" + min_time);
        }
      }



            cclicksunw Clifford Click (Inactive)
            rschmidtsunw Rene Schmidt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: