Open Bug 1826840 Opened 2 years ago Updated 2 years ago

[meta] Optimize scripted proxies in CacheIR

Categories

(Core :: JavaScript Engine: JIT, task, P3)

task

Tracking

()

People

(Reporter: iain, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: meta)

Proxies are seeing increasing usage in performance-sensitive code. The Vue test in Speedometer 3 is the most important, but there are other frameworks like MobX that are starting to make heavier use of proxies. V8 does better than we do in some cases. In bug 1824051, Jeff observed that if we could match V8’s performance on proxies, we would improve on the test by 8.5%.

One option is to generate ICs specialized to a particular proxy handler object. Consider the following hypothetical GetProp CacheIR (including some ops that don’t exist yet):

  GuardToObject        	 
  GuardIsScriptedProxy 	   // Check that this is a proxy
  LoadScriptedProxyHandler // Load the handler object
  GuardShape           	   // Guard the shape of the handler
  LoadFixedSlot        	   // Load the 'get' hook
  GuardSpecificFunction	   // Guard that it's a particular function
  CallScriptedProxyGet 	   // Call and validate result
  ReturnFromIC

The same sequence could be used for GetElem. Similar sequences could be used for SetProp/SetElem/HasProp.

We have to do some validation of the return values after calling. One alternative is to generate a call to a self-hosted function instead of adding CallScriptedProxyGet.

More details in this document.

You need to log in before you can comment on or make changes to this bug.