зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1271507 - Don't insert nullptr into the cache; r=jimb
This commit is contained in:
Родитель
6a456833c3
Коммит
10fa163e08
|
@ -0,0 +1,13 @@
|
|||
// |jit-test| allow-oom
|
||||
if (typeof oomAfterAllocations != "function")
|
||||
quit();
|
||||
|
||||
lfcode = new Array();
|
||||
oomAfterAllocations(100);
|
||||
loadFile(file);
|
||||
lfGlobal = newGlobal()
|
||||
for (lfLocal in this)
|
||||
if (!(lfLocal in lfGlobal))
|
||||
lfGlobal[lfLocal] = this[lfLocal]
|
||||
offThreadCompileScript(lfVarx)
|
||||
lfGlobal.runOffThreadScript()
|
|
@ -2050,6 +2050,7 @@ ScriptSource::setCompressedSource(ExclusiveContext* cx,
|
|||
size_t rawLength,
|
||||
size_t sourceLength)
|
||||
{
|
||||
MOZ_ASSERT(raw);
|
||||
auto& cache = cx->zone()->runtimeFromAnyThread()->sharedImmutableStrings();
|
||||
auto deduped = cache.getOrCreate(mozilla::Move(raw), rawLength);
|
||||
if (!deduped) {
|
||||
|
|
|
@ -1621,6 +1621,7 @@ SourceCompressionTask::complete()
|
|||
}
|
||||
|
||||
if (result == Success) {
|
||||
MOZ_ASSERT(compressed);
|
||||
mozilla::UniquePtr<char[], JS::FreePolicy> compressedSource(
|
||||
reinterpret_cast<char*>(compressed));
|
||||
compressed = nullptr;
|
||||
|
|
|
@ -17,6 +17,7 @@ SharedImmutableStringsCache::getOrCreate(const char* chars, size_t length,
|
|||
IntoOwnedChars intoOwnedChars)
|
||||
{
|
||||
MOZ_ASSERT(inner_);
|
||||
MOZ_ASSERT(chars);
|
||||
Hasher::Lookup lookup(chars, length);
|
||||
|
||||
auto locked = inner_->lock();
|
||||
|
@ -48,6 +49,7 @@ MOZ_MUST_USE mozilla::Maybe<SharedImmutableTwoByteString>
|
|||
SharedImmutableStringsCache::getOrCreate(const char16_t* chars, size_t length,
|
||||
IntoOwnedTwoByteChars intoOwnedTwoByteChars) {
|
||||
MOZ_ASSERT(inner_);
|
||||
MOZ_ASSERT(chars);
|
||||
Hasher::Lookup lookup(chars, length);
|
||||
|
||||
auto locked = inner_->lock();
|
||||
|
|
Загрузка…
Ссылка в новой задаче