Changeset 234344 in webkit


Ignore:
Timestamp:
Jul 28, 2018 9:35:24 AM (6 years ago)
Author:
mark.lam@apple.com
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:
Location:
trunk/Source/WTF
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r234335 r234344  
     12018-07-28  Mark Lam  <mark.lam@apple.com>
     2
     3        Gardening: build fix for internal builds.
     4        https://bugs.webkit.org/show_bug.cgi?id=188123
     5        <rdar://problem/42672268>
     6
     7        Not reviewed.
     8
     9        Some code is relying on RELEASE_ASSERT (without extra crash info arguments)
     10        being purely inlined and not require linkage to an external symbol.  This patch
     11        restores this property of the original RELEASE_ASSERT.
     12
     13        This means moving the variant of WTFCrashWithInfo that does not take extra args
     14        to Assertions.h and making it an "inline" function.  When compiling with clang,
     15        we also specify __attribute__((optnone)) to force the function out of being an
     16        inline function (each linkage unit will get a copy of the function).  This causes
     17        the 1st 4 arguments of WTFCrashWithInfo (e.g. line number) to still be captured
     18        in the argument registers for crash diagnostics.
     19
     20        * wtf/Assertions.cpp:
     21        (WTFCrashWithInfo):
     22        * wtf/Assertions.h:
     23
    1242018-07-27  Mark Lam  <mark.lam@apple.com>
    225
  • trunk/Source/WTF/wtf/Assertions.cpp

    r234335 r234344  
    666666}
    667667
    668 void WTFCrashWithInfo(int, const char*, const char*, int)
    669 {
    670     __asm__ volatile (CRASH_INST : : );
    671     __builtin_unreachable();
    672 }
    673 
    674668#else
    675669
     
    681675void WTFCrashWithInfo(int, const char*, const char*, int, uint64_t, uint64_t) { CRASH(); }
    682676void WTFCrashWithInfo(int, const char*, const char*, int, uint64_t) { CRASH(); }
    683 void WTFCrashWithInfo(int, const char*, const char*, int) { CRASH(); }
    684677
    685678#endif // OS(DARWIN) && (CPU(X64_64) || CPU(ARM64))
  • trunk/Source/WTF/wtf/Assertions.h

    r234335 r234344  
    536536WTF_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);
    537537WTF_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);
    538 WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfo(int line, const char* file, const char* function, int counter);
    539 
     538NO_RETURN_DUE_TO_CRASH NOT_TAIL_CALLED void WTFCrashWithInfo(int line, const char* file, const char* function, int counter);
     539
     540inline void WTFCrashWithInfo(int, const char*, const char*, int)
     541#if COMPILER(CLANG)
     542    __attribute__((optnone))
     543#endif
     544{
     545    CRASH();
     546}
    540547
    541548namespace WTF {
Note: See TracChangeset for help on using the changeset viewer.