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

Nested object literal property maps not reset in optimistic recompilation

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u102, 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b139
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        Reported on nashorn-dev: http://mail.openjdk.java.net/pipermail/nashorn-dev/2016-September/006504.html

        When optimistic conversion is triggered during initialization of an object literal, we have a mechanism to update the property map of the object as the types may (and probably will) have changed.

        However, this is only done for the top-level object in a nested object initializer. There are cases where the map may have to be updated on outer objects as well, as the example code below shows. The reason is that we may have better type information during recompilation because of type evaluation, for instance.

        =================================================================

        var o = {
           a: "LEARN_MORE",
           b: "http:/some.url",
        };

        var m = {
           x: { z: o.a },
           y: o.b
        };

        print(m.x.z);
        print(m.y);

        ===================================================================

        Expected output:

        LEARN_MORE
        http:/some.url

        Actual output:

        LEARN_MORE
        0

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  hannesw Hannes Wallnoefer
                  Reporter:
                  hannesw Hannes Wallnoefer
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: