mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1212430 - Remove CrashAtUnhandlableOOM() and replace with AutoEnterOOMUnsafeRegion r=jandem
This commit is contained in:
parent
0ae0f8e41a
commit
93caf76aac
@ -181,15 +181,10 @@ static inline bool ShouldFailWithOOM() { return false; }
|
||||
|
||||
namespace js {
|
||||
|
||||
MOZ_NORETURN MOZ_COLD void
|
||||
CrashAtUnhandlableOOM(const char* reason);
|
||||
|
||||
/* Disable OOM testing in sections which are not OOM safe. */
|
||||
struct MOZ_RAII AutoEnterOOMUnsafeRegion
|
||||
{
|
||||
void crash(const char* reason) {
|
||||
CrashAtUnhandlableOOM(reason);
|
||||
}
|
||||
MOZ_NORETURN MOZ_COLD void crash(const char* reason);
|
||||
|
||||
#if defined(DEBUG) || defined(JS_OOM_BREAKPOINT)
|
||||
AutoEnterOOMUnsafeRegion()
|
||||
|
@ -952,7 +952,7 @@ Statistics::beginSlice(const ZoneGCStats& zoneStats, JSGCInvocationKind gckind,
|
||||
|
||||
SliceData data(budget, reason, PRMJ_Now(), JS_GetCurrentEmbedderTime(), GetPageFaultCount());
|
||||
if (!slices.append(data)) {
|
||||
// OOM testing fails if we CrashAtUnhandlableOOM here.
|
||||
// OOM testing fails if we crash here, so set a flag instead.
|
||||
aborted = true;
|
||||
return;
|
||||
}
|
||||
|
@ -2031,7 +2031,7 @@ SnapshotIterator::maybeRead(const RValueAllocation& a, MaybeReadFallback& fallba
|
||||
|
||||
if (fallback.canRecoverResults()) {
|
||||
if (!initInstructionResults(fallback))
|
||||
js::CrashAtUnhandlableOOM("Unable to recover allocations.");
|
||||
MOZ_CRASH("Unable to recover allocations.");
|
||||
|
||||
if (allocationReadable(a))
|
||||
return allocationValue(a);
|
||||
|
@ -993,7 +993,7 @@ class BOffImm
|
||||
{
|
||||
MOZ_ASSERT((offset & 0x3) == 0);
|
||||
if (!IsInRange(offset))
|
||||
CrashAtUnhandlableOOM("BOffImm");
|
||||
MOZ_CRASH("BOffImm offset out of range");
|
||||
}
|
||||
|
||||
explicit BOffImm()
|
||||
|
@ -1199,13 +1199,15 @@ JS::AutoCheckRequestDepth::~AutoCheckRequestDepth()
|
||||
#endif
|
||||
|
||||
#ifdef JS_CRASH_DIAGNOSTICS
|
||||
void CompartmentChecker::check(InterpreterFrame* fp)
|
||||
void
|
||||
CompartmentChecker::check(InterpreterFrame* fp)
|
||||
{
|
||||
if (fp)
|
||||
check(fp->scopeChain());
|
||||
}
|
||||
|
||||
void CompartmentChecker::check(AbstractFramePtr frame)
|
||||
void
|
||||
CompartmentChecker::check(AbstractFramePtr frame)
|
||||
{
|
||||
if (frame)
|
||||
check(frame.scopeChain());
|
||||
@ -1213,7 +1215,7 @@ void CompartmentChecker::check(AbstractFramePtr frame)
|
||||
#endif
|
||||
|
||||
void
|
||||
js::CrashAtUnhandlableOOM(const char* reason)
|
||||
AutoEnterOOMUnsafeRegion::crash(const char* reason)
|
||||
{
|
||||
char msgbuf[1024];
|
||||
JS_snprintf(msgbuf, sizeof(msgbuf), "[unhandlable oom] %s", reason);
|
||||
|
Loading…
Reference in New Issue
Block a user