Title: [272135] releases/WebKitGTK/webkit-2.30/Source
Revision
272135
Author
[email protected]
Date
2021-02-01 02:20:15 -0800 (Mon, 01 Feb 2021)

Log Message

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

Source/_javascript_Core:

Patch by Michael Catanzaro <[email protected]> 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 <[email protected]> on 2020-12-02
Reviewed by Darin Adler.

* wtf/PlatformEnable.h:
* wtf/PlatformUse.h:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/ChangeLog (272134 => 272135)


--- releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/ChangeLog	2021-02-01 10:20:09 UTC (rev 272134)
+++ releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/ChangeLog	2021-02-01 10:20:15 UTC (rev 272135)
@@ -1,3 +1,22 @@
+2020-12-02  Michael Catanzaro  <[email protected]>
+
+        aarch64 llint does not build with JIT disabled
+        https://bugs.webkit.org/show_bug.cgi?id=219288
+        <rdar://problem/71855960>
+
+        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).
+
 2021-01-19  Lauro Moura  <[email protected]>
 
         REGRESSION(r271580) [GTK] LTS/Debian build failure due to unsupported g-ir-scanner parameter

Modified: releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/assembler/ARM64Assembler.h (272134 => 272135)


--- releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/assembler/ARM64Assembler.h	2021-02-01 10:20:09 UTC (rev 272134)
+++ releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/assembler/ARM64Assembler.h	2021-02-01 10:20:15 UTC (rev 272135)
@@ -2571,7 +2571,7 @@
         intptr_t offset = (reinterpret_cast<intptr_t>(to) - reinterpret_cast<intptr_t>(where)) >> 2;
         ASSERT(static_cast<int>(offset) == offset);
 
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
         if (!isInt<26>(offset)) {
             to = ExecutableAllocator::singleton().getJumpIslandTo(where, to);
             offset = (bitwise_cast<intptr_t>(to) - bitwise_cast<intptr_t>(where)) >> 2;
@@ -2769,7 +2769,7 @@
         cacheFlush(reinterpret_cast<int*>(from) - 1, sizeof(int));
     }
 
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
     static void* prepareForAtomicRelinkJumpConcurrently(void* from, void* to)
     {
         intptr_t offset = (bitwise_cast<intptr_t>(to) - bitwise_cast<intptr_t>(from)) >> 2;
@@ -3019,7 +3019,7 @@
         intptr_t offset = (bitwise_cast<intptr_t>(to) - bitwise_cast<intptr_t>(fromInstruction)) >> 2;
         ASSERT(static_cast<int>(offset) == offset);
 
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
         if (!isInt<26>(offset)) {
             to = ExecutableAllocator::singleton().getJumpIslandTo(bitwise_cast<void*>(fromInstruction), to);
             offset = (bitwise_cast<intptr_t>(to) - bitwise_cast<intptr_t>(fromInstruction)) >> 2;

Modified: releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/assembler/AbstractMacroAssembler.h (272134 => 272135)


--- releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/assembler/AbstractMacroAssembler.h	2021-02-01 10:20:09 UTC (rev 272134)
+++ releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/assembler/AbstractMacroAssembler.h	2021-02-01 10:20:15 UTC (rev 272135)
@@ -916,7 +916,7 @@
     template<PtrTag callTag, PtrTag destTag>
     static CodeLocationLabel<destTag> prepareForAtomicRepatchNearCallConcurrently(CodeLocationNearCall<callTag> nearCall, CodeLocationLabel<destTag> destination)
     {
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
         switch (nearCall.callMode()) {
         case NearCallMode::Tail:
             return CodeLocationLabel<destTag>(tagCodePtr<destTag>(AssemblerType::prepareForAtomicRelinkJumpConcurrently(nearCall.dataLocation(), destination.dataLocation())));

Modified: releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/assembler/LinkBuffer.cpp (272134 => 272135)


--- releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/assembler/LinkBuffer.cpp	2021-02-01 10:20:09 UTC (rev 272134)
+++ releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/assembler/LinkBuffer.cpp	2021-02-01 10:20:15 UTC (rev 272135)
@@ -374,6 +374,7 @@
         m_executableMemory->shrink(m_size);
     }
 
+#if ENABLE(JIT)
     if (useFastJITPermissions()) {
         ASSERT(codeOutData == outData);
         if (UNLIKELY(Options::dumpJITMemoryPath()))
@@ -382,6 +383,10 @@
         ASSERT(codeOutData != outData);
         performJITMemcpy(codeOutData, outData, m_size);
     }
+#else
+    ASSERT(codeOutData != outData);
+    performJITMemcpy(codeOutData, outData, m_size);
+#endif
 
     jumpsToLink.clear();
 

Modified: releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/jit/ExecutableAllocator.cpp (272134 => 272135)


--- releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/jit/ExecutableAllocator.cpp	2021-02-01 10:20:09 UTC (rev 272134)
+++ releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/jit/ExecutableAllocator.cpp	2021-02-01 10:20:15 UTC (rev 272135)
@@ -81,7 +81,7 @@
 #elif CPU(ARM)
 static constexpr size_t fixedExecutableMemoryPoolSize = 16 * MB;
 #elif CPU(ARM64)
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
 static constexpr size_t fixedExecutableMemoryPoolSize = 1 * GB;
 // These sizes guarantee that any jump within an island can jump forwards or backwards
 // to the adjacent island in a single instruction.
@@ -310,7 +310,7 @@
         return reservation;
 
     reservation.size = fixedExecutableMemoryPoolSize;
-#if !USE(JUMP_ISLANDS)
+#if !ENABLE(JUMP_ISLANDS)
     // FIXME: Consider making jump islands work with Options::jitMemoryReservationSize
     // https://bugs.webkit.org/show_bug.cgi?id=209037
     if (Options::jitMemoryReservationSize())
@@ -359,7 +359,7 @@
 class FixedVMPoolExecutableAllocator final {
     WTF_MAKE_FAST_ALLOCATED;
 
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
     class Islands;
     class RegionAllocator;
 #endif
@@ -366,7 +366,7 @@
 
 public:
     FixedVMPoolExecutableAllocator()
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
         : m_allocators(constructFixedSizeArrayWithArguments<RegionAllocator, numberOfRegions>(*this))
 #else
         : m_allocator(*this)
@@ -375,7 +375,7 @@
         JITReservation reservation = initializeJITPageReservation();
         m_reservation = WTFMove(reservation.pageReservation);
         if (m_reservation) {
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
             uintptr_t start = bitwise_cast<uintptr_t>(memoryStart());
             uintptr_t reservationEnd = bitwise_cast<uintptr_t>(memoryEnd());
             for (size_t i = 0; i < numberOfRegions; ++i) {
@@ -415,7 +415,7 @@
 
     RefPtr<ExecutableMemoryHandle> allocate(size_t sizeInBytes)
     {
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
         auto locker = holdLock(getLock());
 
         unsigned start = 0;
@@ -434,7 +434,7 @@
         return nullptr;
 #else
         return m_allocator.allocate(sizeInBytes);
-#endif // USE(JUMP_ISLANDS)
+#endif // ENABLE(JUMP_ISLANDS)
     }
 
     Lock& getLock() { return m_lock; }
@@ -467,7 +467,7 @@
 
     bool isInAllocatedMemory(const AbstractLocker& locker, void* address)
     {
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
         if (RegionAllocator* allocator = findRegion(bitwise_cast<uintptr_t>(address)))
             return allocator->isInAllocatedMemory(locker, address);
         return false;
@@ -498,7 +498,7 @@
         return result;
     }
 
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
     void handleWillBeReleased(const LockHolder& locker, MetaAllocatorHandle& handle)
     {
         if (m_islandsForJumpSourceLocation.isEmpty())
@@ -632,7 +632,7 @@
 
         return result;
     }
-#endif // USE(JUMP_ISLANDS)
+#endif // ENABLE(JUMP_ISLANDS)
 
 private:
     class Allocator : public MetaAllocator {
@@ -663,7 +663,7 @@
         FixedVMPoolExecutableAllocator& m_fixedAllocator;
     };
 
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
     class RegionAllocator final : public Allocator {
         using Base = Allocator;
     public:
@@ -768,12 +768,12 @@
         void* m_end;
         FastBitVector islandBits;
     };
-#endif // USE(JUMP_ISLANDS)
+#endif // ENABLE(JUMP_ISLANDS)
 
     template <typename Function>
     void forEachAllocator(Function function)
     {
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
         for (RegionAllocator& allocator : m_allocators) {
             using FunctionResultType = decltype(function(allocator));
             if constexpr (std::is_same<IterationStatus, FunctionResultType>::value) {
@@ -786,10 +786,10 @@
         }
 #else
         function(m_allocator);
-#endif // USE(JUMP_ISLANDS)
+#endif // ENABLE(JUMP_ISLANDS)
     }
 
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
     class Islands : public RedBlackTree<Islands, void*>::Node {
         WTF_MAKE_FAST_ALLOCATED;
     public:
@@ -797,16 +797,16 @@
         CodeLocationLabel<ExecutableMemoryPtrTag> jumpSourceLocation;
         Vector<CodeLocationLabel<ExecutableMemoryPtrTag>> jumpIslands;
     };
-#endif // USE(JUMP_ISLANDS)
+#endif // ENABLE(JUMP_ISLANDS)
 
     Lock m_lock;
     PageReservation m_reservation;
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
     std::array<RegionAllocator, numberOfRegions> m_allocators;
     RedBlackTree<Islands, void*> m_islandsForJumpSourceLocation;
 #else
     Allocator m_allocator;
-#endif // USE(JUMP_ISLANDS)
+#endif // ENABLE(JUMP_ISLANDS)
 };
 
 // Keep this pointer in a mutable global variable to help Leaks find it.
@@ -938,7 +938,7 @@
 }
 #endif
 
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
 void* ExecutableAllocator::getJumpIslandTo(void* from, void* newDestination)
 {
     FixedVMPoolExecutableAllocator* allocator = g_jscConfig.fixedVMPoolExecutableAllocator;

Modified: releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/jit/ExecutableAllocator.h (272134 => 272135)


--- releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/jit/ExecutableAllocator.h	2021-02-01 10:20:09 UTC (rev 272134)
+++ releases/WebKitGTK/webkit-2.30/Source/_javascript_Core/jit/ExecutableAllocator.h	2021-02-01 10:20:15 UTC (rev 272135)
@@ -178,7 +178,7 @@
 
     Lock& getLock() const;
 
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
     JS_EXPORT_PRIVATE void* getJumpIslandTo(void* from, void* newDestination);
     JS_EXPORT_PRIVATE void* getJumpIslandToConcurrently(void* from, void* newDestination);
 #endif

Modified: releases/WebKitGTK/webkit-2.30/Source/WTF/ChangeLog (272134 => 272135)


--- releases/WebKitGTK/webkit-2.30/Source/WTF/ChangeLog	2021-02-01 10:20:09 UTC (rev 272134)
+++ releases/WebKitGTK/webkit-2.30/Source/WTF/ChangeLog	2021-02-01 10:20:15 UTC (rev 272135)
@@ -1,3 +1,20 @@
+2020-12-02  Michael Catanzaro  <[email protected]>
+
+        aarch64 llint does not build with JIT disabled
+        https://bugs.webkit.org/show_bug.cgi?id=219288
+        <rdar://problem/71855960>
+
+        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.
+
+        Reviewed by Darin Adler.
+
+        * wtf/PlatformEnable.h:
+        * wtf/PlatformUse.h:
+
 2020-12-07  Zan Dobersek  <[email protected]>
 
         [GLib] Leaked RunLoop objects on worker threads

Modified: releases/WebKitGTK/webkit-2.30/Source/WTF/wtf/PlatformEnable.h (272134 => 272135)


--- releases/WebKitGTK/webkit-2.30/Source/WTF/wtf/PlatformEnable.h	2021-02-01 10:20:09 UTC (rev 272134)
+++ releases/WebKitGTK/webkit-2.30/Source/WTF/wtf/PlatformEnable.h	2021-02-01 10:20:15 UTC (rev 272135)
@@ -599,6 +599,10 @@
 #endif
 #endif
 
+#if !defined(ENABLE_JUMP_ISLANDS) && CPU(ARM64) && CPU(ADDRESS64) && ENABLE(JIT)
+#define ENABLE_JUMP_ISLANDS 1
+#endif
+
 /* FIXME: This should be turned into an #error invariant */
 /* The FTL *does not* work on 32-bit platforms. Disable it even if someone asked us to enable it. */
 #if USE(JSVALUE32_64)
@@ -870,7 +874,3 @@
 #if ENABLE(WEBGL2) && !ENABLE(WEBGL)
 #error "ENABLE(WEBGL2) requires ENABLE(WEBGL)"
 #endif
-
-#if CPU(ARM64) && CPU(ADDRESS64)
-#define USE_JUMP_ISLANDS 1
-#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to