#pragma once
#include "OptionsList.h"
#include <wtf/WTFConfig.h>
namespace JSC {
class ExecutableAllocator;
class FixedVMPoolExecutableAllocator;
class VM;
constexpr size_t ConfigSizeToProtect = CeilingOnPageSize;
#if ENABLE(SEPARATED_WX_HEAP)
using JITWriteSeparateHeapsFunction = void (*)(off_t, const void*, size_t);
#endif
struct Config {
JS_EXPORT_PRIVATE static void disableFreezingForTesting();
JS_EXPORT_PRIVATE static void enableRestrictedOptions();
static void permanentlyFreeze() { WTF::Config::permanentlyFreeze(); }
static void configureForTesting()
{
disableFreezingForTesting();
enableRestrictedOptions();
}
bool isPermanentlyFrozen() { return g_wtfConfig.isPermanentlyFrozen; }
bool disabledFreezingForTesting;
bool restrictedOptionsEnabled;
bool jitDisabled;
bool initializeHasBeenCalled;
struct {
#if ASSERT_ENABLED
bool canUseJITIsSet;
#endif
bool canUseJIT;
} vm;
ExecutableAllocator* executableAllocator;
FixedVMPoolExecutableAllocator* fixedVMPoolExecutableAllocator;
void* startExecutableMemory;
void* endExecutableMemory;
uintptr_t startOfFixedWritableMemoryPool;
#if ENABLE(SEPARATED_WX_HEAP)
JITWriteSeparateHeapsFunction jitWriteSeparateHeaps;
#endif
OptionsStorage options;
void (*shellTimeoutCheckCallback)(VM&);
WTF::PtrTagLookup ptrTagLookupRecord;
};
constexpr size_t alignmentOfJSCConfig = std::alignment_of<JSC::Config>::value;
static_assert(WTF::offsetOfWTFConfigExtension + sizeof(JSC::Config) <= WTF::ConfigSizeToProtect);
static_assert(roundUpToMultipleOf<alignmentOfJSCConfig>(WTF::offsetOfWTFConfigExtension) == WTF::offsetOfWTFConfigExtension);
#define g_jscConfig (*bitwise_cast<JSC::Config*>(&g_wtfConfig.spaceForExtensions))
}