Bug 145850

Summary: Simplify things like CompareEq(@x,@x)
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, basile_clement, benjamin, commit-queue, ggaren, mark.lam, mhahnenb, mmirman, msaboff, nrotem, oliver, saam, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
should just work
none
the patch sam: review+

Description Filip Pizlo 2015-06-10 12:18:22 PDT
I'm seeing cases where these sort of float past our optimizations.  It's all because of silly omissions, like AI not handling CompareEq(@x, @x) and CFG simplification not being run in SSA.
Comment 1 Filip Pizlo 2015-06-10 14:58:18 PDT
Created attachment 254680 [details]
should just work
Comment 2 Filip Pizlo 2015-07-22 20:03:40 PDT
Created attachment 257330 [details]
the patch
Comment 3 WebKit Commit Bot 2015-07-22 20:06:02 PDT
Attachment 257330 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1193:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1193:  Multi line control clauses should use braces.  [whitespace/braces] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1194:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1195:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1196:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1197:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1198:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1199:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1253:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1253:  Multi line control clauses should use braces.  [whitespace/braces] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1254:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1255:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1256:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1257:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1258:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1259:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1260:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1261:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1262:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1263:  Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side.  [whitespace/operators] [4]
Total errors found: 20 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Filip Pizlo 2015-07-22 20:08:55 PDT
(In reply to comment #3)
> Attachment 257330 [details] did not pass style-queue:
> 
> 
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1193: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1193: 
> Multi line control clauses should use braces.  [whitespace/braces] [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1194: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1195: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1196: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1197: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1198: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1199: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1253: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1253: 
> Multi line control clauses should use braces.  [whitespace/braces] [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1254: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1255: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1256: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1257: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1258: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1259: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1260: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1261: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1262: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> ERROR: Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1263: 
> Boolean expressions that span multiple lines should have their operators on
> the left side of the line instead of the right side.  [whitespace/operators]
> [4]
> Total errors found: 20 in 4 files
> 
> 
> If any of these errors are false positives, please file a bug against
> check-webkit-style.

I intentionally broke with the custom here because I wanted the various conditions to line up.  I think it makes the code more legible in this case.
Comment 5 Filip Pizlo 2015-07-22 21:53:29 PDT
Landed in http://trac.webkit.org/changeset/187213