Bug 175440

Summary: Apply the UNLIKELY macro to some unlikely things.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, keith_miller, msaboff, sbarati, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch.
ysuzuki: review+
patch for landing. none

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.