Title: [218867] trunk/Source/_javascript_Core
Revision
218867
Author
[email protected]
Date
2017-06-27 23:23:23 -0700 (Tue, 27 Jun 2017)

Log Message

JITStubRoutine::passesFilter should use isJITPC
https://bugs.webkit.org/show_bug.cgi?id=173906

Reviewed by JF Bastien.

This patch makes JITStubRoutine use the isJITPC abstraction defined
inside ExecutableAllocator.h. Before, JITStubRoutine was using a
hardcoded platform size constant. This means it'd do the wrong thing
if Options::jitMemoryReservationSize() was larger than the defined
constant for that platform. This patch also removes a bunch of
dead code in that file.

* jit/ExecutableAllocator.cpp:
* jit/ExecutableAllocator.h:
* jit/JITStubRoutine.h:
(JSC::JITStubRoutine::passesFilter):
(JSC::JITStubRoutine::canPerformRangeFilter): Deleted.
(JSC::JITStubRoutine::filteringStartAddress): Deleted.
(JSC::JITStubRoutine::filteringExtentSize): Deleted.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (218866 => 218867)


--- trunk/Source/_javascript_Core/ChangeLog	2017-06-28 05:45:59 UTC (rev 218866)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-06-28 06:23:23 UTC (rev 218867)
@@ -1,5 +1,27 @@
 2017-06-27  Saam Barati  <[email protected]>
 
+        JITStubRoutine::passesFilter should use isJITPC
+        https://bugs.webkit.org/show_bug.cgi?id=173906
+
+        Reviewed by JF Bastien.
+
+        This patch makes JITStubRoutine use the isJITPC abstraction defined
+        inside ExecutableAllocator.h. Before, JITStubRoutine was using a
+        hardcoded platform size constant. This means it'd do the wrong thing
+        if Options::jitMemoryReservationSize() was larger than the defined
+        constant for that platform. This patch also removes a bunch of
+        dead code in that file.
+
+        * jit/ExecutableAllocator.cpp:
+        * jit/ExecutableAllocator.h:
+        * jit/JITStubRoutine.h:
+        (JSC::JITStubRoutine::passesFilter):
+        (JSC::JITStubRoutine::canPerformRangeFilter): Deleted.
+        (JSC::JITStubRoutine::filteringStartAddress): Deleted.
+        (JSC::JITStubRoutine::filteringExtentSize): Deleted.
+
+2017-06-27  Saam Barati  <[email protected]>
+
         Fix some stale comments in Wasm code base
         https://bugs.webkit.org/show_bug.cgi?id=173814
 

Modified: trunk/Source/_javascript_Core/jit/ExecutableAllocator.cpp (218866 => 218867)


--- trunk/Source/_javascript_Core/jit/ExecutableAllocator.cpp	2017-06-28 05:45:59 UTC (rev 218866)
+++ trunk/Source/_javascript_Core/jit/ExecutableAllocator.cpp	2017-06-28 06:23:23 UTC (rev 218867)
@@ -82,6 +82,24 @@
 
 namespace JSC {
 
+#if defined(FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB) && FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB > 0
+static const size_t fixedExecutableMemoryPoolSize = FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB * 1024 * 1024;
+#elif CPU(ARM)
+static const size_t fixedExecutableMemoryPoolSize = 16 * 1024 * 1024;
+#elif CPU(ARM64)
+static const size_t fixedExecutableMemoryPoolSize = 64 * 1024 * 1024;
+#elif CPU(X86_64)
+static const size_t fixedExecutableMemoryPoolSize = 1024 * 1024 * 1024;
+#else
+static const size_t fixedExecutableMemoryPoolSize = 32 * 1024 * 1024;
+#endif
+
+#if CPU(ARM)
+static const double executablePoolReservationFraction = 0.15;
+#else
+static const double executablePoolReservationFraction = 0.25;
+#endif
+
 JS_EXPORTDATA uintptr_t startOfFixedExecutableMemoryPool;
 JS_EXPORTDATA uintptr_t endOfFixedExecutableMemoryPool;
 JS_EXPORTDATA bool useFastPermisionsJITCopy { false };

Modified: trunk/Source/_javascript_Core/jit/ExecutableAllocator.h (218866 => 218867)


--- trunk/Source/_javascript_Core/jit/ExecutableAllocator.h	2017-06-28 05:45:59 UTC (rev 218866)
+++ trunk/Source/_javascript_Core/jit/ExecutableAllocator.h	2017-06-28 06:23:23 UTC (rev 218867)
@@ -60,23 +60,6 @@
 
 #if ENABLE(ASSEMBLER)
 
-#if defined(FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB) && FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB > 0
-static const size_t fixedExecutableMemoryPoolSize = FIXED_EXECUTABLE_MEMORY_POOL_SIZE_IN_MB * 1024 * 1024;
-#elif CPU(ARM)
-static const size_t fixedExecutableMemoryPoolSize = 16 * 1024 * 1024;
-#elif CPU(ARM64)
-static const size_t fixedExecutableMemoryPoolSize = 64 * 1024 * 1024;
-#elif CPU(X86_64)
-static const size_t fixedExecutableMemoryPoolSize = 1024 * 1024 * 1024;
-#else
-static const size_t fixedExecutableMemoryPoolSize = 32 * 1024 * 1024;
-#endif
-#if CPU(ARM)
-static const double executablePoolReservationFraction = 0.15;
-#else
-static const double executablePoolReservationFraction = 0.25;
-#endif
-
 extern JS_EXPORTDATA uintptr_t startOfFixedExecutableMemoryPool;
 extern JS_EXPORTDATA uintptr_t endOfFixedExecutableMemoryPool;
 

Modified: trunk/Source/_javascript_Core/jit/JITStubRoutine.h (218866 => 218867)


--- trunk/Source/_javascript_Core/jit/JITStubRoutine.h	2017-06-28 05:45:59 UTC (rev 218866)
+++ trunk/Source/_javascript_Core/jit/JITStubRoutine.h	2017-06-28 06:23:23 UTC (rev 218867)
@@ -96,30 +96,9 @@
     uintptr_t endAddress() const { return m_code.executableMemory()->endAsInteger(); }
     static uintptr_t addressStep() { return jitAllocationGranule; }
     
-    static bool canPerformRangeFilter()
-    {
-        return true;
-    }
-    static uintptr_t filteringStartAddress()
-    {
-        return startOfFixedExecutableMemoryPool;
-    }
-    static size_t filteringExtentSize()
-    {
-        return fixedExecutableMemoryPoolSize;
-    }
     static bool passesFilter(uintptr_t address)
     {
-        if (!canPerformRangeFilter()) {
-            // Just check that the address doesn't use any special values that would make
-            // our hashtables upset.
-            return address >= jitAllocationGranule && address != std::numeric_limits<uintptr_t>::max();
-        }
-        
-        if (address - filteringStartAddress() >= filteringExtentSize())
-            return false;
-        
-        return true;
+        return isJITPC(bitwise_cast<void*>(address));
     }
     
     // Return true if you are still valid after. Return false if you are now invalid. If you return
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to