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/cloop.rb

    r252422 r267371  
    1 # Copyright (C) 2012-2019 Apple Inc. All rights reserved.
     1# Copyright (C) 2012-2020 Apple Inc. All rights reserved.
    22#
    33# Redistribution and use in source and binary forms, with or without
     
    334334    def cloopEmitLea(destination, type)
    335335        $asm.putc "#{destination.clLValue(:voidPtr)} = CAST<void*>(&#{cLabel});"
     336        if offset != 0
     337            $asm.putc "#{destination.clLValue(:int8Ptr)} = #{destination.clValue(:int8Ptr)} + #{offset};"
     338        end
    336339    end
    337340end
     
    345348    def cloopEmitLea(destination, type)
    346349        if destination == base
    347             $asm.putc "#{destination.clLValue(:int8Ptr)} += #{offset.clValue(type)};"
     350            $asm.putc "#{destination.clLValue(:int8Ptr)} = #{destination.clValue(:int8Ptr)} + #{offset.clValue(type)};"
    348351        else
    349352            $asm.putc "#{destination.clLValue(:int8Ptr)} = #{base.clValue(:int8Ptr)} + #{offset.clValue(type)};"
Note: See TracChangeset for help on using the changeset viewer.