Title: [270377] trunk/Source
Revision
270377
Author
[email protected]
Date
2020-12-02 16:42:58 -0800 (Wed, 02 Dec 2020)

Log Message

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: trunk/Source/_javascript_Core/ChangeLog (270376 => 270377)


--- trunk/Source/_javascript_Core/ChangeLog	2020-12-03 00:29:47 UTC (rev 270376)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-12-03 00:42:58 UTC (rev 270377)
@@ -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).
+
 2020-12-02  Ross Kirsling  <[email protected]>
 
         %TypedArray%#slice shouldn't care about source buffer detachment if there's nothing to copy

Modified: trunk/Source/_javascript_Core/assembler/ARM64Assembler.h (270376 => 270377)


--- trunk/Source/_javascript_Core/assembler/ARM64Assembler.h	2020-12-03 00:29:47 UTC (rev 270376)
+++ trunk/Source/_javascript_Core/assembler/ARM64Assembler.h	2020-12-03 00:42:58 UTC (rev 270377)
@@ -2605,7 +2605,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;
@@ -2803,7 +2803,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;
@@ -3053,7 +3053,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: trunk/Source/_javascript_Core/assembler/AbstractMacroAssembler.h (270376 => 270377)


--- trunk/Source/_javascript_Core/assembler/AbstractMacroAssembler.h	2020-12-03 00:29:47 UTC (rev 270376)
+++ trunk/Source/_javascript_Core/assembler/AbstractMacroAssembler.h	2020-12-03 00:42:58 UTC (rev 270377)
@@ -914,7 +914,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: trunk/Source/_javascript_Core/assembler/LinkBuffer.cpp (270376 => 270377)


--- trunk/Source/_javascript_Core/assembler/LinkBuffer.cpp	2020-12-03 00:29:47 UTC (rev 270376)
+++ trunk/Source/_javascript_Core/assembler/LinkBuffer.cpp	2020-12-03 00:42:58 UTC (rev 270377)
@@ -388,6 +388,7 @@
         m_executableMemory->shrink(m_size);
     }
 
+#if ENABLE(JIT)
     if (useFastJITPermissions()) {
         ASSERT(codeOutData == outData);
         if (UNLIKELY(Options::dumpJITMemoryPath()))
@@ -396,6 +397,10 @@
         ASSERT(codeOutData != outData);
         performJITMemcpy(codeOutData, outData, m_size);
     }
+#else
+    ASSERT(codeOutData != outData);
+    performJITMemcpy(codeOutData, outData, m_size);
+#endif
 
     jumpsToLink.clear();
 

Modified: trunk/Source/_javascript_Core/jit/ExecutableAllocator.cpp (270376 => 270377)


--- trunk/Source/_javascript_Core/jit/ExecutableAllocator.cpp	2020-12-03 00:29:47 UTC (rev 270376)
+++ trunk/Source/_javascript_Core/jit/ExecutableAllocator.cpp	2020-12-03 00:42:58 UTC (rev 270377)
@@ -93,7 +93,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.
@@ -322,7 +322,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())
@@ -371,7 +371,7 @@
 class FixedVMPoolExecutableAllocator final {
     WTF_MAKE_FAST_ALLOCATED;
 
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
     class Islands;
     class RegionAllocator;
 #endif
@@ -378,7 +378,7 @@
 
 public:
     FixedVMPoolExecutableAllocator()
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
         : m_allocators(constructFixedSizeArrayWithArguments<RegionAllocator, numberOfRegions>(*this))
 #else
         : m_allocator(*this)
@@ -387,7 +387,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) {
@@ -427,7 +427,7 @@
 
     RefPtr<ExecutableMemoryHandle> allocate(size_t sizeInBytes)
     {
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
         auto locker = holdLock(getLock());
 
         unsigned start = 0;
@@ -446,7 +446,7 @@
         return nullptr;
 #else
         return m_allocator.allocate(sizeInBytes);
-#endif // USE(JUMP_ISLANDS)
+#endif // ENABLE(JUMP_ISLANDS)
     }
 
     Lock& getLock() { return m_lock; }
@@ -479,7 +479,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;
@@ -510,7 +510,7 @@
         return result;
     }
 
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
     void handleWillBeReleased(const LockHolder& locker, MetaAllocatorHandle& handle)
     {
         if (m_islandsForJumpSourceLocation.isEmpty())
@@ -644,7 +644,7 @@
 
         return result;
     }
-#endif // USE(JUMP_ISLANDS)
+#endif // ENABLE(JUMP_ISLANDS)
 
 private:
     class Allocator : public MetaAllocator {
@@ -675,7 +675,7 @@
         FixedVMPoolExecutableAllocator& m_fixedAllocator;
     };
 
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
     class RegionAllocator final : public Allocator {
         using Base = Allocator;
     public:
@@ -780,12 +780,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) {
@@ -798,10 +798,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:
@@ -809,16 +809,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.
@@ -950,7 +950,7 @@
 }
 #endif
 
-#if USE(JUMP_ISLANDS)
+#if ENABLE(JUMP_ISLANDS)
 void* ExecutableAllocator::getJumpIslandTo(void* from, void* newDestination)
 {
     FixedVMPoolExecutableAllocator* allocator = g_jscConfig.fixedVMPoolExecutableAllocator;

Modified: trunk/Source/_javascript_Core/jit/ExecutableAllocator.h (270376 => 270377)


--- trunk/Source/_javascript_Core/jit/ExecutableAllocator.h	2020-12-03 00:29:47 UTC (rev 270376)
+++ trunk/Source/_javascript_Core/jit/ExecutableAllocator.h	2020-12-03 00:42:58 UTC (rev 270377)
@@ -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: trunk/Source/WTF/ChangeLog (270376 => 270377)


--- trunk/Source/WTF/ChangeLog	2020-12-03 00:29:47 UTC (rev 270376)
+++ trunk/Source/WTF/ChangeLog	2020-12-03 00:42:58 UTC (rev 270377)
@@ -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-01  Youenn Fablet  <[email protected]>
 
         Update list of block ports according fetch spec

Modified: trunk/Source/WTF/wtf/PlatformEnable.h (270376 => 270377)


--- trunk/Source/WTF/wtf/PlatformEnable.h	2020-12-03 00:29:47 UTC (rev 270376)
+++ trunk/Source/WTF/wtf/PlatformEnable.h	2020-12-03 00:42:58 UTC (rev 270377)
@@ -594,6 +594,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)

Modified: trunk/Source/WTF/wtf/PlatformUse.h (270376 => 270377)


--- trunk/Source/WTF/wtf/PlatformUse.h	2020-12-03 00:29:47 UTC (rev 270376)
+++ trunk/Source/WTF/wtf/PlatformUse.h	2020-12-03 00:42:58 UTC (rev 270377)
@@ -313,10 +313,6 @@
 #define USE_LEGACY_CFNETWORK_DOWNLOADS 1
 #endif
 
-#if CPU(ARM64) && CPU(ADDRESS64)
-#define USE_JUMP_ISLANDS 1
-#endif
-
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) \
     || (PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
 #if USE(APPLE_INTERNAL_SDK)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to