Last Comment Bug 563375 - JM: Consider making it possible to COMPILE_N_GO compile scripts and then run them at a later time
: JM: Consider making it possible to COMPILE_N_GO compile scripts and then run ...
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal (vote)
: ---
Assigned To: general
: Jason Orendorff [:jorendorff]
Depends on:
Blocks: 521234
  Show dependency treegraph
Reported: 2010-05-03 10:21 PDT by Boris Zbarsky [:bz] (still a bit busy)
Modified: 2013-05-22 00:38 PDT (History)
6 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description Boris Zbarsky [:bz] (still a bit busy) 2010-05-03 10:21:20 PDT
The use case is bug 521234.
Comment 1 Brendan Eich [:brendan] 2010-05-03 11:29:17 PDT
It is possible already, see JSOPTION_COMPILE_N_GO.

Comment 2 Boris Zbarsky [:bz] (still a bit busy) 2010-05-03 11:41:02 PDT
Sorry I wasn't clear.  This bug is specifically about the JM case.  In JM this is not (safely) possible right now.
Comment 3 Brendan Eich [:brendan] 2010-05-03 12:13:56 PDT
First, JM in summary if it's a JM bug.

Second, API compat: we have had JSOPTION_COMPILE_N_GO for a long time. I don't think we should drop it. We could make it a no-op, with JS_Compile* APIs all making unoptimized, maximally cacheable scripts, and JS_ExecuteScript calling the linker unconditionally. We'd want a separate API to call the linker for the case of executing more than once.

Jason, thoughts?

Comment 4 Jason Orendorff [:jorendorff] 2010-05-06 10:30:30 PDT
The requirement that every running script be tied to a particular global now solves problems for three independent efforts:

  * JM wants to attach compiled machine-code that is specialized
    for the global to the JSScript.

  * jimb's new debugger work wants to keep a list of all the scripts
    in each global, for UI purposes.

  * Compartmental GC needs as many GC-references as possible to be
    intra-compartment, including (1) the references from functions and
    stack frames to scripts and (2) the references from scripts to
    internal objects.

Should we file a separate bug for that?
Comment 5 Jason Orendorff [:jorendorff] 2010-05-06 10:38:14 PDT
Separate bug, I think -- this bug is really about eagerly compiling several scripts as they come in off the wire and before executing any of them, and making sure JM doesn't see that as violating the COMPILE_N_GO rules and run amok. That seems like a different issue.
Comment 6 Boris Zbarsky [:bz] (still a bit busy) 2010-05-06 10:41:04 PDT
Yeah.  In my case, I only have one global involved for any given script.

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