Title: [288028] trunk/Source/_javascript_Core
Revision
288028
Author
sbar...@apple.com
Date
2022-01-14 13:07:47 -0800 (Fri, 14 Jan 2022)

Log Message

Make isJITPC fast
https://bugs.webkit.org/show_bug.cgi?id=235241

Reviewed by Yusuke Suzuki.

Make it an inlined function, and stop tagging g_jscConfig.startExecutableMemory
and g_jscConfig.endExecutableMemory, since they're in the Config page, and
not mutable after it's frozen.

* jit/ExecutableAllocator.cpp:
(JSC::initializeJITPageReservation):
(JSC::isJITPC): Deleted.
* jit/ExecutableAllocator.h:
(JSC::isJITPC):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (288027 => 288028)


--- trunk/Source/_javascript_Core/ChangeLog	2022-01-14 21:04:10 UTC (rev 288027)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-01-14 21:07:47 UTC (rev 288028)
@@ -1,5 +1,22 @@
 2022-01-14  Saam Barati  <sbar...@apple.com>
 
+        Make isJITPC fast
+        https://bugs.webkit.org/show_bug.cgi?id=235241
+
+        Reviewed by Yusuke Suzuki.
+
+        Make it an inlined function, and stop tagging g_jscConfig.startExecutableMemory
+        and g_jscConfig.endExecutableMemory, since they're in the Config page, and
+        not mutable after it's frozen.
+
+        * jit/ExecutableAllocator.cpp:
+        (JSC::initializeJITPageReservation):
+        (JSC::isJITPC): Deleted.
+        * jit/ExecutableAllocator.h:
+        (JSC::isJITPC):
+
+2022-01-14  Saam Barati  <sbar...@apple.com>
+
         Use IRC for Wasm, and Briggs for JS on ARM64
         https://bugs.webkit.org/show_bug.cgi?id=235235
         <rdar://87090631>

Modified: trunk/Source/_javascript_Core/jit/ExecutableAllocator.cpp (288027 => 288028)


--- trunk/Source/_javascript_Core/jit/ExecutableAllocator.cpp	2022-01-14 21:04:10 UTC (rev 288027)
+++ trunk/Source/_javascript_Core/jit/ExecutableAllocator.cpp	2022-01-14 21:07:47 UTC (rev 288028)
@@ -400,8 +400,8 @@
 #endif
 
         void* reservationEnd = reinterpret_cast<uint8_t*>(reservation.base) + reservation.size;
-        g_jscConfig.startExecutableMemory = tagCodePtr<ExecutableMemoryPtrTag>(reservation.base);
-        g_jscConfig.endExecutableMemory = tagCodePtr<ExecutableMemoryPtrTag>(reservationEnd);
+        g_jscConfig.startExecutableMemory = reservation.base;
+        g_jscConfig.endExecutableMemory = reservationEnd;
 
 #if !USE(SYSTEM_MALLOC) && ENABLE(UNIFIED_AND_FREEZABLE_CONFIG_RECORD)
         WebConfig::g_config[0] = bitwise_cast<uintptr_t>(reservation.base);
@@ -471,9 +471,8 @@
         m_reservation.deallocate();
     }
 
-    void* memoryStart() { return untagCodePtr<ExecutableMemoryPtrTag>(g_jscConfig.startExecutableMemory); }
-    void* memoryEnd() { return untagCodePtr<ExecutableMemoryPtrTag>(g_jscConfig.endExecutableMemory); }
-    bool isJITPC(void* pc) { return memoryStart() <= pc && pc < memoryEnd(); }
+    void* memoryStart() { return g_jscConfig.startExecutableMemory; }
+    void* memoryEnd() { return g_jscConfig.endExecutableMemory; }
     bool isValid() { return !!m_reservation; }
 
     RefPtr<ExecutableMemoryHandle> allocate(size_t sizeInBytes)
@@ -1129,12 +1128,6 @@
     return allocator->memoryEnd();
 }
 
-bool isJITPC(void* pc)
-{
-    FixedVMPoolExecutableAllocator* allocator = g_jscConfig.fixedVMPoolExecutableAllocator;
-    return allocator && allocator->isJITPC(pc);
-}
-
 void dumpJITMemory(const void* dst, const void* src, size_t size)
 {
     RELEASE_ASSERT(Options::dumpJITMemoryPath());

Modified: trunk/Source/_javascript_Core/jit/ExecutableAllocator.h (288027 => 288028)


--- trunk/Source/_javascript_Core/jit/ExecutableAllocator.h	2022-01-14 21:04:10 UTC (rev 288027)
+++ trunk/Source/_javascript_Core/jit/ExecutableAllocator.h	2022-01-14 21:07:47 UTC (rev 288028)
@@ -108,7 +108,10 @@
     return bitwise_cast<T>(endOfFixedExecutableMemoryPoolImpl());
 }
 
-JS_EXPORT_PRIVATE bool isJITPC(void* pc);
+ALWAYS_INLINE bool isJITPC(void* pc)
+{
+    return g_jscConfig.startExecutableMemory <= pc && pc < g_jscConfig.endExecutableMemory;
+}
 
 JS_EXPORT_PRIVATE void dumpJITMemory(const void*, const void*, size_t);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to