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

Migrate the serialization constructor accessors to Method Handles

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Duplicate
    • P4
    • tbd
    • 21
    • core-libs
    • None

    Description

      The serialization constructor in ReflectionFactory is the only one whose accessor is still magic-based (JDK-8305104). They are not used before java.lang.invoke is ready; thus, it's totally safe to migrate them (used by serialization and sun.reflect.ReflectionFactory::newConstructorForSerialization) to exclusively methodhandle-based accessors.

      A prototype exists as part of https://github.com/openjdk/jdk/pull/1830 which I have tweaked since the introduction of methodhandle accessors and added extra comments and assertions.

      With this migration, hidden classes can be serialized as regular objects (in particular, proxies), and it will simplify the removal of old core reflection implementation.

      Attachments

        Issue Links

          Activity

            People

              liach Chen Liang
              liach Chen Liang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: