mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 07:01:19 +00:00
bug 1562309 - 2. Convert ThreadData in JSContext to ContextData r=jonco
Convert ThreadData to ContextData in JSContext. Removed some old GCHelperState variables that are no longer being used. Removed NativeStackQuota, which is never read. Renamed SetNativeStackQuotaAndLimit to SetNativeStackLimit, as it is never setting a NativeStackQuota. Differential Revision: https://phabricator.services.mozilla.com/D36533 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
8cdabb80f5
commit
81780de567
@ -1356,10 +1356,8 @@ extern JS_PUBLIC_API const JSStringFinalizer* JS_GetExternalStringFinalizer(
|
||||
return str->asExternal().externalFinalizer();
|
||||
}
|
||||
|
||||
static void SetNativeStackQuotaAndLimit(JSContext* cx, JS::StackKind kind,
|
||||
size_t stackSize) {
|
||||
cx->nativeStackQuota[kind] = stackSize;
|
||||
|
||||
static void SetNativeStackLimit(JSContext* cx, JS::StackKind kind,
|
||||
size_t stackSize) {
|
||||
#if JS_STACK_GROWTH_DIRECTION > 0
|
||||
if (stackSize == 0) {
|
||||
cx->nativeStackLimit[kind] = UINTPTR_MAX;
|
||||
@ -1395,11 +1393,10 @@ JS_PUBLIC_API void JS_SetNativeStackQuota(JSContext* cx,
|
||||
MOZ_ASSERT(untrustedScriptStackSize < trustedScriptStackSize);
|
||||
}
|
||||
|
||||
SetNativeStackQuotaAndLimit(cx, JS::StackForSystemCode, systemCodeStackSize);
|
||||
SetNativeStackQuotaAndLimit(cx, JS::StackForTrustedScript,
|
||||
trustedScriptStackSize);
|
||||
SetNativeStackQuotaAndLimit(cx, JS::StackForUntrustedScript,
|
||||
untrustedScriptStackSize);
|
||||
SetNativeStackLimit(cx, JS::StackForSystemCode, systemCodeStackSize);
|
||||
SetNativeStackLimit(cx, JS::StackForTrustedScript, trustedScriptStackSize);
|
||||
SetNativeStackLimit(cx, JS::StackForUntrustedScript,
|
||||
untrustedScriptStackSize);
|
||||
|
||||
if (cx->isMainThreadContext()) {
|
||||
cx->initJitStackLimit();
|
||||
|
@ -1221,75 +1221,83 @@ mozilla::GenericErrorResult<JS::Error&> JSContext::alreadyReportedError() {
|
||||
JSContext::JSContext(JSRuntime* runtime, const JS::ContextOptions& options)
|
||||
: runtime_(runtime),
|
||||
kind_(ContextKind::HelperThread),
|
||||
options_(options),
|
||||
freeLists_(nullptr),
|
||||
defaultFreeOp_(runtime, true),
|
||||
jitActivation(nullptr),
|
||||
activation_(nullptr),
|
||||
nurserySuppressions_(this),
|
||||
options_(this, options),
|
||||
freeLists_(this, nullptr),
|
||||
atomsZoneFreeLists_(this),
|
||||
defaultFreeOp_(this, runtime, true),
|
||||
jitActivation(this, nullptr),
|
||||
regexpStack(this),
|
||||
activation_(this, nullptr),
|
||||
profilingActivation_(nullptr),
|
||||
nativeStackBase(GetNativeStackBase()),
|
||||
entryMonitor(nullptr),
|
||||
noExecuteDebuggerTop(nullptr),
|
||||
entryMonitor(this, nullptr),
|
||||
noExecuteDebuggerTop(this, nullptr),
|
||||
#ifdef DEBUG
|
||||
inUnsafeCallWithABI(false),
|
||||
hasAutoUnsafeCallWithABI(false),
|
||||
inUnsafeCallWithABI(this, false),
|
||||
hasAutoUnsafeCallWithABI(this, false),
|
||||
#endif
|
||||
#ifdef JS_SIMULATOR
|
||||
simulator_(nullptr),
|
||||
simulator_(this, nullptr),
|
||||
#endif
|
||||
#ifdef JS_TRACE_LOGGING
|
||||
traceLogger(nullptr),
|
||||
#endif
|
||||
autoFlushICache_(nullptr),
|
||||
dtoaState(nullptr),
|
||||
suppressGC(0),
|
||||
autoFlushICache_(this, nullptr),
|
||||
dtoaState(this, nullptr),
|
||||
suppressGC(this, 0),
|
||||
#ifdef DEBUG
|
||||
ionCompiling(false),
|
||||
ionCompilingSafeForMinorGC(false),
|
||||
performingGC(false),
|
||||
gcSweeping(false),
|
||||
gcHelperStateThread(false),
|
||||
isTouchingGrayThings(false),
|
||||
noNurseryAllocationCheck(0),
|
||||
disableStrictProxyCheckingCount(0),
|
||||
ionCompiling(this, false),
|
||||
ionCompilingSafeForMinorGC(this, false),
|
||||
performingGC(this, false),
|
||||
gcSweeping(this, false),
|
||||
isTouchingGrayThings(this, false),
|
||||
noNurseryAllocationCheck(this, 0),
|
||||
disableStrictProxyCheckingCount(this, 0),
|
||||
#endif
|
||||
#if defined(DEBUG) || defined(JS_OOM_BREAKPOINT)
|
||||
runningOOMTest(false),
|
||||
runningOOMTest(this, false),
|
||||
#endif
|
||||
enableAccessValidation(false),
|
||||
inUnsafeRegion(0),
|
||||
generationalDisabled(0),
|
||||
compactingDisabledCount(0),
|
||||
enableAccessValidation(this, false),
|
||||
inUnsafeRegion(this, 0),
|
||||
generationalDisabled(this, 0),
|
||||
compactingDisabledCount(this, 0),
|
||||
frontendCollectionPool_(this),
|
||||
suppressProfilerSampling(false),
|
||||
wasmTriedToInstallSignalHandlers(false),
|
||||
wasmHaveSignalHandlers(false),
|
||||
tempLifoAlloc_((size_t)TEMP_LIFO_ALLOC_PRIMARY_CHUNK_SIZE),
|
||||
debuggerMutations(0),
|
||||
ionPcScriptCache(nullptr),
|
||||
throwing(false),
|
||||
overRecursed_(false),
|
||||
propagatingForcedReturn_(false),
|
||||
liveVolatileJitFrameIter_(nullptr),
|
||||
reportGranularity(JS_DEFAULT_JITREPORT_GRANULARITY),
|
||||
resolvingList(nullptr),
|
||||
tempLifoAlloc_(this, (size_t)TEMP_LIFO_ALLOC_PRIMARY_CHUNK_SIZE),
|
||||
debuggerMutations(this, 0),
|
||||
ionPcScriptCache(this, nullptr),
|
||||
throwing(this, false),
|
||||
unwrappedException_(this),
|
||||
unwrappedExceptionStack_(this),
|
||||
overRecursed_(this, false),
|
||||
propagatingForcedReturn_(this, false),
|
||||
liveVolatileJitFrameIter_(this, nullptr),
|
||||
reportGranularity(this, JS_DEFAULT_JITREPORT_GRANULARITY),
|
||||
resolvingList(this, nullptr),
|
||||
#ifdef DEBUG
|
||||
enteredPolicy(nullptr),
|
||||
enteredPolicy(this, nullptr),
|
||||
#endif
|
||||
generatingError(false),
|
||||
cycleDetectorVector_(this),
|
||||
generatingError(this, false),
|
||||
cycleDetectorVector_(this, this),
|
||||
data(nullptr),
|
||||
asyncCauseForNewActivations(nullptr),
|
||||
asyncCallIsExplicit(false),
|
||||
interruptCallbackDisabled(false),
|
||||
asyncStackForNewActivations_(this),
|
||||
asyncCauseForNewActivations(this, nullptr),
|
||||
asyncCallIsExplicit(this, false),
|
||||
interruptCallbacks_(this),
|
||||
interruptCallbackDisabled(this, false),
|
||||
interruptBits_(0),
|
||||
osrTempData_(nullptr),
|
||||
ionReturnOverride_(MagicValue(JS_ARG_POISON)),
|
||||
osrTempData_(this, nullptr),
|
||||
ionReturnOverride_(this, MagicValue(JS_ARG_POISON)),
|
||||
jitStackLimit(UINTPTR_MAX),
|
||||
jitStackLimitNoInterrupt(UINTPTR_MAX),
|
||||
jobQueue(nullptr),
|
||||
canSkipEnqueuingJobs(false),
|
||||
promiseRejectionTrackerCallback(nullptr),
|
||||
promiseRejectionTrackerCallbackData(nullptr)
|
||||
jitStackLimitNoInterrupt(this, UINTPTR_MAX),
|
||||
jobQueue(this, nullptr),
|
||||
internalJobQueue(this),
|
||||
canSkipEnqueuingJobs(this, false),
|
||||
promiseRejectionTrackerCallback(this, nullptr),
|
||||
promiseRejectionTrackerCallbackData(this, nullptr)
|
||||
#ifdef JS_STRUCTURED_SPEW
|
||||
,
|
||||
structuredSpewer_()
|
||||
@ -1300,10 +1308,6 @@ JSContext::JSContext(JSRuntime* runtime, const JS::ContextOptions& options)
|
||||
|
||||
MOZ_ASSERT(!TlsContext.get());
|
||||
TlsContext.set(this);
|
||||
|
||||
for (size_t i = 0; i < mozilla::ArrayLength(nativeStackQuota); i++) {
|
||||
nativeStackQuota[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
JSContext::~JSContext() {
|
||||
|
@ -159,12 +159,12 @@ struct JSContext : public JS::RootingContext,
|
||||
js::WriteOnceData<js::ContextKind> kind_;
|
||||
|
||||
friend class js::gc::AutoSuppressNurseryCellAlloc;
|
||||
js::ThreadData<size_t> nurserySuppressions_;
|
||||
js::ContextData<size_t> nurserySuppressions_;
|
||||
|
||||
js::ThreadData<JS::ContextOptions> options_;
|
||||
js::ContextData<JS::ContextOptions> options_;
|
||||
|
||||
// Free lists for allocating in the current zone.
|
||||
js::ThreadData<js::gc::FreeLists*> freeLists_;
|
||||
js::ContextData<js::gc::FreeLists*> freeLists_;
|
||||
|
||||
// This is reset each time we switch zone, then added to the variable in the
|
||||
// zone when we switch away from it. This would be a js::ThreadData but we
|
||||
@ -172,9 +172,9 @@ struct JSContext : public JS::RootingContext,
|
||||
uint32_t allocsThisZoneSinceMinorGC_;
|
||||
|
||||
// Free lists for parallel allocation in the atoms zone on helper threads.
|
||||
js::ThreadData<js::gc::FreeLists*> atomsZoneFreeLists_;
|
||||
js::ContextData<js::gc::FreeLists*> atomsZoneFreeLists_;
|
||||
|
||||
js::ThreadData<js::FreeOp> defaultFreeOp_;
|
||||
js::ContextData<js::FreeOp> defaultFreeOp_;
|
||||
|
||||
js::ParseTask* parseTask_;
|
||||
|
||||
@ -432,17 +432,17 @@ struct JSContext : public JS::RootingContext,
|
||||
* Points to the most recent JitActivation pushed on the thread.
|
||||
* See JitActivation constructor in vm/Stack.cpp
|
||||
*/
|
||||
js::ThreadData<js::jit::JitActivation*> jitActivation;
|
||||
js::ContextData<js::jit::JitActivation*> jitActivation;
|
||||
|
||||
// Information about the heap allocated backtrack stack used by RegExp JIT
|
||||
// code.
|
||||
js::ThreadData<js::irregexp::RegExpStack> regexpStack;
|
||||
js::ContextData<js::irregexp::RegExpStack> regexpStack;
|
||||
|
||||
/*
|
||||
* Points to the most recent activation running on the thread.
|
||||
* See Activation comment in vm/Stack.h.
|
||||
*/
|
||||
js::ThreadData<js::Activation*> activation_;
|
||||
js::ContextData<js::Activation*> activation_;
|
||||
|
||||
/*
|
||||
* Points to the most recent profiling activation running on the
|
||||
@ -479,12 +479,9 @@ struct JSContext : public JS::RootingContext,
|
||||
/* Base address of the native stack for the current thread. */
|
||||
const uintptr_t nativeStackBase;
|
||||
|
||||
/* The native stack size limit that runtime should not exceed. */
|
||||
js::ThreadData<size_t> nativeStackQuota[JS::StackKindCount];
|
||||
|
||||
public:
|
||||
/* If non-null, report JavaScript entry points to this monitor. */
|
||||
js::ThreadData<JS::dbg::AutoEntryMonitor*> entryMonitor;
|
||||
js::ContextData<JS::dbg::AutoEntryMonitor*> entryMonitor;
|
||||
|
||||
/*
|
||||
* Stack of debuggers that currently disallow debuggee execution.
|
||||
@ -493,16 +490,16 @@ struct JSContext : public JS::RootingContext,
|
||||
* stack of Debuggers that have prevented execution need to be tracked to
|
||||
* enter the correct Debugger compartment to report the error.
|
||||
*/
|
||||
js::ThreadData<js::EnterDebuggeeNoExecute*> noExecuteDebuggerTop;
|
||||
js::ContextData<js::EnterDebuggeeNoExecute*> noExecuteDebuggerTop;
|
||||
|
||||
#ifdef DEBUG
|
||||
js::ThreadData<uint32_t> inUnsafeCallWithABI;
|
||||
js::ThreadData<bool> hasAutoUnsafeCallWithABI;
|
||||
js::ContextData<uint32_t> inUnsafeCallWithABI;
|
||||
js::ContextData<bool> hasAutoUnsafeCallWithABI;
|
||||
#endif
|
||||
|
||||
#ifdef JS_SIMULATOR
|
||||
private:
|
||||
js::ThreadData<js::jit::Simulator*> simulator_;
|
||||
js::ContextData<js::jit::Simulator*> simulator_;
|
||||
|
||||
public:
|
||||
js::jit::Simulator* simulator() const;
|
||||
@ -515,14 +512,14 @@ struct JSContext : public JS::RootingContext,
|
||||
|
||||
private:
|
||||
/* Pointer to the current AutoFlushICache. */
|
||||
js::ThreadData<js::jit::AutoFlushICache*> autoFlushICache_;
|
||||
js::ContextData<js::jit::AutoFlushICache*> autoFlushICache_;
|
||||
|
||||
public:
|
||||
js::jit::AutoFlushICache* autoFlushICache() const;
|
||||
void setAutoFlushICache(js::jit::AutoFlushICache* afc);
|
||||
|
||||
// State used by util/DoubleToString.cpp.
|
||||
js::ThreadData<DtoaState*> dtoaState;
|
||||
js::ContextData<DtoaState*> dtoaState;
|
||||
|
||||
/*
|
||||
* When this flag is non-zero, any attempt to GC will be skipped. It is used
|
||||
@ -532,36 +529,32 @@ struct JSContext : public JS::RootingContext,
|
||||
* extremely dangerous and should only be used when in an OOM situation or
|
||||
* in non-exposed debugging facilities.
|
||||
*/
|
||||
js::ThreadData<int32_t> suppressGC;
|
||||
js::ContextData<int32_t> suppressGC;
|
||||
|
||||
#ifdef DEBUG
|
||||
// Whether this thread is actively Ion compiling.
|
||||
js::ThreadData<bool> ionCompiling;
|
||||
js::ContextData<bool> ionCompiling;
|
||||
|
||||
// Whether this thread is actively Ion compiling in a context where a minor
|
||||
// GC could happen simultaneously. If this is true, this thread cannot use
|
||||
// any pointers into the nursery.
|
||||
js::ThreadData<bool> ionCompilingSafeForMinorGC;
|
||||
js::ContextData<bool> ionCompilingSafeForMinorGC;
|
||||
|
||||
// Whether this thread is currently performing GC. This thread could be the
|
||||
// main thread or a helper thread while the main thread is running the
|
||||
// collector.
|
||||
js::ThreadData<bool> performingGC;
|
||||
js::ContextData<bool> performingGC;
|
||||
|
||||
// Whether this thread is currently sweeping GC things. This thread could
|
||||
// be the main thread or a helper thread while the main thread is running
|
||||
// the mutator. This is used to assert that destruction of GCPtr only
|
||||
// happens when we are sweeping.
|
||||
js::ThreadData<bool> gcSweeping;
|
||||
|
||||
// Whether this thread is performing work in the background for a runtime's
|
||||
// GCHelperState.
|
||||
js::ThreadData<bool> gcHelperStateThread;
|
||||
js::ContextData<bool> gcSweeping;
|
||||
|
||||
// Whether this thread is currently manipulating possibly-gray GC things.
|
||||
js::ThreadData<size_t> isTouchingGrayThings;
|
||||
js::ContextData<size_t> isTouchingGrayThings;
|
||||
|
||||
js::ThreadData<size_t> noNurseryAllocationCheck;
|
||||
js::ContextData<size_t> noNurseryAllocationCheck;
|
||||
|
||||
/*
|
||||
* If this is 0, all cross-compartment proxies must be registered in the
|
||||
@ -569,7 +562,7 @@ struct JSContext : public JS::RootingContext,
|
||||
* new wrappers. When non-zero, this records the recursion depth of wrapper
|
||||
* creation.
|
||||
*/
|
||||
js::ThreadData<uintptr_t> disableStrictProxyCheckingCount;
|
||||
js::ContextData<uintptr_t> disableStrictProxyCheckingCount;
|
||||
|
||||
bool isNurseryAllocAllowed() { return noNurseryAllocationCheck == 0; }
|
||||
void disallowNurseryAlloc() { ++noNurseryAllocationCheck; }
|
||||
@ -590,13 +583,13 @@ struct JSContext : public JS::RootingContext,
|
||||
|
||||
#if defined(DEBUG) || defined(JS_OOM_BREAKPOINT)
|
||||
// We are currently running a simulated OOM test.
|
||||
js::ThreadData<bool> runningOOMTest;
|
||||
js::ContextData<bool> runningOOMTest;
|
||||
#endif
|
||||
|
||||
// True if we should assert that
|
||||
// !comp->validAccessPtr || *comp->validAccessPtr
|
||||
// is true for every |comp| that we run JS code in.
|
||||
js::ThreadData<unsigned> enableAccessValidation;
|
||||
js::ContextData<unsigned> enableAccessValidation;
|
||||
|
||||
/*
|
||||
* Some regions of code are hard for the static rooting hazard analysis to
|
||||
@ -604,14 +597,14 @@ struct JSContext : public JS::RootingContext,
|
||||
* analysis. When this is non-zero, we should assert if we trigger, or
|
||||
* might trigger, a GC.
|
||||
*/
|
||||
js::ThreadData<int> inUnsafeRegion;
|
||||
js::ContextData<int> inUnsafeRegion;
|
||||
|
||||
// Count of AutoDisableGenerationalGC instances on the thread's stack.
|
||||
js::ThreadData<unsigned> generationalDisabled;
|
||||
js::ContextData<unsigned> generationalDisabled;
|
||||
|
||||
// Some code cannot tolerate compacting GC so it can be disabled temporarily
|
||||
// with AutoDisableCompactingGC which uses this counter.
|
||||
js::ThreadData<unsigned> compactingDisabledCount;
|
||||
js::ContextData<unsigned> compactingDisabledCount;
|
||||
|
||||
bool canCollectAtoms() const {
|
||||
// TODO: We may be able to improve this by collecting if
|
||||
@ -623,7 +616,7 @@ struct JSContext : public JS::RootingContext,
|
||||
// Pools used for recycling name maps and vectors when parsing and
|
||||
// emitting bytecode. Purged on GC when there are no active script
|
||||
// compilations.
|
||||
js::ThreadData<js::frontend::NameCollectionPool> frontendCollectionPool_;
|
||||
js::ContextData<js::frontend::NameCollectionPool> frontendCollectionPool_;
|
||||
|
||||
public:
|
||||
js::frontend::NameCollectionPool& frontendCollectionPool() {
|
||||
@ -655,23 +648,23 @@ struct JSContext : public JS::RootingContext,
|
||||
static const size_t TEMP_LIFO_ALLOC_PRIMARY_CHUNK_SIZE = 4 * 1024;
|
||||
|
||||
private:
|
||||
js::ThreadData<js::LifoAlloc> tempLifoAlloc_;
|
||||
js::ContextData<js::LifoAlloc> tempLifoAlloc_;
|
||||
|
||||
public:
|
||||
js::LifoAlloc& tempLifoAlloc() { return tempLifoAlloc_.ref(); }
|
||||
const js::LifoAlloc& tempLifoAlloc() const { return tempLifoAlloc_.ref(); }
|
||||
|
||||
js::ThreadData<uint32_t> debuggerMutations;
|
||||
js::ContextData<uint32_t> debuggerMutations;
|
||||
|
||||
// Cache for jit::GetPcScript().
|
||||
js::ThreadData<js::UniquePtr<js::jit::PcScriptCache>> ionPcScriptCache;
|
||||
js::ContextData<js::UniquePtr<js::jit::PcScriptCache>> ionPcScriptCache;
|
||||
|
||||
private:
|
||||
/* Exception state -- the exception member is a GC root by definition. */
|
||||
js::ThreadData<bool> throwing; /* is there a pending exception? */
|
||||
js::ThreadData<JS::PersistentRooted<JS::Value>>
|
||||
js::ContextData<bool> throwing; /* is there a pending exception? */
|
||||
js::ContextData<JS::PersistentRooted<JS::Value>>
|
||||
unwrappedException_; /* most-recently-thrown exception */
|
||||
js::ThreadData<JS::PersistentRooted<js::SavedFrame*>>
|
||||
js::ContextData<JS::PersistentRooted<js::SavedFrame*>>
|
||||
unwrappedExceptionStack_; /* stack when the exception was thrown */
|
||||
|
||||
JS::Value& unwrappedException() {
|
||||
@ -690,32 +683,32 @@ struct JSContext : public JS::RootingContext,
|
||||
|
||||
// True if the exception currently being thrown is by result of
|
||||
// ReportOverRecursed. See Debugger::slowPathOnExceptionUnwind.
|
||||
js::ThreadData<bool> overRecursed_;
|
||||
js::ContextData<bool> overRecursed_;
|
||||
|
||||
// True if propagating a forced return from an interrupt handler during
|
||||
// debug mode.
|
||||
js::ThreadData<bool> propagatingForcedReturn_;
|
||||
js::ContextData<bool> propagatingForcedReturn_;
|
||||
|
||||
// A stack of live iterators that need to be updated in case of debug mode
|
||||
// OSR.
|
||||
js::ThreadData<js::jit::DebugModeOSRVolatileJitFrameIter*>
|
||||
js::ContextData<js::jit::DebugModeOSRVolatileJitFrameIter*>
|
||||
liveVolatileJitFrameIter_;
|
||||
|
||||
public:
|
||||
js::ThreadData<int32_t> reportGranularity; /* see vm/Probes.h */
|
||||
js::ContextData<int32_t> reportGranularity; /* see vm/Probes.h */
|
||||
|
||||
js::ThreadData<js::AutoResolving*> resolvingList;
|
||||
js::ContextData<js::AutoResolving*> resolvingList;
|
||||
|
||||
#ifdef DEBUG
|
||||
js::ThreadData<js::AutoEnterPolicy*> enteredPolicy;
|
||||
js::ContextData<js::AutoEnterPolicy*> enteredPolicy;
|
||||
#endif
|
||||
|
||||
/* True if generating an error, to prevent runaway recursion. */
|
||||
js::ThreadData<bool> generatingError;
|
||||
js::ContextData<bool> generatingError;
|
||||
|
||||
private:
|
||||
/* State for object and array toSource conversion. */
|
||||
js::ThreadData<js::AutoCycleDetector::Vector> cycleDetectorVector_;
|
||||
js::ContextData<js::AutoCycleDetector::Vector> cycleDetectorVector_;
|
||||
|
||||
public:
|
||||
js::AutoCycleDetector::Vector& cycleDetectorVector() {
|
||||
@ -746,7 +739,7 @@ struct JSContext : public JS::RootingContext,
|
||||
* New activations will reset this to nullptr on construction after getting
|
||||
* the current value, and will restore the previous value on destruction.
|
||||
*/
|
||||
js::ThreadData<JS::PersistentRooted<js::SavedFrame*>>
|
||||
js::ContextData<JS::PersistentRooted<js::SavedFrame*>>
|
||||
asyncStackForNewActivations_;
|
||||
|
||||
public:
|
||||
@ -760,13 +753,13 @@ struct JSContext : public JS::RootingContext,
|
||||
/*
|
||||
* Value of asyncCause to be attached to asyncStackForNewActivations.
|
||||
*/
|
||||
js::ThreadData<const char*> asyncCauseForNewActivations;
|
||||
js::ContextData<const char*> asyncCauseForNewActivations;
|
||||
|
||||
/*
|
||||
* True if the async call was explicitly requested, e.g. via
|
||||
* callFunctionWithAsyncStack.
|
||||
*/
|
||||
js::ThreadData<bool> asyncCallIsExplicit;
|
||||
js::ContextData<bool> asyncCallIsExplicit;
|
||||
|
||||
bool currentlyRunningInInterpreter() const {
|
||||
return activation()->isInterpreter();
|
||||
@ -847,14 +840,14 @@ struct JSContext : public JS::RootingContext,
|
||||
js::Vector<JSInterruptCallback, 2, js::SystemAllocPolicy>;
|
||||
|
||||
private:
|
||||
js::ThreadData<InterruptCallbackVector> interruptCallbacks_;
|
||||
js::ContextData<InterruptCallbackVector> interruptCallbacks_;
|
||||
|
||||
public:
|
||||
InterruptCallbackVector& interruptCallbacks() {
|
||||
return interruptCallbacks_.ref();
|
||||
}
|
||||
|
||||
js::ThreadData<bool> interruptCallbackDisabled;
|
||||
js::ContextData<bool> interruptCallbackDisabled;
|
||||
|
||||
// Bitfield storing InterruptReason values.
|
||||
mozilla::Atomic<uint32_t, mozilla::Relaxed,
|
||||
@ -908,7 +901,7 @@ struct JSContext : public JS::RootingContext,
|
||||
|
||||
// Buffer for OSR from baseline to Ion. To avoid holding on to this for
|
||||
// too long, it's also freed in EnterBaseline (after returning from JIT code).
|
||||
js::ThreadData<uint8_t*> osrTempData_;
|
||||
js::ContextData<uint8_t*> osrTempData_;
|
||||
|
||||
uint8_t* allocateOsrTempData(size_t size);
|
||||
void freeOsrTempData();
|
||||
@ -925,7 +918,7 @@ struct JSContext : public JS::RootingContext,
|
||||
// value that will be temporarily corrupt. This special override value is set
|
||||
// only in callVM() targets that are about to return *and* have invalidated
|
||||
// their callee.
|
||||
js::ThreadData<js::Value> ionReturnOverride_;
|
||||
js::ContextData<js::Value> ionReturnOverride_;
|
||||
|
||||
bool hasIonReturnOverride() const {
|
||||
return !ionReturnOverride_.ref().isMagic(JS_ARG_POISON);
|
||||
@ -946,7 +939,7 @@ struct JSContext : public JS::RootingContext,
|
||||
jitStackLimit;
|
||||
|
||||
// Like jitStackLimit, but not reset to trigger interrupts.
|
||||
js::ThreadData<uintptr_t> jitStackLimitNoInterrupt;
|
||||
js::ContextData<uintptr_t> jitStackLimitNoInterrupt;
|
||||
|
||||
// Queue of pending jobs as described in ES2016 section 8.4.
|
||||
//
|
||||
@ -955,20 +948,20 @@ struct JSContext : public JS::RootingContext,
|
||||
// JS::SetJobQueue, owned by the embedding, or
|
||||
// - our internal JobQueue implementation, established by calling
|
||||
// js::UseInternalJobQueues, owned by JSContext::internalJobQueue below.
|
||||
js::ThreadData<JS::JobQueue*> jobQueue;
|
||||
js::ContextData<JS::JobQueue*> jobQueue;
|
||||
|
||||
// If the embedding has called js::UseInternalJobQueues, this is the owning
|
||||
// pointer to our internal JobQueue implementation, which JSContext::jobQueue
|
||||
// borrows.
|
||||
js::ThreadData<js::UniquePtr<js::InternalJobQueue>> internalJobQueue;
|
||||
js::ContextData<js::UniquePtr<js::InternalJobQueue>> internalJobQueue;
|
||||
|
||||
// True if jobQueue is empty, or we are running the last job in the queue.
|
||||
// Such conditions permit optimizations around `await` expressions.
|
||||
js::ThreadData<bool> canSkipEnqueuingJobs;
|
||||
js::ContextData<bool> canSkipEnqueuingJobs;
|
||||
|
||||
js::ThreadData<JS::PromiseRejectionTrackerCallback>
|
||||
js::ContextData<JS::PromiseRejectionTrackerCallback>
|
||||
promiseRejectionTrackerCallback;
|
||||
js::ThreadData<void*> promiseRejectionTrackerCallbackData;
|
||||
js::ContextData<void*> promiseRejectionTrackerCallbackData;
|
||||
|
||||
JSObject* getIncumbentGlobal(JSContext* cx);
|
||||
bool enqueuePromiseJob(JSContext* cx, js::HandleFunction job,
|
||||
|
Loading…
x
Reference in New Issue
Block a user