Title: [255139] trunk/Source/WTF
- Revision
- 255139
- Author
- [email protected]
- Date
- 2020-01-27 00:54:49 -0800 (Mon, 27 Jan 2020)
Log Message
Make getVTablePointer() an inline function to be compliant with WebKit style guidelines.
https://bugs.webkit.org/show_bug.cgi?id=206816
Reviewed by Darin Adler.
Convert getVTablePointer() from a macro into an inline template function. This
makes the naming compliant with WebKit style guidelines.
* wtf/PointerPreparations.h:
(WTF::getVTablePointer):
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (255138 => 255139)
--- trunk/Source/WTF/ChangeLog 2020-01-27 08:10:21 UTC (rev 255138)
+++ trunk/Source/WTF/ChangeLog 2020-01-27 08:54:49 UTC (rev 255139)
@@ -1,3 +1,16 @@
+2020-01-27 Mark Lam <[email protected]>
+
+ Make getVTablePointer() an inline function to be compliant with WebKit style guidelines.
+ https://bugs.webkit.org/show_bug.cgi?id=206816
+
+ Reviewed by Darin Adler.
+
+ Convert getVTablePointer() from a macro into an inline template function. This
+ makes the naming compliant with WebKit style guidelines.
+
+ * wtf/PointerPreparations.h:
+ (WTF::getVTablePointer):
+
2020-01-25 Brady Eidson <[email protected]>
Make ContentWorlds be identified by an ObjectIdentifier instead of a uint64_t
Modified: trunk/Source/WTF/wtf/PointerPreparations.h (255138 => 255139)
--- trunk/Source/WTF/wtf/PointerPreparations.h 2020-01-27 08:10:21 UTC (rev 255138)
+++ trunk/Source/WTF/wtf/PointerPreparations.h 2020-01-27 08:54:49 UTC (rev 255139)
@@ -31,18 +31,23 @@
namespace WTF {
-#if CPU(ARM64E)
+#if COMPILER_HAS_CLANG_BUILTIN(__builtin_get_vtable_pointer)
-#if __has_builtin(__builtin_get_vtable_pointer)
-#define getVTablePointer(o) __builtin_get_vtable_pointer(o)
-#else
-#define getVTablePointer(o) __builtin_ptrauth_auth(*(reinterpret_cast<void**>(o)), ptrauth_key_cxx_vtable_pointer, 0)
-#endif
+template<typename T>
+ALWAYS_INLINE void* getVTablePointer(T* o) { return __builtin_get_vtable_pointer(o); }
+#else // not COMPILER_HAS_CLANG_BUILTIN(__builtin_get_vtable_pointer)
+
+#if CPU(ARM64E)
+template<typename T>
+ALWAYS_INLINE void* getVTablePointer(T* o) { return __builtin_ptrauth_auth(*(reinterpret_cast<void**>(o)), ptrauth_key_cxx_vtable_pointer, 0); }
#else // not CPU(ARM64E)
+template<typename T>
+ALWAYS_INLINE void* getVTablePointer(T* o) { return (*(reinterpret_cast<void**>(o))); }
+#endif // not CPU(ARM64E)
-#define getVTablePointer(o) (*(reinterpret_cast<void**>(o)))
+#endif // not COMPILER_HAS_CLANG_BUILTIN(__builtin_get_vtable_pointer)
-#endif // not CPU(ARM64E)
+} // namespace WTF
-} // namespace WTF
+using WTF::getVTablePointer;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes