Bug 159612 - Inline store loop for CopyRest in DFG and FTL for certain array modes
Summary: Inline store loop for CopyRest in DFG and FTL for certain array modes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords:
Depends on:
Blocks: 159081
  Show dependency treegraph
 
Reported: 2016-07-10 18:54 PDT by Saam Barati
Modified: 2016-08-12 19:16 PDT (History)
11 users (show)

See Also:


Attachments
WIP (7.32 KB, patch)
2016-07-10 19:13 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
patch (15.67 KB, patch)
2016-08-10 17:24 PDT, Saam Barati
fpizlo: review-
Details | Formatted Diff | Diff
WIP (41.02 KB, patch)
2016-08-10 20:26 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (52.43 KB, patch)
2016-08-11 19:43 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
patch (63.32 KB, patch)
2016-08-12 12:26 PDT, Saam Barati
fpizlo: review+
Details | Formatted Diff | Diff
patch for landing (66.44 KB, patch)
2016-08-12 15:13 PDT, 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 2016-07-10 18:54:29 PDT
...
Comment 1 Saam Barati 2016-07-10 19:13:39 PDT
Created attachment 283294 [details]
WIP

This makes trivial test programs like 50% faster.
It makes Fil's air.js benchmark ~7% faster.
Comment 2 WebKit Commit Bot 2016-07-10 19:15:51 PDT
Attachment 283294 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:3804:  Missing space after ,  [whitespace/comma] [3]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Saam Barati 2016-08-10 17:24:17 PDT
Created attachment 285788 [details]
patch
Comment 4 WebKit Commit Bot 2016-08-10 17:25:54 PDT
Attachment 285788 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:3889:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Filip Pizlo 2016-08-10 17:27:07 PDT
Comment on attachment 285788 [details]
patch

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

> Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:2871
> +        IndexingType indexingType = node->child1()->indexingType();

This is really bad.  You're requiring that the child of CopyRest is NewArray.

A property of any good IR is that this:

a: Foo()
b: Bar(@a)

Must always behave the same as:

a: Foo()
x: Identity(@a)
b: Bar(@x)

Or even:

a: Foo()
Upsilon(@a, ^p)
...
p: Phi()
b: Bar(@p)

Clearly, any of these transformations would break your patch here and in other places.  Therefore, I believe your change is not sound.
Comment 6 Saam Barati 2016-08-10 17:43:46 PDT
After speaking with Filip in person, I'm going to change
CopyRest and copy_rest to produce the array itself
instead of consuming it as an argument.
Comment 7 Saam Barati 2016-08-10 20:26:04 PDT
Created attachment 285811 [details]
WIP

Might be the patch. I just need to see if it's possible to end up with an array larger
than MIN_ARRAY_STORAGE_LENGTH and what to do in such a situation.
Comment 8 Saam Barati 2016-08-11 19:43:39 PDT
Created attachment 285882 [details]
WIP

Just about done. Just going to write a changelog and do a once over of the code, and write 32-bit DFG support.
Comment 9 WebKit Commit Bot 2016-08-12 11:01:06 PDT
Attachment 285882 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/CommonSlowPaths.cpp:856:  Extra space between Structure* and structure  [whitespace/declaration] [3]
ERROR: Source/JavaScriptCore/bytecode/BytecodeUseDef.h:94:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/JavaScriptCore/dfg/DFGCallArrayAllocatorSlowPathGenerator.h:87:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:6510:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:6514:  Should have a space between // and comment  [whitespace/comments] [4]
ERROR: Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h:764:  The parameter name "indexingType" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:5507:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
Total errors found: 7 in 35 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 Saam Barati 2016-08-12 12:26:59 PDT
Created attachment 285930 [details]
patch
Comment 11 WebKit Commit Bot 2016-08-12 12:29:16 PDT
Attachment 285930 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:5442:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
ERROR: Source/JavaScriptCore/bytecode/BytecodeUseDef.h:94:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/JavaScriptCore/dfg/DFGCallArrayAllocatorSlowPathGenerator.h:87:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h:764:  The parameter name "indexingType" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:5507:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
Total errors found: 5 in 37 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 Saam Barati 2016-08-12 15:13:47 PDT
Created attachment 285962 [details]
patch for landing
Comment 13 WebKit Commit Bot 2016-08-12 15:16:23 PDT
Attachment 285962 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/dfg/DFGCallArrayAllocatorSlowPathGenerator.h:87:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
Total errors found: 1 in 41 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 14 WebKit Commit Bot 2016-08-12 19:16:14 PDT
Comment on attachment 285962 [details]
patch for landing

Clearing flags on attachment: 285962

Committed r204439: <http://trac.webkit.org/changeset/204439>
Comment 15 WebKit Commit Bot 2016-08-12 19:16:19 PDT
All reviewed patches have been landed.  Closing bug.