Bug 175440 - Apply the UNLIKELY macro to some unlikely things.
Summary: Apply the UNLIKELY macro to some unlikely things.
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: 2017-08-10 13:50 PDT by Mark Lam
Modified: 2017-08-10 16:00 PDT (History)
7 users (show)

See Also:


Attachments
proposed patch. (17.93 KB, patch)
2017-08-10 14:13 PDT, Mark Lam
ysuzuki: review+
Details | Formatted Diff | Diff
patch for landing. (17.97 KB, patch)
2017-08-10 14:28 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 2017-08-10 13:50:36 PDT
These changes came about from noticing that VM::m_perBytecodeProfiler is only used when Options::useProfiler() is true.  Options::useProfiler() is false by default.
Comment 1 Radar WebKit Bug Importer 2017-08-10 13:52:10 PDT
<rdar://problem/33834767>
Comment 2 Mark Lam 2017-08-10 14:13:21 PDT
Created attachment 317843 [details]
proposed patch.
Comment 3 Build Bot 2017-08-10 14:15:14 PDT
Attachment 317843 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:147:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
Total errors found: 1 in 15 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Yusuke Suzuki 2017-08-10 14:17:28 PDT
Comment on attachment 317843 [details]
proposed patch.

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

r=me

> Source/JavaScriptCore/bytecode/CodeBlock.cpp:1920
> +        if (UNLIKELY(Profiler::Compilation* compilation = jitCode()->dfgCommon()->compilation.get()))

IIRC, this does not work in some platforms (it causes compiling error). `if (UNLIKELY(Type x = ...))`
Please check EWS. If EWS becomes green, ignore this comment :)

> Source/JavaScriptCore/ftl/FTLLink.cpp:71
> +    if (UNLIKELY(Profiler::Compilation* compilation = graph.compilation())) {

Ditto.

> Source/JavaScriptCore/runtime/ScriptExecutable.cpp:160
> +        if (UNLIKELY(Debugger* debugger = genericCodeBlock->globalObject()->debugger()))

Ditto.
Comment 5 Mark Lam 2017-08-10 14:25:20 PDT
Thanks for the review.  I've fixed the issues, and will retest on EWS.
Comment 6 Mark Lam 2017-08-10 14:28:54 PDT
Created attachment 317848 [details]
patch for landing.
Comment 7 Build Bot 2017-08-10 14:31:44 PDT
Attachment 317848 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/dfg/DFGPlan.cpp:147:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
Total errors found: 1 in 15 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 WebKit Commit Bot 2017-08-10 16:00:09 PDT
Comment on attachment 317848 [details]
patch for landing.

Clearing flags on attachment: 317848

Committed r220556: <http://trac.webkit.org/changeset/220556>
Comment 9 WebKit Commit Bot 2017-08-10 16:00:11 PDT
All reviewed patches have been landed.  Closing bug.