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

Rework WeakHandle and OopHandle to dynamically support different OopStorages

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 16
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b03

      Description

      Today WeakHandle has a template parameter and specialization of get_storage() to get hold of the backing OopStorage. Coleen, ErikÖ and I talked about different ways to rewrite that, so that we wouldn't have to write specializations for all weak oop storages, and so that we don't have to carry around the type information about the weak oop storage.

      Instead of writing:
      WeakHandle<vm_weak_data> w = WeakHandle<vm_weak_data>::create(obj)

      we could instead write:
      WeakHandle w(OopStorageSet::vm_weak(), obj)

      OopHandle is today hard-coded to use OopStorageSet::vm_global(). The proposal is change OopHandle to look like WeakHandle, and allow more than one OopStorage. Something that might become important going forward, when we are going to move more things into separate OopStorages.

      So, instead of writing:
      OopHandle h = OopHandle::create(obj)

      one will have to specify the OopStorage explicitly:
      OopHandle h(OopStorageSet::vm_global(), obj)

      This change has a slight drawback that the OopStorage used for the allocation of the handle, needs to be provided when the handle is released.

        Attachments

          Activity

            People

            Assignee:
            stefank Stefan Karlsson
            Reporter:
            stefank Stefan Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: