Bug 1207827 - Fix OOM error in ARM64 simulator. r=nbp
☠☠ backed out by d3659c740f48 ☠ ☠
authorJakob Olesen <jolesen@mozilla.com>
Tue, 20 Oct 2015 12:57:38 -0700
changeset 303822 5e6973f92d22078b8cb4f81227114df37242391a
parent 303821 3175d41f0acf0d01699e5b8c1d433089a260e36c
child 303823 97050efd681eca7e99fd900279ba1dc052373de1
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1207827
milestone44.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
Bug 1207827 - Fix OOM error in ARM64 simulator. r=nbp
js/src/jit/arm64/vixl/MozSimulator-vixl.cpp
--- a/js/src/jit/arm64/vixl/MozSimulator-vixl.cpp
+++ b/js/src/jit/arm64/vixl/MozSimulator-vixl.cpp
@@ -337,21 +337,20 @@ class Redirection
     Redirection* current = sim->redirection();
     for (; current != nullptr; current = current->next_) {
       if (current->nativeFunction_ == nativeFunction) {
         VIXL_ASSERT(current->type() == type);
         return current;
       }
     }
 
+    js::AutoEnterOOMUnsafeRegion oomUnsafe;
     Redirection* redir = (Redirection*)js_malloc(sizeof(Redirection));
-    if (!redir) {
-      MOZ_ReportAssertionFailure("[unhandlable oom] Simulator redirection", __FILE__, __LINE__);
-      MOZ_CRASH();
-    }
+    if (!redir)
+        oomUnsafe.crash("Simulator redirection");
     new(redir) Redirection(nativeFunction, type, sim);
     return redir;
   }
 
   static const Redirection* FromSvcInstruction(const Instruction* svcInstruction) {
     const uint8_t* addrOfSvc = reinterpret_cast<const uint8_t*>(svcInstruction);
     const uint8_t* addrOfRedirection = addrOfSvc - offsetof(Redirection, svcInstruction_);
     return reinterpret_cast<const Redirection*>(addrOfRedirection);