-
Enhancement
-
Resolution: Other
-
P4
-
None
-
10
-
None
-
generic
-
generic
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.
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.
- relates to
-
JDK-8068513 Adding elements to a javascript 'object' (a map) is slow
- Resolved