Bug 1518181 - IonAssemblerBufferWithConstantPools skip no-pool constraints after running out-of-memory. r=sstangl
authorNicolas B. Pierron <nicolas.b.pierron@nbp.name>
Mon, 07 Jan 2019 19:14:56 +0100
changeset 510013 d949e9cf60ab5852a24d43f737279709c9a257b5
parent 510012 752c683e631d73518b21da4b0924ac80ce1f6d5f
child 510014 1f7a8905fa7cf88143161cb9c65ca69cb1daec65
child 510038 11bcaa1ae0240696119ad1c74709ff3ac5bee3d4
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssstangl
bugs1518181
milestone66.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 1518181 - IonAssemblerBufferWithConstantPools skip no-pool constraints after running out-of-memory. r=sstangl When running out-of-memory, we are no longer allowed to read the content of the MacroAssembler buffer, as such we can safely ignore the soundness of the enterNoPool and leaveNoPool scopes if we ran out of memory.
js/src/jit/shared/IonAssemblerBufferWithConstantPools.h
--- a/js/src/jit/shared/IonAssemblerBufferWithConstantPools.h
+++ b/js/src/jit/shared/IonAssemblerBufferWithConstantPools.h
@@ -1048,16 +1048,19 @@ struct AssemblerBufferWithConstantPools
     if (this->oom()) {
       return;
     }
     JitSpew(JitSpew_Pools, "[%d] Requesting a pool flush", id);
     finishPool();
   }
 
   void enterNoPool(size_t maxInst) {
+    if (this->oom()) {
+      return;
+    }
     // Don't allow re-entry.
     MOZ_ASSERT(!canNotPlacePool_);
     insertNopFill();
 
     // Check if the pool will spill by adding maxInst instructions, and if
     // so then finish the pool before entering the no-pool region. It is
     // assumed that no pool entries are allocated in a no-pool region and
     // this is asserted when allocating entries.
@@ -1073,16 +1076,20 @@ struct AssemblerBufferWithConstantPools
     canNotPlacePoolStartOffset_ = this->nextOffset().getOffset();
     canNotPlacePoolMaxInst_ = maxInst;
 #endif
 
     canNotPlacePool_ = true;
   }
 
   void leaveNoPool() {
+    if (this->oom()) {
+      canNotPlacePool_ = false;
+      return;
+    }
     MOZ_ASSERT(canNotPlacePool_);
     canNotPlacePool_ = false;
 
     // Validate the maxInst argument supplied to enterNoPool().
     MOZ_ASSERT(this->nextOffset().getOffset() - canNotPlacePoolStartOffset_ <=
                canNotPlacePoolMaxInst_ * InstSize);
   }