author | Jan de Mooij <jdemooij@mozilla.com> |
Wed, 30 Dec 2015 13:27:09 +0100 | |
changeset 277888 | 350fbdbad784715d2e36a4dcb3eb7d89002033e2 |
parent 277887 | fcd8d385410805aa3fadc7f027c478f65cda7dbc |
child 277889 | 27b9d60e819cce5f20de8a0c48b1aa40522c7dd2 |
push id | 69631 |
push user | jandemooij@gmail.com |
push date | Wed, 30 Dec 2015 12:31:30 +0000 |
treeherder | mozilla-inbound@27b9d60e819c [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | bhackett |
bugs | 1221385 |
milestone | 46.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/js/src/jscompartment.cpp +++ b/js/src/jscompartment.cpp @@ -163,29 +163,22 @@ JSRuntime::createJitRuntime(JSContext* c return nullptr; // Protect jitRuntime_ from being observed (by InterruptRunningJitCode) // while it is being initialized. Unfortunately, initialization depends on // jitRuntime_ being non-null, so we can't just wait to assign jitRuntime_. JitRuntime::AutoPreventBackedgePatching apbp(cx->runtime(), jrt); jitRuntime_ = jrt; + AutoEnterOOMUnsafeRegion noOOM; if (!jitRuntime_->initialize(cx)) { - ReportOutOfMemory(cx); - - js_delete(jitRuntime_); - jitRuntime_ = nullptr; - - JSCompartment* comp = cx->runtime()->atomsCompartment(); - if (comp->jitCompartment_) { - js_delete(comp->jitCompartment_); - comp->jitCompartment_ = nullptr; - } - - return nullptr; + // Handling OOM here is complicated: if we delete jitRuntime_ now, we + // will destroy the ExecutableAllocator, even though there may still be + // JitCode instances holding references to ExecutablePools. + noOOM.crash("OOM in createJitRuntime"); } return jitRuntime_; } bool JSCompartment::ensureJitCompartmentExists(JSContext* cx) {