Bug 1470793: Stop eagerly XDR encoding scripts in the preloader cache. r=erahm
MozReview-Commit-ID: 2e85c34zt8v
This commit is contained in:
@@ -817,21 +817,6 @@ ScriptPreloader::NoteScript(const nsCString& url, const nsCString& cachePath,
|
||||
script->mReadyToExecute = true;
|
||||
}
|
||||
|
||||
// If we don't already have bytecode for this script, and it doesn't already
|
||||
// exist in the child cache, encode it now, before it's ever executed.
|
||||
//
|
||||
// Ideally, we would like to do the encoding lazily, during idle slices.
|
||||
// There are subtle issues with encoding scripts which have already been
|
||||
// executed, though, which makes that somewhat risky. So until that
|
||||
// situation is improved, and thoroughly tested, we need to encode eagerly.
|
||||
//
|
||||
// (See also the TranscodeResult_Failure_RunOnceNotSupported failure case in
|
||||
// js::XDRScript)
|
||||
if (!script->mSize && !(mChildCache && mChildCache->mScripts.Get(cachePath))) {
|
||||
AutoSafeJSAPI jsapi;
|
||||
Unused << script->XDREncode(jsapi.cx());
|
||||
}
|
||||
|
||||
script->UpdateLoadTime(TimeStamp::Now());
|
||||
script->mProcessTypes += CurrentProcessType();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user