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

Check if we can avoid map evolution for global object

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Other
    • Icon: P4 P4
    • None
    • 10
    • core-libs
    • None

      global object is a singleton. The PropertyMap of global object will evolve a lot because of eval's/load's in a long running app like nodejar or other serverside apps. Now, defining one new global var or function results in new PropertyMap for global object and therefore (map) guard for all existing callsites involving global object will fail!! The benchmarks we use are not long running apps and so we may not see such a thing in our benchmarks. Also, too many times PropertyMap of global will be copied/cloned around. We can actually use identity guard for global (it is a singleton and well-known object, alive till the end-of-the context anyway) and avoid cloning global's map.

      As discussed over chat, additional codegen changes can be done to directly pass global object (instead of scope object) in some cases as well as flag callsites that are always to global vars/functions. In the later, we can even avoid identity guard. i.e., just the switchpoint will do.


            hannesw Hannes Wallnoefer
            lagergren Marcus Lagergren
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: