WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
206332
Use dataLogIf more regularly
https://bugs.webkit.org/show_bug.cgi?id=206332
Summary
Use dataLogIf more regularly
Robin Morisset
Reported
2020-01-15 18:15:24 PST
There is lots of code that reads if(Options::foobar()) dataLogLn("...") There are a couple of benefits to replacing those by dataLogLnIf(Options::foobar(), "..."): - Readability, by reducing the number of lines taken by logging - Less lines appearing as not-taken in test coverage wrongly (wrongly because we probably don't care for the coverage of logging code) - possibly a tiny perf benefit since dataLogIf correctly uses UNLIKELY. This patch is a fairly trivial refactoring where I looked for that pattern and replaced it everywhere it appeared in JSC.
Attachments
Patch
(99.53 KB, patch)
2020-01-15 18:18 PST
,
Robin Morisset
keith_miller
: review+
keith_miller
: commit-queue-
Details
Formatted Diff
Diff
Patch
(99.63 KB, patch)
2020-01-16 14:40 PST
,
Robin Morisset
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Robin Morisset
Comment 1
2020-01-15 18:18:49 PST
Created
attachment 387883
[details]
Patch
Keith Miller
Comment 2
2020-01-15 18:43:17 PST
Comment on
attachment 387883
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=387883&action=review
r=me with nits.
> Source/JavaScriptCore/ftl/FTLOSREntry.cpp:64 > + dataLogLnIf(Options::verboseOSR()," OSR failed because we don't have an entrypoint for ", bytecodeIndex, "; ours is for ", entryCode->bytecodeIndex());
Can you add a space here?
> Source/JavaScriptCore/ftl/FTLOSREntry.cpp:71 > + dataLogLnIf(Options::verboseOSR()," Values at entry: ", values);
ditto.
> Source/JavaScriptCore/ftl/FTLOSREntry.cpp:100 > + dataLogLnIf(Options::verboseOSR()," OSR failed because stack growth failed.");
ditto.
> Source/JavaScriptCore/ftl/FTLOSREntry.cpp:107 > + dataLogLnIf(Options::verboseOSR()," Entry will succeed, going to address ", RawPointer(result));
Ditto.
> Source/WTF/ChangeLog:9 > + (WTF::dataLog): Marked NEVER_INLINE
Why never inline this?
Robin Morisset
Comment 3
2020-01-16 14:40:29 PST
Thanks for the review. (In reply to Keith Miller from
comment #2
)
> Comment on
attachment 387883
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=387883&action=review
> > r=me with nits. > > > Source/JavaScriptCore/ftl/FTLOSREntry.cpp:64 > > + dataLogLnIf(Options::verboseOSR()," OSR failed because we don't have an entrypoint for ", bytecodeIndex, "; ours is for ", entryCode->bytecodeIndex()); > > Can you add a space here?
Fixed, as well as the other ones.
> > Source/WTF/ChangeLog:9 > > + (WTF::dataLog): Marked NEVER_INLINE > > Why never inline this?
Because if logging is on the critical path for performance we have much bigger problems to be concerned about, and I don't want to have the compiler waste time trying to optimize the way we call logging code?
Robin Morisset
Comment 4
2020-01-16 14:40:48 PST
Created
attachment 387962
[details]
Patch
WebKit Commit Bot
Comment 5
2020-01-16 15:24:43 PST
Comment on
attachment 387962
[details]
Patch Clearing flags on attachment: 387962 Committed
r254714
: <
https://trac.webkit.org/changeset/254714
>
WebKit Commit Bot
Comment 6
2020-01-16 15:24:45 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug