Bug 212084 - Remove unnecessary debug logging from release builds.
Summary: Remove unnecessary debug logging from release builds.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-19 09:35 PDT by Mark Lam
Modified: 2020-05-19 10:57 PDT (History)
7 users (show)

See Also:


Attachments
proposed patch. (1.80 KB, patch)
2020-05-19 09:51 PDT, Mark Lam
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2020-05-19 09:35:59 PDT
...
Comment 1 Radar WebKit Bug Importer 2020-05-19 09:36:24 PDT
<rdar://problem/63398704>
Comment 2 Mark Lam 2020-05-19 09:51:12 PDT
Created attachment 399743 [details]
proposed patch.
Comment 3 EWS 2020-05-19 10:53:56 PDT
Committed r261870: <https://trac.webkit.org/changeset/261870>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 399743 [details].
Comment 4 Darin Adler 2020-05-19 10:57:03 PDT
Comment on attachment 399743 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=399743&action=review

> Source/WTF/wtf/PtrTag.h:115
>  #if ASSERT_ENABLED
>  constexpr bool enablePtrTagDebugAssert = true;
> +#define REPORT_BAD_TAG(success, ptr, expectedTag) do { \
> +        if (UNLIKELY(!success)) \
> +            reportBadTag(reinterpret_cast<const void*>(ptr), expectedTag); \
> +    } while (false)
>  #else
>  constexpr bool enablePtrTagDebugAssert = false;
> +#define REPORT_BAD_TAG(success, ptr, expectedTag)
>  #endif

I like this, but I would like to point out that in this case, this could have been an inline function rather than a macro; an empty inline function would neatly compile down to nothing.