Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Deprecating JSCLASS_SHARE_ALL_PROPERTIES?

4 views
Skip to first unread message

Jason Orendorff

unread,
Nov 11, 2009, 5:59:15 PM11/11/09
to
Bug 527805 <https://bugzilla.mozilla.org/show_bug.cgi?id=527805>
indicates that classes with the JSCLASS_SHARE_ALL_PROPERTIES flag are
seriously broken with the JIT enabled. It has been busted for quite some
time.

Brendan suggests just deleting the feature. Mozilla isn't using it. Does
anyone need it?

-j

Ash Berlin

unread,
Nov 11, 2009, 6:27:22 PM11/11/09
to dev-tech-js-engine

I don't ever recall seeing it documented on devmo wiki. Apparently it
is. It seems relatively easy to work round by setting JSPROP_SHARED on
all properties manually if you need it.

-ash

Wes Garland

unread,
Nov 12, 2009, 9:49:17 AM11/12/09
to Jason Orendorff, dev-tech-...@lists.mozilla.org
Brendan mentioned (IIRC) that this flag was needed by some embedder a
bajillion years ago. If this embedder is reading, speak up!

The flag *does* have potential perf gains for embedders. Consider the case
of a BLOB type: all properties are shared, and yet we can't reasonably mark
them that way individually. So, not having JSPROP_SHARED means that BLOBs
have un-needed value slots, which could in turn entrain garbage.

Additionally, if the BLOB is immutable, we also have all properties
permanent. If we had a JSCLASS_ALL_PROPERTIES_ARE_PERMANENT flag, there is
another engine optimization we might be able to take advantage of. (And --
FWIW, I have immutable BLOBs that can share backing store: extra prop
copying because of jsapi is unfortunate)

Incidentally, it's worth noting that JSCLASS_SHARE_ALL_PROPERTIES has a bit
of a nasty, undocumented poison pill: a class declared like this cannot
have any native methods. That really... sucks.

So, what to do? From my POV, deleting it is not the end of the world,
although I *am* interested in effecient BLOB types. I am guessing GC
entrainment can probably be solved with *vp=JSVAL_NULL in the setter, and as
for efficiency, I haven't proved that it matters, so POITROAE and all that.

I also did a half-thorough survey of the web, and could not find any
projects using the flag meaningfully.

By the way, was this discovery triggered by soubok? According to the jslibs
source repo, it's been giving him grief recently:
http://code.google.com/p/jslibs/source/browse/trunk/src/jsstd/objex.cpp?spec=svn2910&r=2910

Wes

> _______________________________________________
> dev-tech-js-engine mailing list
> dev-tech-...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-js-engine
>

--
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102

Wes Garland

unread,
Nov 12, 2009, 9:53:23 AM11/12/09
to Jason Orendorff, dev-tech-...@lists.mozilla.org
PS: might super-efficient BLOBs be of interest to Mozilla, as a backing
store for canvas pixels?

Wes

Mike Shaver

unread,
Nov 12, 2009, 10:12:11 AM11/12/09
to Wes Garland, Jason Orendorff, dev-tech-...@lists.mozilla.org
On Thu, Nov 12, 2009 at 9:49 AM, Wes Garland <w...@page.ca> wrote:
> Brendan mentioned (IIRC) that this flag was needed by some embedder a
> bajillion years ago. If this embedder is reading, speak up!

I thought it was added for XPConnect, since all of the wrappednative's
properties are shared.

Mike

0 new messages