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

Changeset 270377 in webkit


Ignore:
Timestamp:
Dec 2, 2020, 4:42:58 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

aarch64 llint does not build with JIT disabled
​https://bugs.webkit.org/show_bug.cgi?id=219288
<rdar://problem/71855960>

Source/JavaScriptCore:

Patch by Michael Catanzaro <Michael Catanzaro> on 2020-12-02
Reviewed by Darin Adler.

  • assembler/ARM64Assembler.h: Rename USE(JUMP_ISLANDS) to ENABLE(JUMP_ISLANDS).

(JSC::ARM64Assembler::replaceWithJump):
(JSC::ARM64Assembler::linkJumpOrCall):

  • assembler/AbstractMacroAssembler.h: Rename USE(JUMP_ISLANDS) to ENABLE(JUMP_ISLANDS).

(JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently):

  • assembler/LinkBuffer.cpp:

(JSC::LinkBuffer::copyCompactAndLinkCode): Guard JIT-specific code with ENABLE(JIT).

  • jit/ExecutableAllocator.cpp: Rename USE(JUMP_ISLANDS) to ENABLE(JUMP_ISLANDS).

(JSC::initializeJITPageReservation):

  • jit/ExecutableAllocator.h: Rename USE(JUMP_ISLANDS) to ENABLE(JUMP_ISLANDS).

Source/WTF:

Rename USE(JUMP_ISLANDS) to ENABLE(JUMP_ISLANDS), and make it depend on ENABLE(JIT). We need
it to depend on ENABLE(JIT) to fix the build, but this is awkward to do otherwise, because
USE macros are defined in PlatformUse.h before ENABLE macros in PlatformEnable.h. But it
makes sense, since USE macros should be used for "a particular third-party library or
optional OS service," and jump islands are neither, so ENABLE is more suitable anyway.

Patch by Michael Catanzaro <Michael Catanzaro> on 2020-12-02
Reviewed by Darin Adler.

  • wtf/PlatformEnable.h:
  • wtf/PlatformUse.h:
Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r270371 r270377  
     12020-12-02  Michael Catanzaro  <mcatanzaro@gnome.org>
     2
     3        aarch64 llint does not build with JIT disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=219288
     5        <rdar://problem/71855960>
     6
     7        Reviewed by Darin Adler.
     8
     9        * assembler/ARM64Assembler.h: Rename USE(JUMP_ISLANDS) to ENABLE(JUMP_ISLANDS).
     10        (JSC::ARM64Assembler::replaceWithJump):
     11        (JSC::ARM64Assembler::linkJumpOrCall):
     12        * assembler/AbstractMacroAssembler.h: Rename USE(JUMP_ISLANDS) to ENABLE(JUMP_ISLANDS).
     13        (JSC::AbstractMacroAssembler::prepareForAtomicRepatchNearCallConcurrently):
     14        * assembler/LinkBuffer.cpp:
     15        (JSC::LinkBuffer::copyCompactAndLinkCode): Guard JIT-specific code with ENABLE(JIT).
     16        * jit/ExecutableAllocator.cpp: Rename USE(JUMP_ISLANDS) to ENABLE(JUMP_ISLANDS).
     17        (JSC::initializeJITPageReservation):
     18        * jit/ExecutableAllocator.h: Rename USE(JUMP_ISLANDS) to ENABLE(JUMP_ISLANDS).
     19
    1202020-12-02  Ross Kirsling  <ross.kirsling@sony.com>
    221
  • trunk/Source/JavaScriptCore/assembler/ARM64Assembler.h

    r269020 r270377  
    26062606        ASSERT(static_cast<int>(offset) == offset);
    26072607
    2608 #if USE(JUMP_ISLANDS)
     2608#if ENABLE(JUMP_ISLANDS)
    26092609        if (!isInt<26>(offset)) {
    26102610            to = ExecutableAllocator::singleton().getJumpIslandTo(where, to);
    … …  
    28042804    }
    28052805
    2806 #if USE(JUMP_ISLANDS)
     2806#if ENABLE(JUMP_ISLANDS)
    28072807    static void* prepareForAtomicRelinkJumpConcurrently(void* from, void* to)
    28082808    {
    … …  
    30543054        ASSERT(static_cast<int>(offset) == offset);
    30553055
    3056 #if USE(JUMP_ISLANDS)
     3056#if ENABLE(JUMP_ISLANDS)
    30573057        if (!isInt<26>(offset)) {
    30583058            to = ExecutableAllocator::singleton().getJumpIslandTo(bitwise_cast<void*>(fromInstruction), to);
  • trunk/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h

    r268247 r270377  
    915915    static CodeLocationLabel<destTag> prepareForAtomicRepatchNearCallConcurrently(CodeLocationNearCall<callTag> nearCall, CodeLocationLabel<destTag> destination)
    916916    {
    917 #if USE(JUMP_ISLANDS)
     917#if ENABLE(JUMP_ISLANDS)
    918918        switch (nearCall.callMode()) {
    919919        case NearCallMode::Tail:
  • trunk/Source/JavaScriptCore/assembler/LinkBuffer.cpp

    r269020 r270377  
    389389    }
    390390
     391#if ENABLE(JIT)
    391392    if (useFastJITPermissions()) {
    392393        ASSERT(codeOutData == outData);
    … …  
    397398        performJITMemcpy(codeOutData, outData, m_size);
    398399    }
     400#else
     401    ASSERT(codeOutData != outData);
     402    performJITMemcpy(codeOutData, outData, m_size);
     403#endif
    399404
    400405    jumpsToLink.clear();
  • trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp

    r269349 r270377  
    9494static constexpr size_t fixedExecutableMemoryPoolSize = 16 * MB;
    9595#elif CPU(ARM64)
    96 #if USE(JUMP_ISLANDS)
     96#if ENABLE(JUMP_ISLANDS)
    9797static constexpr size_t fixedExecutableMemoryPoolSize = 1 * GB;
    9898// These sizes guarantee that any jump within an island can jump forwards or backwards
    … …  
    323323
    324324    reservation.size = fixedExecutableMemoryPoolSize;
    325 #if !USE(JUMP_ISLANDS)
     325#if !ENABLE(JUMP_ISLANDS)
    326326    // FIXME: Consider making jump islands work with Options::jitMemoryReservationSize
    327327    // https://bugs.webkit.org/show_bug.cgi?id=209037
    … …  
    372372    WTF_MAKE_FAST_ALLOCATED;
    373373
    374 #if USE(JUMP_ISLANDS)
     374#if ENABLE(JUMP_ISLANDS)
    375375    class Islands;
    376376    class RegionAllocator;
    … …  
    379379public:
    380380    FixedVMPoolExecutableAllocator()
    381 #if USE(JUMP_ISLANDS)
     381#if ENABLE(JUMP_ISLANDS)
    382382        : m_allocators(constructFixedSizeArrayWithArguments<RegionAllocator, numberOfRegions>(*this))
    383383#else
    … …  
    388388        m_reservation = WTFMove(reservation.pageReservation);
    389389        if (m_reservation) {
    390 #if USE(JUMP_ISLANDS)
     390#if ENABLE(JUMP_ISLANDS)
    391391            uintptr_t start = bitwise_cast<uintptr_t>(memoryStart());
    392392            uintptr_t reservationEnd = bitwise_cast<uintptr_t>(memoryEnd());
    … …  
    428428    RefPtr<ExecutableMemoryHandle> allocate(size_t sizeInBytes)
    429429    {
    430 #if USE(JUMP_ISLANDS)
     430#if ENABLE(JUMP_ISLANDS)
    431431        auto locker = holdLock(getLock());
    432432
    … …  
    447447#else
    448448        return m_allocator.allocate(sizeInBytes);
    449 #endif // USE(JUMP_ISLANDS)
     449#endif // ENABLE(JUMP_ISLANDS)
    450450    }
    451451
    … …  
    480480    bool isInAllocatedMemory(const AbstractLocker& locker, void* address)
    481481    {
    482 #if USE(JUMP_ISLANDS)
     482#if ENABLE(JUMP_ISLANDS)
    483483        if (RegionAllocator* allocator = findRegion(bitwise_cast<uintptr_t>(address)))
    484484            return allocator->isInAllocatedMemory(locker, address);
    … …  
    511511    }
    512512
    513 #if USE(JUMP_ISLANDS)
     513#if ENABLE(JUMP_ISLANDS)
    514514    void handleWillBeReleased(const LockHolder& locker, MetaAllocatorHandle& handle)
    515515    {
    … …  
    645645        return result;
    646646    }
    647 #endif // USE(JUMP_ISLANDS)
     647#endif // ENABLE(JUMP_ISLANDS)
    648648
    649649private:
    … …  
    676676    };
    677677
    678 #if USE(JUMP_ISLANDS)
     678#if ENABLE(JUMP_ISLANDS)
    679679    class RegionAllocator final : public Allocator {
    680680        using Base = Allocator;
    … …  
    781781        FastBitVector islandBits;
    782782    };
    783 #endif // USE(JUMP_ISLANDS)
     783#endif // ENABLE(JUMP_ISLANDS)
    784784
    785785    template <typename Function>
    786786    void forEachAllocator(Function function)
    787787    {
    788 #if USE(JUMP_ISLANDS)
     788#if ENABLE(JUMP_ISLANDS)
    789789        for (RegionAllocator& allocator : m_allocators) {
    790790            using FunctionResultType = decltype(function(allocator));
    … …  
    799799#else
    800800        function(m_allocator);
    801 #endif // USE(JUMP_ISLANDS)
    802     }
    803 
    804 #if USE(JUMP_ISLANDS)
     801#endif // ENABLE(JUMP_ISLANDS)
     802    }
     803
     804#if ENABLE(JUMP_ISLANDS)
    805805    class Islands : public RedBlackTree<Islands, void*>::Node {
    806806        WTF_MAKE_FAST_ALLOCATED;
    … …  
    810810        Vector<CodeLocationLabel<ExecutableMemoryPtrTag>> jumpIslands;
    811811    };
    812 #endif // USE(JUMP_ISLANDS)
     812#endif // ENABLE(JUMP_ISLANDS)
    813813
    814814    Lock m_lock;
    815815    PageReservation m_reservation;
    816 #if USE(JUMP_ISLANDS)
     816#if ENABLE(JUMP_ISLANDS)
    817817    std::array<RegionAllocator, numberOfRegions> m_allocators;
    818818    RedBlackTree<Islands, void*> m_islandsForJumpSourceLocation;
    819819#else
    820820    Allocator m_allocator;
    821 #endif // USE(JUMP_ISLANDS)
     821#endif // ENABLE(JUMP_ISLANDS)
    822822};
    823823
    … …  
    951951#endif
    952952
    953 #if USE(JUMP_ISLANDS)
     953#if ENABLE(JUMP_ISLANDS)
    954954void* ExecutableAllocator::getJumpIslandTo(void* from, void* newDestination)
    955955{
  • trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h

    r263380 r270377  
    179179    Lock& getLock() const;
    180180
    181 #if USE(JUMP_ISLANDS)
     181#if ENABLE(JUMP_ISLANDS)
    182182    JS_EXPORT_PRIVATE void* getJumpIslandTo(void* from, void* newDestination);
    183183    JS_EXPORT_PRIVATE void* getJumpIslandToConcurrently(void* from, void* newDestination);
  • trunk/Source/WTF/ChangeLog

    r270321 r270377  
     12020-12-02  Michael Catanzaro  <mcatanzaro@gnome.org>
     2
     3        aarch64 llint does not build with JIT disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=219288
     5        <rdar://problem/71855960>
     6
     7        Rename USE(JUMP_ISLANDS) to ENABLE(JUMP_ISLANDS), and make it depend on ENABLE(JIT). We need
     8        it to depend on ENABLE(JIT) to fix the build, but this is awkward to do otherwise, because
     9        USE macros are defined in PlatformUse.h before ENABLE macros in PlatformEnable.h. But it
     10        makes sense, since USE macros should be used for "a particular third-party library or
     11        optional OS service," and jump islands are neither, so ENABLE is more suitable anyway.
     12
     13        Reviewed by Darin Adler.
     14
     15        * wtf/PlatformEnable.h:
     16        * wtf/PlatformUse.h:
     17
    1182020-12-01  Youenn Fablet  <youenn@apple.com>
    219
  • trunk/Source/WTF/wtf/PlatformEnable.h

    r270120 r270377  
    595595#endif
    596596
     597#if !defined(ENABLE_JUMP_ISLANDS) && CPU(ARM64) && CPU(ADDRESS64) && ENABLE(JIT)
     598#define ENABLE_JUMP_ISLANDS 1
     599#endif
     600
    597601/* FIXME: This should be turned into an #error invariant */
    598602/* The FTL *does not* work on 32-bit platforms. Disable it even if someone asked us to enable it. */
  • trunk/Source/WTF/wtf/PlatformUse.h

    r270067 r270377  
    314314#endif
    315315
    316 #if CPU(ARM64) && CPU(ADDRESS64)
    317 #define USE_JUMP_ISLANDS 1
    318 #endif
    319 
    320316#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) \
    321317    || (PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
Note: See TracChangeset for help on using the changeset viewer.