Bug 117677

Summary: fourthTier: Add CFG simplification for Switch
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, benjamin, buildbot, cmarcelo, commit-queue, eflews.bot, ggaren, gyuyoung.kim, mark.lam, mhahnenberg, msaboff, oliver, philn, rego+ews, rniwa, sam, webkit-ews, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
the patch
eflews.bot: commit-queue-
the patch
eflews.bot: commit-queue-
the ptach mhahnenberg: review+, eflews.bot: commit-queue-

Description Filip Pizlo 2013-06-15 17:11:06 PDT
Patch forthcoming.
Comment 1 Filip Pizlo 2013-06-15 17:12:01 PDT
Created attachment 204777 [details]
the patch
Comment 2 WebKit Commit Bot 2013-06-15 17:13:36 PDT
Attachment 204777 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source/JavaScriptCore/dfg/DFGCFGSimplificationPhase.cpp', u'Source/JavaScriptCore/runtime/JSCJSValue.h', u'Source/JavaScriptCore/runtime/JSCJSValueInlines.h']" exit_code: 1
Source/JavaScriptCore/dfg/DFGCFGSimplificationPhase.cpp:313:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/JavaScriptCore/dfg/DFGCFGSimplificationPhase.cpp:320:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/JavaScriptCore/dfg/DFGCFGSimplificationPhase.cpp:327:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
Total errors found: 3 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 EFL EWS Bot 2013-06-15 17:16:47 PDT
Comment on attachment 204777 [details]
the patch

Attachment 204777 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/922198
Comment 4 Early Warning System Bot 2013-06-15 17:18:02 PDT
Comment on attachment 204777 [details]
the patch

Attachment 204777 [details] did not pass qt-ews (qt):
Output: http://webkit-queues.appspot.com/results/890288
Comment 5 EFL EWS Bot 2013-06-15 17:18:35 PDT
Comment on attachment 204777 [details]
the patch

Attachment 204777 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/873251
Comment 6 Early Warning System Bot 2013-06-15 17:19:19 PDT
Comment on attachment 204777 [details]
the patch

Attachment 204777 [details] did not pass qt-wk2-ews (qt-wk2):
Output: http://webkit-queues.appspot.com/results/873249
Comment 7 Filip Pizlo 2013-06-15 17:28:02 PDT
Created attachment 204778 [details]
the patch

Fix style
Comment 8 EFL EWS Bot 2013-06-15 17:32:02 PDT
Comment on attachment 204778 [details]
the patch

Attachment 204778 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/846441
Comment 9 EFL EWS Bot 2013-06-15 17:32:22 PDT
Comment on attachment 204778 [details]
the patch

Attachment 204778 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/855477
Comment 10 Early Warning System Bot 2013-06-15 17:32:23 PDT
Comment on attachment 204778 [details]
the patch

Attachment 204778 [details] did not pass qt-ews (qt):
Output: http://webkit-queues.appspot.com/results/890289
Comment 11 Early Warning System Bot 2013-06-15 17:34:23 PDT
Comment on attachment 204778 [details]
the patch

Attachment 204778 [details] did not pass qt-wk2-ews (qt-wk2):
Output: http://webkit-queues.appspot.com/results/855478
Comment 12 Build Bot 2013-06-15 17:55:41 PDT
Comment on attachment 204778 [details]
the patch

Attachment 204778 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/920181
Comment 13 Build Bot 2013-06-15 18:02:52 PDT
Comment on attachment 204778 [details]
the patch

Attachment 204778 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/906209
Comment 14 Build Bot 2013-06-15 18:05:12 PDT
Comment on attachment 204778 [details]
the patch

Attachment 204778 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/906212
Comment 15 Sam Weinig 2013-06-15 18:59:17 PDT
It would be nice for the ChangeLog to have a bit of information in it, like why this is a good idea, and if it speeds anything up.
Comment 16 Filip Pizlo 2013-06-15 19:04:04 PDT
(In reply to comment #15)
> It would be nice for the ChangeLog to have a bit of information in it, like why this is a good idea, and if it speeds anything up.

It's for completeness.  It only speeds up a microbenchmark at this point.  But broadly, we want all control constructs to be known to the CFG simplifier.

I'll add that text to the ChangeLog.
Comment 17 Filip Pizlo 2013-06-15 20:22:47 PDT
Created attachment 204780 [details]
the ptach

And now with tests.
Comment 18 EFL EWS Bot 2013-06-15 20:28:40 PDT
Comment on attachment 204780 [details]
the ptach

Attachment 204780 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/924189
Comment 19 Early Warning System Bot 2013-06-15 20:30:33 PDT
Comment on attachment 204780 [details]
the ptach

Attachment 204780 [details] did not pass qt-ews (qt):
Output: http://webkit-queues.appspot.com/results/867478
Comment 20 EFL EWS Bot 2013-06-15 20:32:31 PDT
Comment on attachment 204780 [details]
the ptach

Attachment 204780 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/902228
Comment 21 Early Warning System Bot 2013-06-15 20:32:58 PDT
Comment on attachment 204780 [details]
the ptach

Attachment 204780 [details] did not pass qt-wk2-ews (qt-wk2):
Output: http://webkit-queues.appspot.com/results/920203
Comment 22 Build Bot 2013-06-15 20:46:35 PDT
Comment on attachment 204780 [details]
the ptach

Attachment 204780 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/920201
Comment 23 Build Bot 2013-06-15 20:58:42 PDT
Comment on attachment 204780 [details]
the ptach

Attachment 204780 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/906242
Comment 24 Build Bot 2013-06-15 20:58:58 PDT
Comment on attachment 204780 [details]
the ptach

Attachment 204780 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/873287
Comment 25 Mark Hahnenberg 2013-06-16 16:07:56 PDT
Comment on attachment 204780 [details]
the ptach

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

r=me

> Source/JavaScriptCore/dfg/DFGCFGSimplificationPhase.cpp:190
> +                        for (unsigned i = data->cases.size(); found == FalseTriState && i--;) {

What happens if there are multiple case statements with the same constants?
Comment 26 Filip Pizlo 2013-06-17 09:18:51 PDT
(In reply to comment #25)
> (From update of attachment 204780 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=204780&action=review
> 
> r=me
> 
> > Source/JavaScriptCore/dfg/DFGCFGSimplificationPhase.cpp:190
> > +                        for (unsigned i = data->cases.size(); found == FalseTriState && i--;) {
> 
> What happens if there are multiple case statements with the same constants?

Won't happen since the bytecode's jump tables never have duplicates.  I'll add a comment at the declaration of SwitchCase.
Comment 27 Filip Pizlo 2013-06-17 09:22:59 PDT
Landed in http://trac.webkit.org/changeset/151644