Go figure: http://mxr.mozilla.org/mozilla-central/source/dom/base/nsJSEnvironment.cpp#1984 Related question: do we ever call this function? It ends up being 1 of 2 uses of JS engine XDR, so it would be awesome if we could kill it...
I see. bz: do you know how that stream serialization relates to the startup cache?
Pretty directly, last I checked: the result is what's stored in the startup cache.
Interesting, so is this for a set of scripts disjoint from those XDR'd via (Read|Write)CachedScript (by mozJSComponentLoader::GlobalForLocation and mozJSSubScriptLoader::LoadSubScript) ?
Yes, this is for <script> tags in XUL documents. Specifically for inline <script>s, for the callsite linked in comment 1, I believe.
Ah, thanks for explaining. Would you say that <script> tags are the majority (size-wise) of XDR'd scripts?
I would think not, because the inline scripts should generally be small (and perhaps even rare) and <script src> uses a different codepath here, right? We could measure, if desired.
(In reply to Boris Zbarsky (:bz) from comment #7) Ah, good to hear; we'll measure. (This is all in the context of removing the decompiler and bug 761723.)
Created attachment 649684 [details] [diff] [review] kill dead xpc thing Going back to the original bug.
Comment on attachment 649684 [details] [diff] [review] kill dead xpc thing Removing them is one option, but I assume it was put here for a reason: http://hg.mozilla.org/mozilla-central/rev/defb50779980 Steve?
Perhaps smaug can comment.
The question is, what does WriteScript do with aScriptObject? If it can create any new references to aScriptObject anywhere in the heap, then we need to do an xpc_UnmarkGrayScript() before we do WriteScript.
I don't know what WriteScript does... but looks like it ends up calling JS_EncodeInterpretedFunction or JS_EncodeScript.
I don't believe JS_EncodeScript currently can keep extra references around. Maybe it would be safer to retain the xpc_UnmarkGrayScript just in case.
That would be the easiest thing to do. I can't imagine the overhead of a function call will impact performance much here.
Created attachment 649741 [details] [diff] [review] fix dead code
Comment on attachment 649741 [details] [diff] [review] fix dead code Review of attachment 649741 [details] [diff] [review]: ----------------------------------------------------------------- Thanks.