mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1000182, part 1 - Crash @js::ThreadSafeContext::onOutOfMemory with PJS and OOM. r=shu.
This commit is contained in:
parent
8ecdb98d44
commit
77e66219d7
17
js/src/jit-test/tests/basic/bug1000182.js
Normal file
17
js/src/jit-test/tests/basic/bug1000182.js
Normal file
@ -0,0 +1,17 @@
|
||||
// |jit-test| allow-unhandlable-oom;
|
||||
function range(n, m) {
|
||||
var result = [];
|
||||
result.push(i);
|
||||
return result;
|
||||
for (var i = 0, l = a.length; i < l; i++) {}
|
||||
}
|
||||
function b(opFunction, cmpFunction) {
|
||||
var result = opFunction({mode:"compile"});
|
||||
var result = opFunction({mode:"par"});
|
||||
}
|
||||
function a(arr, op, func, cmpFunc) {
|
||||
b(function (m) { return arr[op + "Par"].apply(arr, [func, m]); }, function(m) {});
|
||||
}
|
||||
if ("mapPar" in [])
|
||||
a(range(0, 1024), "map", function (i) {});
|
||||
oomAfterAllocations(4);
|
@ -524,14 +524,17 @@ JitCompartment::notifyOfActiveParallelEntryScript(JSContext *cx, HandleScript sc
|
||||
}
|
||||
|
||||
if (!activeParallelEntryScripts_) {
|
||||
activeParallelEntryScripts_ = cx->new_<ScriptSet>(cx);
|
||||
if (!activeParallelEntryScripts_ || !activeParallelEntryScripts_->init())
|
||||
ScriptSet *scripts = js_new<ScriptSet>();
|
||||
if (!scripts || !scripts->init()) {
|
||||
js_delete(scripts);
|
||||
js_ReportOutOfMemory(cx);
|
||||
return false;
|
||||
}
|
||||
activeParallelEntryScripts_ = scripts;
|
||||
}
|
||||
|
||||
script->parallelIonScript()->setIsParallelEntryScript();
|
||||
ScriptSet::AddPtr p = activeParallelEntryScripts_->lookupForAdd(script);
|
||||
return p || activeParallelEntryScripts_->add(p, script);
|
||||
return activeParallelEntryScripts_->put(script);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -414,7 +414,8 @@ class JitCompartment
|
||||
// Set of JSScripts invoked by ForkJoin (i.e. the entry script). These
|
||||
// scripts are marked if their respective parallel IonScripts' age is less
|
||||
// than a certain amount. See IonScript::parallelAge_.
|
||||
typedef HashSet<PreBarrieredScript> ScriptSet;
|
||||
typedef HashSet<PreBarrieredScript, DefaultHasher<PreBarrieredScript>, SystemAllocPolicy>
|
||||
ScriptSet;
|
||||
ScriptSet *activeParallelEntryScripts_;
|
||||
|
||||
JitCode *generateStringConcatStub(JSContext *cx, ExecutionMode mode);
|
||||
|
Loading…
Reference in New Issue
Block a user