[webkit-dev] Why does RELEASE_ASSERT not have an error message?

Mark Lam mark.lam at apple.com
Thu Feb 23 14:13:19 PST 2017


To give an update: I plan to experiment and get some size and perf numbers and report back later.  But since this is not a high priority task for me, it may be a while before I get back to this.

Mark

> On Feb 22, 2017, at 1:25 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:
> 
> On Wed, Feb 22, 2017 at 12:41 PM, Mark Lam <mark.lam at apple.com> wrote:
>> 
>> I would like to point out that we might be able to get the best of both worlds.  Here’s how we can do it:
>> 
>> define RELEASE_ASSERT(assertion) do { \
>>    if (UNLIKELY(!(assertion))) { \
>>        preserveRegisterState(); \
>>        WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion); \
>>        restoreRegisterState(); \
>>        CRASH(); \
>>    } \
>> 
>> preserveRegisterState() and restoreRegisterState() will carefully push and pop registers onto / off the stack (like how the JIT probe works).
>> 
> 
> I'm afraid this would bloat the binary size too much. You can test but
> I'd be surprised if this didn't negatively impact perf especially in
> WebCore code.
> 
> - R. Niwa



More information about the webkit-dev mailing list