From c8f64af32821d1c346f911812b5a2a4d153af7bd Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Mon, 23 Jun 2014 10:12:12 +0200 Subject: [PATCH] Backed out changeset f35c977b4b21 (bug 1000182) for failing jit tests on a CLOSED TREE --- js/src/jit-test/tests/basic/bug1000182.js | 18 ------------------ js/src/jit/Ion.cpp | 11 ++++------- js/src/jit/JitCompartment.h | 3 +-- 3 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 js/src/jit-test/tests/basic/bug1000182.js diff --git a/js/src/jit-test/tests/basic/bug1000182.js b/js/src/jit-test/tests/basic/bug1000182.js deleted file mode 100644 index 64733639838..00000000000 --- a/js/src/jit-test/tests/basic/bug1000182.js +++ /dev/null @@ -1,18 +0,0 @@ -// |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) {}); -if (typeof oomAfterAllocations === "function") - oomAfterAllocations(4); diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp index 66d1cbbb193..ca416c0b7e8 100644 --- a/js/src/jit/Ion.cpp +++ b/js/src/jit/Ion.cpp @@ -531,17 +531,14 @@ JitCompartment::notifyOfActiveParallelEntryScript(JSContext *cx, HandleScript sc } if (!activeParallelEntryScripts_) { - ScriptSet *scripts = js_new(); - if (!scripts || !scripts->init()) { - js_delete(scripts); - js_ReportOutOfMemory(cx); + activeParallelEntryScripts_ = cx->new_(cx); + if (!activeParallelEntryScripts_ || !activeParallelEntryScripts_->init()) return false; - } - activeParallelEntryScripts_ = scripts; } script->parallelIonScript()->setIsParallelEntryScript(); - return activeParallelEntryScripts_->put(script); + ScriptSet::AddPtr p = activeParallelEntryScripts_->lookupForAdd(script); + return p || activeParallelEntryScripts_->add(p, script); } void diff --git a/js/src/jit/JitCompartment.h b/js/src/jit/JitCompartment.h index 531b3183e5e..a48a4e4ac2e 100644 --- a/js/src/jit/JitCompartment.h +++ b/js/src/jit/JitCompartment.h @@ -421,8 +421,7 @@ 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, SystemAllocPolicy> - ScriptSet; + typedef HashSet ScriptSet; ScriptSet *activeParallelEntryScripts_; JitCode *generateStringConcatStub(JSContext *cx, ExecutionMode mode);