зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1361900: Fix one last merge botch, and fix a false rooting hazard warning.
MozReview-Commit-ID: JpKYYEBpbQj --HG-- extra : rebase_source : 5bbb462ed3255c631cc1c280359af8c9c2224239 extra : histedit_source : 444c4c02eb1a3ced85cef09f7b7a6e7f5b9235b5%2Cb16ca4316a1aabf5e5c1b8641a0e1818d815da76
This commit is contained in:
Родитель
8b0611bd37
Коммит
8d9a00892f
|
@ -258,7 +258,8 @@ public:
|
||||||
public:
|
public:
|
||||||
Elem& operator*() { return *this; }
|
Elem& operator*() { return *this; }
|
||||||
|
|
||||||
ElemType get() {
|
ElemType get()
|
||||||
|
{
|
||||||
if (done_) {
|
if (done_) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -433,6 +433,8 @@ ScriptPreloader::InitCacheInternal()
|
||||||
return Err(NS_ERROR_UNEXPECTED);
|
return Err(NS_ERROR_UNEXPECTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AutoTArray<CachedScript*, 256> scripts;
|
||||||
|
|
||||||
{
|
{
|
||||||
auto cleanup = MakeScopeExit([&] () {
|
auto cleanup = MakeScopeExit([&] () {
|
||||||
mScripts.Clear();
|
mScripts.Clear();
|
||||||
|
@ -462,6 +464,7 @@ ScriptPreloader::InitCacheInternal()
|
||||||
|
|
||||||
script->mXDRRange.emplace(scriptData, scriptData + script->mSize);
|
script->mXDRRange.emplace(scriptData, scriptData + script->mSize);
|
||||||
|
|
||||||
|
scripts.AppendElement(script.get());
|
||||||
mScripts.Put(script->mCachePath, script.get());
|
mScripts.Put(script->mCachePath, script.get());
|
||||||
Unused << script.release();
|
Unused << script.release();
|
||||||
}
|
}
|
||||||
|
@ -482,7 +485,7 @@ ScriptPreloader::InitCacheInternal()
|
||||||
|
|
||||||
JS::CompileOptions options(cx, JSVERSION_LATEST);
|
JS::CompileOptions options(cx, JSVERSION_LATEST);
|
||||||
|
|
||||||
for (auto& script : IterHash(mScripts, Match<ScriptStatus::Restored>())) {
|
for (auto& script : scripts) {
|
||||||
// Only async decode scripts which have been used in this process type.
|
// Only async decode scripts which have been used in this process type.
|
||||||
if (script->mProcessTypes.contains(CurrentProcessType()) &&
|
if (script->mProcessTypes.contains(CurrentProcessType()) &&
|
||||||
script->AsyncDecodable() &&
|
script->AsyncDecodable() &&
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "nsIThread.h"
|
#include "nsIThread.h"
|
||||||
|
|
||||||
#include "jsapi.h"
|
#include "jsapi.h"
|
||||||
|
#include "js/GCAnnotations.h"
|
||||||
|
|
||||||
#include <prio.h>
|
#include <prio.h>
|
||||||
|
|
||||||
|
@ -207,7 +208,7 @@ private:
|
||||||
|
|
||||||
void UpdateLoadTime(const TimeStamp& loadTime)
|
void UpdateLoadTime(const TimeStamp& loadTime)
|
||||||
{
|
{
|
||||||
if (!mLoadTime || loadTime < mLoadTime) {
|
if (mLoadTime.IsNull() || loadTime < mLoadTime) {
|
||||||
mLoadTime = loadTime;
|
mLoadTime = loadTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -318,7 +319,7 @@ private:
|
||||||
// XDR data which was generated from a script compiled during this
|
// XDR data which was generated from a script compiled during this
|
||||||
// session, and will be written to the cache file.
|
// session, and will be written to the cache file.
|
||||||
MaybeOneOf<JS::TranscodeBuffer, nsTArray<uint8_t>> mXDRData;
|
MaybeOneOf<JS::TranscodeBuffer, nsTArray<uint8_t>> mXDRData;
|
||||||
};
|
} JS_HAZ_NON_GC_POINTER;
|
||||||
|
|
||||||
template <ScriptStatus status>
|
template <ScriptStatus status>
|
||||||
static Matcher<CachedScript*>* Match()
|
static Matcher<CachedScript*>* Match()
|
||||||
|
|
Загрузка…
Ссылка в новой задаче