Title: [234344] trunk/Source/WTF
Revision
234344
Author
[email protected]
Date
2018-07-28 09:35:24 -0700 (Sat, 28 Jul 2018)

Log Message

Gardening: build fix for internal builds.
https://bugs.webkit.org/show_bug.cgi?id=188123
<rdar://problem/42672268>

Not reviewed.

Some code is relying on RELEASE_ASSERT (without extra crash info arguments)
being purely inlined and not require linkage to an external symbol.  This patch
restores this property of the original RELEASE_ASSERT.

This means moving the variant of WTFCrashWithInfo that does not take extra args
to Assertions.h and making it an "inline" function.  When compiling with clang,
we also specify __attribute__((optnone)) to force the function out of being an
inline function (each linkage unit will get a copy of the function).  This causes
the 1st 4 arguments of WTFCrashWithInfo (e.g. line number) to still be captured
in the argument registers for crash diagnostics.

* wtf/Assertions.cpp:
(WTFCrashWithInfo):
* wtf/Assertions.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (234343 => 234344)


--- trunk/Source/WTF/ChangeLog	2018-07-28 05:22:05 UTC (rev 234343)
+++ trunk/Source/WTF/ChangeLog	2018-07-28 16:35:24 UTC (rev 234344)
@@ -1,3 +1,26 @@
+2018-07-28  Mark Lam  <[email protected]>
+
+        Gardening: build fix for internal builds.
+        https://bugs.webkit.org/show_bug.cgi?id=188123
+        <rdar://problem/42672268>
+
+        Not reviewed.
+
+        Some code is relying on RELEASE_ASSERT (without extra crash info arguments)
+        being purely inlined and not require linkage to an external symbol.  This patch
+        restores this property of the original RELEASE_ASSERT.
+
+        This means moving the variant of WTFCrashWithInfo that does not take extra args
+        to Assertions.h and making it an "inline" function.  When compiling with clang,
+        we also specify __attribute__((optnone)) to force the function out of being an
+        inline function (each linkage unit will get a copy of the function).  This causes
+        the 1st 4 arguments of WTFCrashWithInfo (e.g. line number) to still be captured
+        in the argument registers for crash diagnostics.
+
+        * wtf/Assertions.cpp:
+        (WTFCrashWithInfo):
+        * wtf/Assertions.h:
+
 2018-07-27  Mark Lam  <[email protected]>
 
         Add some crash info to Heap::checkConn() RELEASE_ASSERTs.

Modified: trunk/Source/WTF/wtf/Assertions.cpp (234343 => 234344)


--- trunk/Source/WTF/wtf/Assertions.cpp	2018-07-28 05:22:05 UTC (rev 234343)
+++ trunk/Source/WTF/wtf/Assertions.cpp	2018-07-28 16:35:24 UTC (rev 234344)
@@ -665,12 +665,6 @@
     __builtin_unreachable();
 }
 
-void WTFCrashWithInfo(int, const char*, const char*, int)
-{
-    __asm__ volatile (CRASH_INST : : );
-    __builtin_unreachable();
-}
-
 #else
 
 void WTFCrashWithInfo(int, const char*, const char*, int, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t) { CRASH(); }
@@ -680,7 +674,6 @@
 void WTFCrashWithInfo(int, const char*, const char*, int, uint64_t, uint64_t, uint64_t) { CRASH(); }
 void WTFCrashWithInfo(int, const char*, const char*, int, uint64_t, uint64_t) { CRASH(); }
 void WTFCrashWithInfo(int, const char*, const char*, int, uint64_t) { CRASH(); }
-void WTFCrashWithInfo(int, const char*, const char*, int) { CRASH(); }
 
 #endif // OS(DARWIN) && (CPU(X64_64) || CPU(ARM64))
 

Modified: trunk/Source/WTF/wtf/Assertions.h (234343 => 234344)


--- trunk/Source/WTF/wtf/Assertions.h	2018-07-28 05:22:05 UTC (rev 234343)
+++ trunk/Source/WTF/wtf/Assertions.h	2018-07-28 16:35:24 UTC (rev 234344)
@@ -535,8 +535,15 @@
 WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfo(int line, const char* file, const char* function, int counter, uint64_t reason, uint64_t misc1, uint64_t misc2);
 WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfo(int line, const char* file, const char* function, int counter, uint64_t reason, uint64_t misc1);
 WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfo(int line, const char* file, const char* function, int counter, uint64_t reason);
-WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfo(int line, const char* file, const char* function, int counter);
+NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfo(int line, const char* file, const char* function, int counter);
 
+inline void WTFCrashWithInfo(int, const char*, const char*, int)
+#if COMPILER(CLANG)
+    __attribute__((optnone))
+#endif
+{
+    CRASH();
+}
 
 namespace WTF {
 inline void isIntegralType() { }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to