[Webkit-unassigned] [Bug 55343] Global Math object should be configurable but isn't

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 3 10:45:38 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=55343





--- Comment #5 from Gavin Barraclough <barraclough at apple.com>  2012-01-03 10:45:38 PST ---
(In reply to comment #4)
> Given that, is it still more expensive to have assignment to Math also invalidate these same caches?

Hi Mark,

The way our engine works, if we store Math in a regular property on the global object the calling abs will require 3 independent checks:

1) Check the shape of the global object, ensure there is still a 'Math' property at the expected offset.
2) Load the 'Math' property from a fixed offset in the global object's storage.
3) Check the shape of the Math object, ensure there is still a 'abs' property at the expected offset.
2) Load the 'abs' property from a fixed offset in the Math object's storage.
5) Check the abs function is callable (or is the expected value, or check that it is the abs intrinsic, depending on optimizations).

If 'Math' is a var on the global object instead of a property, and as such non-configurable, we can skip step 1 (Math will always be present at the same offset into the var storage).

We should be able to better optimize the process of access to variables like this – of course the fact we have incorrectly been treating 'Math' as a var has been artificially taking away a key incentive to do so!

cheers,
G.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list