[Webkit-unassigned] [Bug 49739] WebIDL attributes should be implemented as getters and setters on the prototype object.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jun 19 18:00:14 PDT 2011


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





--- Comment #11 from Dominic Cooney <dominicc at chromium.org>  2011-06-19 18:00:14 PST ---
(In reply to comment #10)
> (In reply to comment #8)
> > (In reply to comment #7)
> > 
> > Thanks for the insight.
> > 
> > > Correction: I know that setters aren't cached.  Assigning to dom properties would be hammered, but they are theoretically already slow.  If we added caching to setters we would probably end up with a net win.
> > > 
> > > > Getters will be hit by additional branches to validate the proto chain which is unfortunate.
> > > 
> > > This will suck, but given that they're getter/setter pairs that we provide we might be able to remove at least _a_ branch from the current cached path.  We should also be able to avoid constructing an actual function wrapper until we absolutely have to (getOwnPropertyDescriptor requires us to provide the function object)
> > 
> > Could you point me to where this cache is in JSC?
> 
> What cache?

When you say setters aren’t cached, but because getters/setters come in pairs it could be possible to remove a branch from the "current cached path", what specifically are you referring too? I am still getting up to speed on JSC…

> > > This is really an issue that needs to be resolves -- do index properties move to the prototype or do 
> they stay own properties?
> > 
> > According to the Web IDL spec, indexed properties are on the host object, not the prototype <http://www.w3.org/TR/WebIDL/#indexed-properties>
> 
> Do they end up as getters or values?

>From the link Cam sent, it looks like they appear to JS to be values in the current editor’s draft: <http://dev.w3.org/2006/webapi/WebIDL/#indexed-and-named-properties>

If a host object implements an interface that supports indexed or named properties, the object will appear to have additional properties that correspond to the object’s indexed and named properties. These properties are not “real” own properties on the object, but are made to look like they are by being exposed by the [[GetOwnProperty]] internal method.

…

The internal [[GetOwnProperty]] method of every host object O that implements an interface that supports indexed or named properties must behave as follows … Let desc be a newly created property descriptor ([ECMA-262], section 8.10) with no fields. … Set desc.[[Value]] to the result of converting value to an ECMAScript value.

-- 
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