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

G1: Back out 8033601 and go back to use the to-obj for chunked arrays.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc
    • Resolved In Build:
      b04

      Description

      The fix for 8033601 changed the code for chunked arrays to use the from obj length as index rather than the to object.

      This was nice since it made G1 look more like the other collectors.

      However, another difference in G1 is that it writes the forward pointer before it writes the to-object. That means that there are times when an object is forwarded, but there is no to-object image that can be trusted.

      One such place is

      void G1ParCopyClosure<barrier, do_mark_object>
      ::do_oop_work(T* p)

      We can find that the object is forwarded, but it may not have been marked yet. So, we end up calling mark_forwarded_object() which needs the size to call _cm->grayRoot(to_obj, (size_t) from_obj->size(), _worker_id);

      mark_forwarded_object() has a comment that tries to describe this situation:

        // The object might be in the process of being copied by another
        // worker so we cannot trust that its to-space image is
        // well-formed. So we have to read its size from its from-space
        // image which we know should not be changing.
        _cm->grayRoot(to_obj, (size_t) from_obj->size(), _worker_id);

      So, just as the comment say, we can not trust the to-space image. However, after the change for 8033601 we can not trust the from-space image either.

      This seems like a show-stopper for the suggested change for 8033601 so we need to back it out.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brutisso Bengt Rutisson (Inactive)
              Reporter:
              brutisso Bengt Rutisson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: