Move some LLInt globals into JSC::Config.
https://bugs.webkit.org/show_bug.cgi?id=216685
rdar://68964544
Reviewed by Keith Miller.
Source/bmalloc:
Introduce ConfigAlignment to match WTFConfig.h.
Added BENABLE(UNIFIED_AND_FREEZABLE_CONFIG_RECORD) support to match WTF.
- bmalloc/BPlatform.h:
- bmalloc/Gigacage.cpp:
(Gigacage::ensureGigacage):
- bmalloc/GigacageConfig.h:
- bmalloc/mbmalloc.cpp:
Source/JavaScriptCore:
- Moved the following into g_jscConfig:
Data::s_exceptionInstructions ==> g_jscConfig.llint.exceptionInstructions
Data::s_wasmExceptionInstructions ==> g_jscConfig.llint.wasmExceptionInstructions
g_opcodeMap ==> g_jscConfig.llint.opcodeMap
g_opcodeMapWide16 ==> g_jscConfig.llint.opcodeMapWide16
g_opcodeMapWide32 ==> g_jscConfig.llint.opcodeMapWide32
- Fixed cloop.rb so that it can take an offset for the leap offlineasm instruction.
- Fixed x86.rb so that it can take an offset for the leap offlineasm instruction.
- Fixed arm.rb so that it can take an offset for the leap offlineasm instruction.
Note: arm64.rb already does this right.
- Added JSC::Config::singleton() to return a reference to g_jscConfig.
This is useful when debugging with lldb since g_jscConfig is not an actual
label, but is a macro that computes the address of the Config record.
This patch has been smoke tested on arm64e, x86_64, and cloop (on x86_64 and armv7k).
(JSC::LLInt::LLIntInitializeAssertScope::LLIntInitializeAssertScope):
(JSC::LLInt::LLIntInitializeAssertScope::~LLIntInitializeAssertScope):
(JSC::LLInt::LLIntInitializeAssertScope::assertInitializationIsAllowed):
(JSC::LLInt::initialize):
(JSC::LLInt::exceptionInstructions):
(JSC::LLInt::wasmExceptionInstructions):
(JSC::LLInt::opcodeMap):
(JSC::LLInt::opcodeMapWide16):
(JSC::LLInt::opcodeMapWide32):
(JSC::LLInt::getOpcode):
(JSC::LLInt::getOpcodeWide16):
(JSC::LLInt::getOpcodeWide32):
- llint/LowLevelInterpreter.asm:
- llint/LowLevelInterpreter.cpp:
- llint/LowLevelInterpreter64.asm:
- llint/WebAssembly.asm:
- offlineasm/arm.rb:
- offlineasm/cloop.rb:
- offlineasm/x86.rb:
- runtime/JSCConfig.cpp:
(JSC::Config::singleton):
Source/WTF:
- Introduce ConfigAlignment as a distinct value from ConfigSizeToProtect.
This is because ConfigSizeToProtect is now larger than 1 CeilingOnPageSize on
some platforms, but ConfigAlignment only needs to match CeilingOnPageSize.
- Introduced ENABLE(UNIFIED_AND_FREEZABLE_CONFIG_RECORD) to disable using the
unified g_config record for Windows ports.
This is needed because WTF is built as a DLL on Windows. offlineasm does not
know how to resolve a DLL exported variable. Additionally, the Windows ports
have never supported freezing of the Config record to begin with. So, we're
working around this by disabling ENABLE(UNIFIED_AND_FREEZABLE_CONFIG_RECORD)
for Windows. This allows JSC to have its own g_jscConfig record, which solves
this issue for now.
- wtf/PlatformEnable.h:
- wtf/WTFConfig.cpp:
(WTF::Config::permanentlyFreeze):