Ignore:
Timestamp:
Sep 21, 2020, 3:01:12 PM (5 years ago)
Author:
[email protected]
Message:

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:

  1. 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

  1. Fixed cloop.rb so that it can take an offset for the leap offlineasm instruction.
  2. Fixed x86.rb so that it can take an offset for the leap offlineasm instruction.
  3. Fixed arm.rb so that it can take an offset for the leap offlineasm instruction.

Note: arm64.rb already does this right.

  1. 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).

  • llint/LLIntData.cpp:

(JSC::LLInt::LLIntInitializeAssertScope::LLIntInitializeAssertScope):
(JSC::LLInt::LLIntInitializeAssertScope::~LLIntInitializeAssertScope):
(JSC::LLInt::LLIntInitializeAssertScope::assertInitializationIsAllowed):
(JSC::LLInt::initialize):

  • llint/LLIntData.h:

(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):

  • runtime/JSCConfig.h:

Source/WTF:

  1. 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.
  1. 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):

  • wtf/WTFConfig.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/offlineasm/x86.rb

    r262389 r267371  
    575575            else
    576576                $asm.puts "lea #{dst.x86Operand(:ptr)}, #{src.asmLabel}"
     577            end
     578            if src.offset != 0
     579                $asm.puts "add#{x86Suffix(kind)} #{orderOperands(const(src.offset), dst.x86Operand(kind))}"
    577580            end
    578581        else
Note: See TracChangeset for help on using the changeset viewer.