Title: [294429] trunk/Source/_javascript_Core/assembler/SecureARM64EHashPinsInlines.h
Revision
294429
Author
[email protected]
Date
2022-05-18 13:43:25 -0700 (Wed, 18 May 2022)

Log Message

Small clean ups in SecureARM64EHashPins.
https://bugs.webkit.org/show_bug.cgi?id=240587

Reviewed by Yusuke Suzuki.

1. In SecureARM64EHashPins::keyForCurrentThread(), there's no need to add 1 to
   the value retrieve from TPIDRRO_EL0.  TPIDRRO_EL0 is a pointer to valid memory
   and can never be 0.  Also, we already code in multiple other places where we
   expect to load from it without a null check.

2. SecureARM64EHashPins::forEachPage() should use a do-while loop instead of a
   for loop.  This is because we are guaranteed to at least have 1 page at
   start up if the JIT is enabled.  If the JIT is not enabled, this code will
   never be called.

* Source/_javascript_Core/assembler/SecureARM64EHashPinsInlines.h:
(JSC::SecureARM64EHashPins::keyForCurrentThread):
(JSC::SecureARM64EHashPins::forEachPage):

Canonical link: https://commits.webkit.org/250711@main

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/assembler/SecureARM64EHashPinsInlines.h (294428 => 294429)


--- trunk/Source/_javascript_Core/assembler/SecureARM64EHashPinsInlines.h	2022-05-18 20:39:03 UTC (rev 294428)
+++ trunk/Source/_javascript_Core/assembler/SecureARM64EHashPinsInlines.h	2022-05-18 20:43:25 UTC (rev 294429)
@@ -43,17 +43,19 @@
 #if !HAVE(SIMPLIFIED_FAST_TLS_BASE)
     result = result & ~0x7ull;
 #endif
-    return result + 1;
+    return result;
 }
 
 template <typename Function>
 ALWAYS_INLINE void SecureARM64EHashPins::forEachPage(Function function)
 {
-    for (Page* page = firstPage(); page; page = page->next) {
+    Page* page = firstPage();
+    do {
         RELEASE_ASSERT(isJITPC(page));
         if (function(*page) == IterationStatus::Done)
             return;
-    }
+        page = page->next
+    } while (page);
 }
 
 template <typename Function>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to