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

Remove wrong assert and refactor code in G1CollectorPolicy::record_concurrent_mark_end

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 9
    • 9
    • hotspot
    • gc
    • b42

        G1CollectorPolicy::record_concurrent_mark() contains the following code:

        if (no_of_gc_threads > 0) {
          ...
        } else {
          assert(no_of_gc_threads > 0, ...);
        }

        The assert is wrong and will always fail. Apparently the else-part of that if is never executed.

        Fix this code by:
         - factor out the calculation of the WorkUnit variable into a method
         - remove the else-part and simply assert at the beginning of the method that no_of_gc_threads must be > 0
         - refactor the method, i.e. variable naming, according to coding guidelines

              mlarsson Marcus Larsson (Inactive)
              tschatzl Thomas Schatzl
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: