Bug 181545 - Move ExitProfile to UnlinkedCodeBlock so it can be shared amongst CodeBlocks backed by the same UnlinkedCodeBlock
Summary: Move ExitProfile to UnlinkedCodeBlock so it can be shared amongst CodeBlocks ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-01-11 11:11 PST by Saam Barati
Modified: 2018-04-30 09:19 PDT (History)
14 users (show)

See Also:


Attachments
WIP (25.02 KB, patch)
2018-01-11 18:21 PST, Saam Barati
no flags Details | Formatted Diff | Diff
patch (27.91 KB, patch)
2018-01-12 14:41 PST, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2018-01-11 11:11:49 PST
This will follow the theme of putting other optimization information on UnlinkedCodeBlock. This allows the unlinked code cache to remember OSR exit data. Obviously this can make some programs worse: if the same exact code is run in a different way. However, it's probably a solid heuristic in practice, since the same code tends to run in similar ways, and do similar things. Doing this appears to be a 1% speedup on Speedometer.
Comment 1 Saam Barati 2018-01-11 18:21:03 PST
Created attachment 331152 [details]
WIP
Comment 2 EWS Watchlist 2018-01-11 18:23:35 PST
Attachment 331152 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/bytecode/DFGExitProfile.h:178:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/bytecode/DFGExitProfile.h:179:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/bytecode/DFGExitProfile.h:181:  Should have a space between // and comment  [whitespace/comments] [4]
Total errors found: 3 in 15 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Saam Barati 2018-01-12 14:41:26 PST
Created attachment 331236 [details]
patch
Comment 4 Michael Saboff 2018-01-12 14:46:01 PST
Comment on attachment 331236 [details]
patch

r=me
Comment 5 WebKit Commit Bot 2018-01-12 16:36:42 PST
Comment on attachment 331236 [details]
patch

Clearing flags on attachment: 331236

Committed r226928: <https://trac.webkit.org/changeset/226928>
Comment 6 WebKit Commit Bot 2018-01-12 16:36:43 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2018-01-12 16:37:18 PST
<rdar://problem/36486548>
Comment 8 Saam Barati 2018-01-14 11:41:14 PST
This broke the CLOOP build. Fixing now.
Comment 9 Saam Barati 2018-01-14 11:44:00 PST
(In reply to Saam Barati from comment #8)
> This broke the CLOOP build. Fixing now.

Fixed CLOOP build in:
https://trac.webkit.org/changeset/226942/webkit
Comment 10 Filip Pizlo 2018-04-29 16:44:54 PDT
Comment on attachment 331236 [details]
patch

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

> Source/JavaScriptCore/dfg/DFGLICMPhase.cpp:284
> -            && m_graph.baselineCodeBlockFor(originalOrigin.semantic)->hasExitSite(FrequentExitSite(HoistingFailed))) {
> +            && m_graph.hasExitSite(originalOrigin.semantic, HoistingFailed)) {

This introduced a licm-dragons regression because you should have called hasGlobalExitSite.
Comment 11 Saam Barati 2018-04-29 21:06:52 PDT
Comment on attachment 331236 [details]
patch

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

B

>> Source/JavaScriptCore/dfg/DFGLICMPhase.cpp:284
>> +            && m_graph.hasExitSite(originalOrigin.semantic, HoistingFailed)) {
> 
> This introduced a licm-dragons regression because you should have called hasGlobalExitSite.

How is this different than what was here before?
Comment 12 Filip Pizlo 2018-04-29 23:28:37 PDT
(In reply to Saam Barati from comment #11)
> Comment on attachment 331236 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=331236&action=review
> 
> B
> 
> >> Source/JavaScriptCore/dfg/DFGLICMPhase.cpp:284
> >> +            && m_graph.hasExitSite(originalOrigin.semantic, HoistingFailed)) {
> > 
> > This introduced a licm-dragons regression because you should have called hasGlobalExitSite.
> 
> How is this different than what was here before?

Global exit sites don’t store the bytecode index.
Comment 13 Saam Barati 2018-04-30 09:18:47 PDT
(In reply to Filip Pizlo from comment #12)
> (In reply to Saam Barati from comment #11)
> > Comment on attachment 331236 [details]
> > patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=331236&action=review
> > 
> > B
> > 
> > >> Source/JavaScriptCore/dfg/DFGLICMPhase.cpp:284
> > >> +            && m_graph.hasExitSite(originalOrigin.semantic, HoistingFailed)) {
> > > 
> > > This introduced a licm-dragons regression because you should have called hasGlobalExitSite.
> > 
> > How is this different than what was here before?
> 
> Global exit sites don’t store the bytecode index.

I understand that. But the code wasn’t using global exit site before my change either...
Comment 14 Saam Barati 2018-04-30 09:19:33 PDT
(In reply to Saam Barati from comment #13)
> (In reply to Filip Pizlo from comment #12)
> > (In reply to Saam Barati from comment #11)
> > > Comment on attachment 331236 [details]
> > > patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=331236&action=review
> > > 
> > > B
> > > 
> > > >> Source/JavaScriptCore/dfg/DFGLICMPhase.cpp:284
> > > >> +            && m_graph.hasExitSite(originalOrigin.semantic, HoistingFailed)) {
> > > > 
> > > > This introduced a licm-dragons regression because you should have called hasGlobalExitSite.
> > > 
> > > How is this different than what was here before?
> > 
> > Global exit sites don’t store the bytecode index.
> 
> I understand that. But the code wasn’t using global exit site before my
> change either...

Oh wait. Yeah it was. I see