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

Allow constructors with same prototoype map to share the allocator map

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      b83
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        As shown by JDK-8133925 we want to be able to allow different instances of a constructor function to use the same allocator map as long as their prototypes have the same maps as well. This helps us keep callsites monomorphic in a couple of circumstances, such as the various non-global constructor code patterns, or scripts with global constructors being evaluated multiple times with different globals.

        This means we have to keep track of what a map's expected prototype map is, and change the map if the actual prototype map differs or has been modified on any of the (prototype) objects using it. We also need to introduce a switchpoint for callsites involving shared prototype maps, as the prototype may have changed on any object not directly involved in the linking of the callsite.

        Basically, we make an assumption about the JavaScript code that prototypes are usually not modified after objects have been constructed. This makes property maps a bit more like classes, allowing us to assume objects with the same property map also have prototypes with the same map.

          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: