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

[lworld] Need special handling of jlO constructor

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      From http://cr.openjdk.java.net/~briangoetz/valhalla/sov/02-object-model.html:

      Object
      Because of its role as the root type for all classes, inline and identity, Object shares many characteristics with interfaces. As noted already, there is an inline widening conversion from all inline types to Object.

      However, because Object is a concrete class, it is unfortunately possible to instantiate Object directly through its constructor. And because interfaces are inherited, Object can implement neither InlineObject nor IdentityObject – but the result of instantiating new Object() must be an instance of an identity type (since there is no point instantiating Object for any other reason.)

      Wriggling out of this trap will require some fancy moves. We can start by creating a static factory Object::newIdentity that returns IdentityObject, and then attempt to migrate existing source and binary usages of new Object() towards this using various tools (compiler warnings, JIT magic) – and ultimately “deprecating” the Object constructor for direct instantiation (by making it protected).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sadayapalam Srikanth Adayapalam
                Reporter:
                sadayapalam Srikanth Adayapalam
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: