⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243312 in webkit


Ignore:
Timestamp:
Mar 21, 2019, 12:14:12 PM (7 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Do not create JIT related data under non-JIT mode
https://bugs.webkit.org/show_bug.cgi?id=195982

Reviewed by Mark Lam.

We avoid creations of JIT related data structures under non-JIT mode.
This patch removes the following allocations.

  1. JITThunks
  2. FTLThunks
  3. FixedVMPoolExecutableAllocator
  4. noJITValueProfileSingleton since it is no longer used
  5. ARM disassembler should be initialized when it is used
  6. Wasm related data structures are accidentally allocated if VM::canUseJIT() == false && Options::useWebAssembly() == true. Add Wasm::isSupported() function to check the both conditions.
  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • heap/Heap.cpp:

(JSC::Heap::runEndPhase):

  • jit/ExecutableAllocator.cpp:

(JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator):
(JSC::ExecutableAllocator::initializeUnderlyingAllocator):
(JSC::ExecutableAllocator::isValid const):
(JSC::ExecutableAllocator::underMemoryPressure):
(JSC::ExecutableAllocator::memoryPressureMultiplier):
(JSC::ExecutableAllocator::allocate):
(JSC::ExecutableAllocator::isValidExecutableMemory):
(JSC::ExecutableAllocator::getLock const):
(JSC::ExecutableAllocator::committedByteCount):
(JSC::ExecutableAllocator::dumpProfile):
(JSC::startOfFixedExecutableMemoryPoolImpl):
(JSC::endOfFixedExecutableMemoryPoolImpl):
(JSC::ExecutableAllocator::initialize):
(JSC::ExecutableAllocator::initializeAllocator): Deleted.
(JSC::ExecutableAllocator::ExecutableAllocator): Deleted.
(JSC::ExecutableAllocator::~ExecutableAllocator): Deleted.

  • jit/ExecutableAllocator.h:

(JSC::ExecutableAllocatorBase::isValid const):
(JSC::ExecutableAllocatorBase::underMemoryPressure):
(JSC::ExecutableAllocatorBase::memoryPressureMultiplier):
(JSC::ExecutableAllocatorBase::dumpProfile):
(JSC::ExecutableAllocatorBase::allocate):
(JSC::ExecutableAllocatorBase::setJITEnabled):
(JSC::ExecutableAllocatorBase::isValidExecutableMemory):
(JSC::ExecutableAllocatorBase::committedByteCount):
(JSC::ExecutableAllocatorBase::getLock const):
(JSC::ExecutableAllocator::isValid const): Deleted.
(JSC::ExecutableAllocator::underMemoryPressure): Deleted.
(JSC::ExecutableAllocator::memoryPressureMultiplier): Deleted.
(JSC::ExecutableAllocator::allocate): Deleted.
(JSC::ExecutableAllocator::setJITEnabled): Deleted.
(JSC::ExecutableAllocator::isValidExecutableMemory): Deleted.
(JSC::ExecutableAllocator::committedByteCount): Deleted.
(JSC::ExecutableAllocator::getLock const): Deleted.

  • jsc.cpp:

(functionWebAssemblyMemoryMode):

  • runtime/InitializeThreading.cpp:

(JSC::initializeThreading):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::init):

  • runtime/JSLock.cpp:

(JSC::JSLock::didAcquireLock):

  • runtime/Options.cpp:

(JSC::recomputeDependentOptions):

  • runtime/VM.cpp:

(JSC::enableAssembler):
(JSC::VM::canUseAssembler):
(JSC::VM::VM):

  • runtime/VM.h:
  • wasm/WasmCapabilities.h: Added.

(JSC::Wasm::isSupported):

  • wasm/WasmFaultSignalHandler.cpp:

(JSC::Wasm::enableFastMemory):

Location:
trunk/Source/JavaScriptCore
Files:
1 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r243279 r243312  
    978978    runtime/WriteBarrierInlines.h
    979979
     980    wasm/WasmCapabilities.h
    980981    wasm/WasmCodeBlock.h
    981982    wasm/WasmContext.h
  • trunk/Source/JavaScriptCore/ChangeLog

    r243311 r243312  
     12019-03-21  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Do not create JIT related data under non-JIT mode
     4        https://bugs.webkit.org/show_bug.cgi?id=195982
     5
     6        Reviewed by Mark Lam.
     7
     8        We avoid creations of JIT related data structures under non-JIT mode.
     9        This patch removes the following allocations.
     10
     11        1. JITThunks
     12        2. FTLThunks
     13        3. FixedVMPoolExecutableAllocator
     14        4. noJITValueProfileSingleton since it is no longer used
     15        5. ARM disassembler should be initialized when it is used
     16        6. Wasm related data structures are accidentally allocated if VM::canUseJIT() == false &&
     17           Options::useWebAssembly() == true. Add Wasm::isSupported() function to check the both conditions.
     18
     19        * CMakeLists.txt:
     20        * JavaScriptCore.xcodeproj/project.pbxproj:
     21        * heap/Heap.cpp:
     22        (JSC::Heap::runEndPhase):
     23        * jit/ExecutableAllocator.cpp:
     24        (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator):
     25        (JSC::ExecutableAllocator::initializeUnderlyingAllocator):
     26        (JSC::ExecutableAllocator::isValid const):
     27        (JSC::ExecutableAllocator::underMemoryPressure):
     28        (JSC::ExecutableAllocator::memoryPressureMultiplier):
     29        (JSC::ExecutableAllocator::allocate):
     30        (JSC::ExecutableAllocator::isValidExecutableMemory):
     31        (JSC::ExecutableAllocator::getLock const):
     32        (JSC::ExecutableAllocator::committedByteCount):
     33        (JSC::ExecutableAllocator::dumpProfile):
     34        (JSC::startOfFixedExecutableMemoryPoolImpl):
     35        (JSC::endOfFixedExecutableMemoryPoolImpl):
     36        (JSC::ExecutableAllocator::initialize):
     37        (JSC::ExecutableAllocator::initializeAllocator): Deleted.
     38        (JSC::ExecutableAllocator::ExecutableAllocator): Deleted.
     39        (JSC::ExecutableAllocator::~ExecutableAllocator): Deleted.
     40        * jit/ExecutableAllocator.h:
     41        (JSC::ExecutableAllocatorBase::isValid const):
     42        (JSC::ExecutableAllocatorBase::underMemoryPressure):
     43        (JSC::ExecutableAllocatorBase::memoryPressureMultiplier):
     44        (JSC::ExecutableAllocatorBase::dumpProfile):
     45        (JSC::ExecutableAllocatorBase::allocate):
     46        (JSC::ExecutableAllocatorBase::setJITEnabled):
     47        (JSC::ExecutableAllocatorBase::isValidExecutableMemory):
     48        (JSC::ExecutableAllocatorBase::committedByteCount):
     49        (JSC::ExecutableAllocatorBase::getLock const):
     50        (JSC::ExecutableAllocator::isValid const): Deleted.
     51        (JSC::ExecutableAllocator::underMemoryPressure): Deleted.
     52        (JSC::ExecutableAllocator::memoryPressureMultiplier): Deleted.
     53        (JSC::ExecutableAllocator::allocate): Deleted.
     54        (JSC::ExecutableAllocator::setJITEnabled): Deleted.
     55        (JSC::ExecutableAllocator::isValidExecutableMemory): Deleted.
     56        (JSC::ExecutableAllocator::committedByteCount): Deleted.
     57        (JSC::ExecutableAllocator::getLock const): Deleted.
     58        * jsc.cpp:
     59        (functionWebAssemblyMemoryMode):
     60        * runtime/InitializeThreading.cpp:
     61        (JSC::initializeThreading):
     62        * runtime/JSGlobalObject.cpp:
     63        (JSC::JSGlobalObject::init):
     64        * runtime/JSLock.cpp:
     65        (JSC::JSLock::didAcquireLock):
     66        * runtime/Options.cpp:
     67        (JSC::recomputeDependentOptions):
     68        * runtime/VM.cpp:
     69        (JSC::enableAssembler):
     70        (JSC::VM::canUseAssembler):
     71        (JSC::VM::VM):
     72        * runtime/VM.h:
     73        * wasm/WasmCapabilities.h: Added.
     74        (JSC::Wasm::isSupported):
     75        * wasm/WasmFaultSignalHandler.cpp:
     76        (JSC::Wasm::enableFastMemory):
     77
    1782019-03-21  Yusuke Suzuki  <ysuzuki@apple.com>
    279
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r243279 r243312  
    17531753                E334CBB521FD96A9000EB178 /* RegExpGlobalData.h in Headers */ = {isa = PBXBuildFile; fileRef = E334CBB321FD96A9000EB178 /* RegExpGlobalData.h */; settings = {ATTRIBUTES = (Private, ); }; };
    17541754                E33637A61B63220200EE0840 /* ReflectObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E33637A41B63220200EE0840 /* ReflectObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1755                E337B967224324EA0093A820 /* WasmCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = E337B966224324E50093A820 /* WasmCapabilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
    17551756                E33B3E261B7ABD750048DB2E /* InspectorInstrumentationObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = E33B3E251B7ABD750048DB2E /* InspectorInstrumentationObject.lut.h */; };
    17561757                E33E8D1D1B9013C300346B52 /* JSNativeStdFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = E33E8D1B1B9013C300346B52 /* JSNativeStdFunction.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    46944695                E33637A31B63220200EE0840 /* ReflectObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReflectObject.cpp; sourceTree = "<group>"; };
    46954696                E33637A41B63220200EE0840 /* ReflectObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReflectObject.h; sourceTree = "<group>"; };
     4697                E337B966224324E50093A820 /* WasmCapabilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WasmCapabilities.h; sourceTree = "<group>"; };
    46964698                E33B3E251B7ABD750048DB2E /* InspectorInstrumentationObject.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorInstrumentationObject.lut.h; sourceTree = "<group>"; };
    46974699                E33E8D1A1B9013C300346B52 /* JSNativeStdFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNativeStdFunction.cpp; sourceTree = "<group>"; };
     
    50845086                                14BD59BF0A3E8F9000BAF59C /* testapi */,
    50855087                                0FEC85AD1BDB5CF10080FF74 /* testb3 */,
     5088                                52CD0F642242F569004A18A5 /* testdfg */,
    50865089                                FE533CAC1F217DB40016A1FE /* testmasm */,
    50875090                                79281BDC20B62B3E002E2A60 /* testmem */,
    50885091                                6511230514046A4C002B101D /* testRegExp */,
    50895092                                932F5BD90822A1C700736975 /* JavaScriptCore.framework */,
    5090                                 52CD0F642242F569004A18A5 /* testdfg */,
    50915093                        );
    50925094                        name = Products;
     
    64946496                                53FD04D11D7AB187003287D3 /* WasmCallingConvention.cpp */,
    64956497                                53FD04D21D7AB187003287D3 /* WasmCallingConvention.h */,
     6498                                E337B966224324E50093A820 /* WasmCapabilities.h */,
    64966499                                526AC4B41E977C5D003500E1 /* WasmCodeBlock.cpp */,
    64976500                                526AC4B51E977C5D003500E1 /* WasmCodeBlock.h */,
     
    98259828                                525C0DDA1E935847002184CD /* WasmCallee.h in Headers */,
    98269829                                53FD04D41D7AB291003287D3 /* WasmCallingConvention.h in Headers */,
     9830                                E337B967224324EA0093A820 /* WasmCapabilities.h in Headers */,
    98279831                                526AC4B71E977C5D003500E1 /* WasmCodeBlock.h in Headers */,
    98289832                                AD412B341E7B2E9E008AF157 /* WasmContext.h in Headers */,
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r243086 r243312  
    14971497        vm()->typeProfiler()->invalidateTypeSetCache();
    14981498
    1499     if (ValueProfile* profile = vm()->noJITValueProfileSingleton.get())
    1500         *profile = ValueProfile(0);
    1501        
    15021499    reapWeakHandles();
    15031500    pruneStaleEntriesFromWeakGCMaps();
  • trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp

    r243254 r243312  
    116116class FixedVMPoolExecutableAllocator;
    117117static FixedVMPoolExecutableAllocator* allocator = nullptr;
    118 static ExecutableAllocator* executableAllocator = nullptr;
    119118
    120119static bool s_isJITEnabled = true;
     
    405404};
    406405
    407 void ExecutableAllocator::initializeAllocator()
     406FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator()
     407{
     408    m_reservation.deallocate();
     409}
     410
     411void ExecutableAllocator::initializeUnderlyingAllocator()
    408412{
    409413    ASSERT(!allocator);
    410414    allocator = new FixedVMPoolExecutableAllocator();
    411415    CodeProfiling::notifyAllocator(allocator);
    412 
    413     executableAllocator = new ExecutableAllocator;
    414 }
    415 
    416 ExecutableAllocator& ExecutableAllocator::singleton()
    417 {
    418     ASSERT(allocator);
    419     ASSERT(executableAllocator);
    420     return *executableAllocator;
    421 }
    422 
    423 ExecutableAllocator::ExecutableAllocator()
    424 {
    425     ASSERT(allocator);
    426 }
    427 
    428 ExecutableAllocator::~ExecutableAllocator()
    429 {
    430 }
    431 
    432 FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator()
    433 {
    434     m_reservation.deallocate();
    435416}
    436417
    437418bool ExecutableAllocator::isValid() const
    438419{
     420    if (!allocator)
     421        return Base::isValid();
    439422    return !!allocator->bytesReserved();
    440423}
     
    442425bool ExecutableAllocator::underMemoryPressure()
    443426{
     427    if (!allocator)
     428        return Base::underMemoryPressure();
    444429    MetaAllocator::Statistics statistics = allocator->currentStatistics();
    445430    return statistics.bytesAllocated > statistics.bytesReserved / 2;
     
    448433double ExecutableAllocator::memoryPressureMultiplier(size_t addedMemoryUsage)
    449434{
     435    if (!allocator)
     436        return Base::memoryPressureMultiplier(addedMemoryUsage);
    450437    MetaAllocator::Statistics statistics = allocator->currentStatistics();
    451438    ASSERT(statistics.bytesAllocated <= statistics.bytesReserved);
     
    466453RefPtr<ExecutableMemoryHandle> ExecutableAllocator::allocate(size_t sizeInBytes, void* ownerUID, JITCompilationEffort effort)
    467454{
     455    if (!allocator)
     456        return Base::allocate(sizeInBytes, ownerUID, effort);
    468457    if (Options::logExecutableAllocation()) {
    469458        MetaAllocator::Statistics stats = allocator->currentStatistics();
     
    515504bool ExecutableAllocator::isValidExecutableMemory(const AbstractLocker& locker, void* address)
    516505{
     506    if (!allocator)
     507        return Base::isValidExecutableMemory(locker, address);
    517508    return allocator->isInAllocatedMemory(locker, address);
    518509}
     
    520511Lock& ExecutableAllocator::getLock() const
    521512{
     513    if (!allocator)
     514        return Base::getLock();
    522515    return allocator->getLock();
    523516}
     
    525518size_t ExecutableAllocator::committedByteCount()
    526519{
     520    if (!allocator)
     521        return Base::committedByteCount();
    527522    return allocator->bytesCommitted();
    528523}
     
    531526void ExecutableAllocator::dumpProfile()
    532527{
     528    if (!allocator)
     529        return;
    533530    allocator->dumpProfile();
    534531}
     
    537534void* startOfFixedExecutableMemoryPoolImpl()
    538535{
     536    if (!allocator)
     537        return nullptr;
    539538    return allocator->memoryStart();
    540539}
     
    542541void* endOfFixedExecutableMemoryPoolImpl()
    543542{
     543    if (!allocator)
     544        return nullptr;
    544545    return allocator->memoryEnd();
    545546}
     
    552553} // namespace JSC
    553554
    554 #else // !ENABLE(JIT)
     555#endif // ENABLE(JIT)
    555556
    556557namespace JSC {
     
    558559static ExecutableAllocator* executableAllocator;
    559560
    560 void ExecutableAllocator::initializeAllocator()
     561void ExecutableAllocator::initialize()
    561562{
    562563    executableAllocator = new ExecutableAllocator;
     
    570571
    571572} // namespace JSC
    572 
    573 #endif // ENABLE(JIT)
  • trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h

    r241923 r243312  
    6060typedef WTF::MetaAllocatorHandle ExecutableMemoryHandle;
    6161
     62class ExecutableAllocatorBase {
     63    WTF_MAKE_FAST_ALLOCATED;
     64    WTF_MAKE_NONCOPYABLE(ExecutableAllocatorBase);
     65public:
     66    bool isValid() const { return false; }
     67
     68    static bool underMemoryPressure() { return false; }
     69
     70    static double memoryPressureMultiplier(size_t) { return 1.0; }
     71
     72    static void dumpProfile() { }
     73
     74    RefPtr<ExecutableMemoryHandle> allocate(size_t, void*, JITCompilationEffort) { return nullptr; }
     75
     76    static void setJITEnabled(bool) { };
     77   
     78    bool isValidExecutableMemory(const AbstractLocker&, void*) { return false; }
     79
     80    static size_t committedByteCount() { return 0; }
     81
     82    Lock& getLock() const
     83    {
     84        return m_lock;
     85    }
     86
     87protected:
     88    ExecutableAllocatorBase() = default;
     89    ~ExecutableAllocatorBase() = default;
     90
     91private:
     92    mutable Lock m_lock;
     93};
     94
    6295#if ENABLE(JIT)
    6396
     
    123156}
    124157
    125 class ExecutableAllocator {
    126     WTF_MAKE_FAST_ALLOCATED;
    127     WTF_MAKE_NONCOPYABLE(ExecutableAllocator);
    128     enum ProtectionSetting { Writable, Executable };
    129 
     158class ExecutableAllocator : private ExecutableAllocatorBase {
    130159public:
     160    using Base = ExecutableAllocatorBase;
     161
    131162    static ExecutableAllocator& singleton();
    132     static void initializeAllocator();
     163    static void initialize();
     164    static void initializeUnderlyingAllocator();
    133165
    134166    bool isValid() const;
     
    153185
    154186    Lock& getLock() const;
     187
    155188private:
    156 
    157     ExecutableAllocator();
    158     ~ExecutableAllocator();
     189    ExecutableAllocator() = default;
     190    ~ExecutableAllocator() = default;
    159191};
    160192
    161193#else
    162194
    163 class ExecutableAllocator {
    164     enum ProtectionSetting { Writable, Executable };
    165 
     195class ExecutableAllocator : public ExecutableAllocatorBase {
    166196public:
    167197    static ExecutableAllocator& singleton();
    168     static void initializeAllocator();
    169 
    170     bool isValid() const { return false; }
    171 
    172     static bool underMemoryPressure() { return false; }
    173 
    174     static double memoryPressureMultiplier(size_t) { return 1.0; }
    175 
    176     static void dumpProfile() { }
    177 
    178     RefPtr<ExecutableMemoryHandle> allocate(size_t, void*, JITCompilationEffort) { return nullptr; }
    179 
    180     static void setJITEnabled(bool) { };
    181    
    182     bool isValidExecutableMemory(const AbstractLocker&, void*) { return false; }
    183 
    184     static size_t committedByteCount() { return 0; }
    185 
    186     Lock& getLock() const
    187     {
    188         return m_lock;
    189     }
     198    static void initialize();
    190199
    191200private:
    192     mutable Lock m_lock;
     201    ExecutableAllocator() = default;
     202    ~ExecutableAllocator() = default;
    193203};
    194204
  • trunk/Source/JavaScriptCore/jsc.cpp

    r243086 r243312  
    7070#include "TestRunnerUtils.h"
    7171#include "TypedArrayInlines.h"
     72#include "WasmCapabilities.h"
    7273#include "WasmContext.h"
    7374#include "WasmFaultSignalHandler.h"
     
    23082309    auto scope = DECLARE_THROW_SCOPE(vm);
    23092310   
    2310     if (!Options::useWebAssembly())
     2311    if (!Wasm::isSupported())
    23112312        return throwVMTypeError(exec, scope, "WebAssemblyMemoryMode should only be called if the useWebAssembly option is set"_s);
    23122313
  • trunk/Source/JavaScriptCore/runtime/InitializeThreading.cpp

    r243254 r243312  
    4141#include "MacroAssemblerCodeRef.h"
    4242#include "Options.h"
     43#include "SigillCrashAnalyzer.h"
    4344#include "StructureIDTable.h"
    4445#include "SuperSampler.h"
     46#include "WasmCapabilities.h"
    4547#include "WasmThunks.h"
    4648#include "WriteBarrier.h"
     
    6971#endif
    7072
    71 #if ENABLE(ASSEMBLER)
    72         ExecutableAllocator::initializeAllocator();
    73 #endif
     73        ExecutableAllocator::initialize();
    7474        VM::computeCanUseJIT();
     75
     76        if (VM::canUseJIT() && Options::useSigillCrashAnalyzer())
     77            enableSigillCrashAnalyzer();
    7578
    7679        LLInt::initialize();
     
    8487
    8588#if ENABLE(WEBASSEMBLY)
    86         if (Options::useWebAssembly())
     89        if (Wasm::isSupported())
    8790            Wasm::Thunks::initialize();
    8891#endif
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r243011 r243312  
    169169#include "SymbolPrototype.h"
    170170#include "VariableWriteFireDetail.h"
     171#include "WasmCapabilities.h"
    171172#include "WeakGCMapInlines.h"
    172173#include "WeakMapConstructor.h"
     
    10431044
    10441045#if ENABLE(WEBASSEMBLY)
    1045     if (Options::useWebAssembly()) {
     1046    if (Wasm::isSupported()) {
    10461047        auto* webAssemblyPrototype = WebAssemblyPrototype::create(vm, this, WebAssemblyPrototype::createStructure(vm, this, m_objectPrototype.get()));
    10471048        m_webAssemblyModuleRecordStructure.initLater(
  • trunk/Source/JavaScriptCore/runtime/JSLock.cpp

    r241630 r243312  
    2929#include "MachineStackMarker.h"
    3030#include "SamplingProfiler.h"
     31#include "WasmCapabilities.h"
    3132#include "WasmMachineThreads.h"
    3233#include <thread>
     
    150151    m_vm->heap.machineThreads().addCurrentThread();
    151152#if ENABLE(WEBASSEMBLY)
    152     if (Options::useWebAssembly())
     153    if (Wasm::isSupported())
    153154        Wasm::startTrackingCurrentThread();
    154155#endif
  • trunk/Source/JavaScriptCore/runtime/Options.cpp

    r243254 r243312  
    421421#endif
    422422
    423     if (!Options::useJIT())
     423    if (!Options::useJIT()) {
     424        Options::useSigillCrashAnalyzer() = false;
    424425        Options::useWebAssembly() = false;
     426    }
    425427
    426428    if (!Options::useWebAssembly())
     
    510512        Options::scribbleFreeCells() = true;
    511513    }
    512 
    513     if (Options::useSigillCrashAnalyzer())
    514         enableSigillCrashAnalyzer();
    515514
    516515    if (Options::reservedZoneSize() < minimumReservedZoneSize)
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r243279 r243312  
    186186
    187187#if ENABLE(ASSEMBLER)
    188 static bool enableAssembler(ExecutableAllocator& executableAllocator)
     188static bool enableAssembler()
    189189{
    190190    if (!Options::useJIT() && !Options::useRegExpJIT())
    191191        return false;
    192192
    193     if (!executableAllocator.isValid()) {
     193    char* canUseJITString = getenv("JavaScriptCoreUseJIT");
     194    if (canUseJITString && !atoi(canUseJITString))
     195        return false;
     196
     197    ExecutableAllocator::initializeUnderlyingAllocator();
     198    if (!ExecutableAllocator::singleton().isValid()) {
    194199        if (Options::crashIfCantAllocateJITMemory())
    195200            CRASH();
     
    197202    }
    198203
    199     char* canUseJITString = getenv("JavaScriptCoreUseJIT");
    200     return !canUseJITString || atoi(canUseJITString);
     204    return true;
    201205}
    202206#endif // ENABLE(!ASSEMBLER)
     
    208212    static bool enabled = false;
    209213    std::call_once(onceKey, [] {
    210         enabled = enableAssembler(ExecutableAllocator::singleton());
     214        enabled = enableAssembler();
    211215    });
    212216    return enabled;
     
    408412
    409413    Thread::current().setCurrentAtomicStringTable(existingEntryAtomicStringTable);
    410 
    411 #if ENABLE(JIT)
    412     jitStubs = std::make_unique<JITThunks>();
    413 #endif
    414 
    415 #if ENABLE(FTL_JIT)
    416     ftlThunks = std::make_unique<FTL::Thunks>();
    417 #endif // ENABLE(FTL_JIT)
    418414   
    419415#if !ENABLE(C_LOOP)
     
    473469    // Make sure that any stubs that the JIT is going to use are initialized in non-compilation threads.
    474470    if (canUseJIT()) {
     471        jitStubs = std::make_unique<JITThunks>();
     472#if ENABLE(FTL_JIT)
     473        ftlThunks = std::make_unique<FTL::Thunks>();
     474#endif // ENABLE(FTL_JIT)
    475475        getCTIInternalFunctionTrampolineFor(CodeForCall);
    476476        getCTIInternalFunctionTrampolineFor(CodeForConstruct);
    477477    }
    478478#endif
    479 
    480     if (!canUseJIT())
    481         noJITValueProfileSingleton = std::make_unique<ValueProfile>(0);
    482479
    483480    if (Options::forceDebuggerBytecodeGeneration() || Options::alwaysUseShadowChicken())
  • trunk/Source/JavaScriptCore/runtime/VM.h

    r243279 r243312  
    805805#endif
    806806
    807     std::unique_ptr<ValueProfile> noJITValueProfileSingleton;
    808 
    809807    JS_EXPORT_PRIVATE void resetDateCache();
    810808
  • trunk/Source/JavaScriptCore/wasm/WasmFaultSignalHandler.cpp

    r237630 r243312  
    3131#include "ExecutableAllocator.h"
    3232#include "MachineContext.h"
     33#include "WasmCapabilities.h"
    3334#include "WasmExceptionType.h"
    3435#include "WasmMemory.h"
     
    127128    static std::once_flag once;
    128129    std::call_once(once, [] {
     130        if (!Wasm::isSupported())
     131            return;
     132
    129133        if (!Options::useWebAssemblyFastMemory())
    130134            return;
Note: See TracChangeset for help on using the changeset viewer.