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

[sparc] Compiler Safepoints do not work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1 P1
    • 1.3.0
    • 1.3.0
    • hotspot
    • None
    • solaris
    • sparc
    • solaris_2.6

      Compiler safepoints do not work on SPARC.
      Run the appended program with following commandline
      and it will hang (use server VM)
      java -Xcomp -verbose:gc sf

      Run it with following commandline and it terminates properly:
      java -Xint -verbose:gc sf

      The program hangs if the method loop is compiled because
      the runtime cannot properly suspend the endless loop.
      I have verified that Compiler 2 (server) is
      emitting safepoint information.



      ----------------
      public class sf {
              static public boolean _xx = true;

      public static void main(String[] args) {
      new Srdjan().start();
      }

      public void start() {
      new TesterThread().start();
      new GCThread().start();
      }

      class TesterThread extends Thread {

                      // trick compiler 2 in believing that this is not and endless loop
                      public void loop (int n) {
      long counter = 0;
      while (_xx) {
      if (n == 0) {
                                        _xx = false;
                                      }
      }
                      }
      public void run () {
      System.out.println("Start loop");
                              loop(3);
      }
      }

      class GCThread extends Thread {
      public void run () {
      System.out.println("Starting GC loop");
      long counter = 0;
      while (true) {
      try { sleep(250); } catch (InterruptedException ix) {}
      System.gc();
                                      counter++;
                                      if (counter == 10) {
                                        _xx = false;
                                        return;
                                      }
      }
      }
      }
      }

            ysr Y. Ramakrishna
            smitrovisunw Srdjan Mitrovic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: