#ifndef jit_CompileWrappers_h
#define jit_CompileWrappers_h
#include "vm/JSContext.h"
namespace js {
namespace jit {
class JitRuntime;
class CompileRuntime {
JSRuntime* runtime();
public:
static CompileRuntime* get(JSRuntime* rt);
#ifdef JS_GC_ZEAL
const uint32_t* addressOfGCZealModeBits();
#endif
const JitRuntime* jitRuntime();
GeckoProfilerRuntime& geckoProfiler();
bool jitSupportsFloatingPoint();
bool hadOutOfMemory();
bool profilingScripts();
const JSAtomState& names();
const PropertyName* emptyString();
const StaticStrings& staticStrings();
const Value& NaNValue();
const Value& positiveInfinityValue();
const WellKnownSymbols& wellKnownSymbols();
const void* mainContextPtr();
uint32_t* addressOfTenuredAllocCount();
const void* addressOfJitStackLimit();
const void* addressOfInterruptBits();
const void* addressOfZone();
#ifdef DEBUG
bool isInsideNursery(gc::Cell* cell);
#endif
const DOMCallbacks* DOMcallbacks();
bool runtimeMatches(JSRuntime* rt);
};
class CompileZone {
Zone* zone();
public:
static CompileZone* get(Zone* zone);
CompileRuntime* runtime();
bool isAtomsZone();
#ifdef DEBUG
const void* addressOfIonBailAfter();
#endif
const uint32_t* addressOfNeedsIncrementalBarrier();
gc::FreeSpan** addressOfFreeList(gc::AllocKind allocKind);
void* addressOfNurseryPosition();
void* addressOfStringNurseryPosition();
const void* addressOfNurseryCurrentEnd();
const void* addressOfStringNurseryCurrentEnd();
uint32_t* addressOfNurseryAllocCount();
bool nurseryExists();
bool canNurseryAllocateStrings();
void setMinorGCShouldCancelIonCompilations();
};
class JitRealm;
class CompileRealm {
JS::Realm* realm();
public:
static CompileRealm* get(JS::Realm* realm);
CompileZone* zone();
CompileRuntime* runtime();
const void* realmPtr() { return realm(); }
const mozilla::non_crypto::XorShift128PlusRNG*
addressOfRandomNumberGenerator();
const JitRealm* jitRealm();
const GlobalObject* maybeGlobal();
const uint32_t* addressOfGlobalWriteBarriered();
bool hasAllocationMetadataBuilder();
void setSingletonsAsValues();
};
class JitCompileOptions {
public:
JitCompileOptions();
explicit JitCompileOptions(JSContext* cx);
bool cloneSingletons() const { return cloneSingletons_; }
bool profilerSlowAssertionsEnabled() const {
return profilerSlowAssertionsEnabled_;
}
bool offThreadCompilationAvailable() const {
return offThreadCompilationAvailable_;
}
private:
bool cloneSingletons_;
bool profilerSlowAssertionsEnabled_;
bool offThreadCompilationAvailable_;
};
} }
#endif