mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 23:37:33 +09:00
Assert GCRuntime::enter/leaveUnsafe region is main-thread only
This commit is contained in:
parent
37f37bd489
commit
fc206f5ab1
3 changed files with 8 additions and 6 deletions
|
|
@ -54,8 +54,6 @@ class JS_PUBLIC_API(ProfilingFrameIterator)
|
|||
// activation (if any) comes around.
|
||||
void* savedPrevJitTop_;
|
||||
|
||||
JS::AutoCheckCannotGC nogc_;
|
||||
|
||||
static const unsigned StorageSpace = 8 * sizeof(void*);
|
||||
mozilla::AlignedStorage<StorageSpace> storage_;
|
||||
js::wasm::ProfilingFrameIterator& wasmIter() {
|
||||
|
|
@ -139,7 +137,7 @@ class JS_PUBLIC_API(ProfilingFrameIterator)
|
|||
void iteratorConstruct();
|
||||
void iteratorDestroy();
|
||||
bool iteratorDone();
|
||||
};
|
||||
} JS_HAZ_GC_INVALIDATED;
|
||||
|
||||
JS_FRIEND_API(bool)
|
||||
IsProfilingEnabledForContext(JSContext* cx);
|
||||
|
|
|
|||
|
|
@ -714,13 +714,18 @@ class GCRuntime
|
|||
#endif // DEBUG
|
||||
|
||||
bool isInsideUnsafeRegion() { return inUnsafeRegion != 0; }
|
||||
void enterUnsafeRegion() { ++inUnsafeRegion; }
|
||||
void enterUnsafeRegion() {
|
||||
MOZ_ASSERT(CurrentThreadCanAccessRuntime(rt));
|
||||
++inUnsafeRegion;
|
||||
}
|
||||
void leaveUnsafeRegion() {
|
||||
MOZ_ASSERT(CurrentThreadCanAccessRuntime(rt));
|
||||
MOZ_ASSERT(inUnsafeRegion > 0);
|
||||
--inUnsafeRegion;
|
||||
}
|
||||
|
||||
void verifyIsSafeToGC() {
|
||||
MOZ_ASSERT(CurrentThreadCanAccessRuntime(rt));
|
||||
MOZ_DIAGNOSTIC_ASSERT(!isInsideUnsafeRegion(),
|
||||
"[AutoAssertNoGC] possible GC in GC-unsafe region");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1739,8 +1739,7 @@ JS::ProfilingFrameIterator::ProfilingFrameIterator(JSContext* cx, const Register
|
|||
: rt_(cx),
|
||||
sampleBufferGen_(sampleBufferGen),
|
||||
activation_(nullptr),
|
||||
savedPrevJitTop_(nullptr),
|
||||
nogc_(cx)
|
||||
savedPrevJitTop_(nullptr)
|
||||
{
|
||||
if (!cx->spsProfiler.enabled())
|
||||
MOZ_CRASH("ProfilingFrameIterator called when spsProfiler not enabled for runtime.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue