Bug 125252 - Fold typedArray.length if typedArray is constant
Summary: Fold typedArray.length if typedArray is constant
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on: 125205
Blocks: 125253 125395
  Show dependency treegraph
 
Reported: 2013-12-04 13:59 PST by Filip Pizlo
Modified: 2013-12-08 10:58 PST (History)
10 users (show)

See Also:


Attachments
it starts (20.39 KB, patch)
2013-12-06 21:00 PST, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch (42.06 KB, patch)
2013-12-07 12:49 PST, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch (42.61 KB, patch)
2013-12-07 13:08 PST, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch (42.60 KB, patch)
2013-12-07 13:09 PST, Filip Pizlo
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2013-12-04 13:59:44 PST
This requires introducing a NodeType for watchpointing typed array neutering.
Comment 1 Filip Pizlo 2013-12-06 21:00:38 PST
Created attachment 218647 [details]
it starts
Comment 2 Filip Pizlo 2013-12-07 12:49:45 PST
Created attachment 218661 [details]
the patch
Comment 3 WebKit Commit Bot 2013-12-07 12:51:35 PST
Attachment 218661 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/CMakeLists.txt', u'Source/JavaScriptCore/ChangeLog', u'Source/JavaScriptCore/GNUmakefile.list.am', u'Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj', u'Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj', u'Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h', u'Source/JavaScriptCore/dfg/DFGClobberize.h', u'Source/JavaScriptCore/dfg/DFGFixupPhase.cpp', u'Source/JavaScriptCore/dfg/DFGGraph.cpp', u'Source/JavaScriptCore/dfg/DFGGraph.h', u'Source/JavaScriptCore/dfg/DFGNode.h', u'Source/JavaScriptCore/dfg/DFGNodeType.h', u'Source/JavaScriptCore/dfg/DFGPlan.cpp', u'Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp', u'Source/JavaScriptCore/dfg/DFGSafeToExecute.h', u'Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp', u'Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp', u'Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp', u'Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp', u'Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.h', u'Source/JavaScriptCore/dfg/DFGWatchpointCollectionPhase.cpp', u'Source/JavaScriptCore/ftl/FTLCapabilities.cpp', u'Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp', u'Source/JavaScriptCore/jsc.cpp', u'Source/JavaScriptCore/runtime/ArrayBufferView.h', u'Source/JavaScriptCore/tests/stress/fold-typed-array-properties.js', u'Tools/ChangeLog', u'Tools/Scripts/run-javascriptcore-tests', '--commit-queue']" exit_code: 1
ERROR: Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp:43:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
Total errors found: 1 in 28 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Filip Pizlo 2013-12-07 13:08:08 PST
Created attachment 218662 [details]
the patch
Comment 5 Filip Pizlo 2013-12-07 13:08:55 PST
(In reply to comment #3)
> Attachment 218661 [details] did not pass style-queue:
> 
> Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/CMakeLists.txt', u'Source/JavaScriptCore/ChangeLog', u'Source/JavaScriptCore/GNUmakefile.list.am', u'Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj', u'Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj', u'Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h', u'Source/JavaScriptCore/dfg/DFGClobberize.h', u'Source/JavaScriptCore/dfg/DFGFixupPhase.cpp', u'Source/JavaScriptCore/dfg/DFGGraph.cpp', u'Source/JavaScriptCore/dfg/DFGGraph.h', u'Source/JavaScriptCore/dfg/DFGNode.h', u'Source/JavaScriptCore/dfg/DFGNodeType.h', u'Source/JavaScriptCore/dfg/DFGPlan.cpp', u'Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp', u'Source/JavaScriptCore/dfg/DFGSafeToExecute.h', u'Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp', u'Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp', u'Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp', u'Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp', u'Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.h', u'Source/JavaScriptCore/dfg/DFGWatchpointCollectionPhase.cpp', u'Source/JavaScriptCore/ftl/FTLCapabilities.cpp', u'Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp', u'Source/JavaScriptCore/jsc.cpp', u'Source/JavaScriptCore/runtime/ArrayBufferView.h', u'Source/JavaScriptCore/tests/stress/fold-typed-array-properties.js', u'Tools/ChangeLog', u'Tools/Scripts/run-javascriptcore-tests', '--commit-queue']" exit_code: 1
> ERROR: Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp:43:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]

Umm no.

> Total errors found: 1 in 28 files
> 
> 
> If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Filip Pizlo 2013-12-07 13:09:51 PST
Created attachment 218663 [details]
the patch
Comment 7 WebKit Commit Bot 2013-12-07 13:13:03 PST
Attachment 218663 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/CMakeLists.txt', u'Source/JavaScriptCore/ChangeLog', u'Source/JavaScriptCore/GNUmakefile.list.am', u'Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj', u'Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj', u'Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h', u'Source/JavaScriptCore/dfg/DFGClobberize.h', u'Source/JavaScriptCore/dfg/DFGFixupPhase.cpp', u'Source/JavaScriptCore/dfg/DFGGraph.cpp', u'Source/JavaScriptCore/dfg/DFGGraph.h', u'Source/JavaScriptCore/dfg/DFGNode.h', u'Source/JavaScriptCore/dfg/DFGNodeType.h', u'Source/JavaScriptCore/dfg/DFGPlan.cpp', u'Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp', u'Source/JavaScriptCore/dfg/DFGSafeToExecute.h', u'Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp', u'Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp', u'Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp', u'Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp', u'Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.h', u'Source/JavaScriptCore/dfg/DFGWatchpointCollectionPhase.cpp', u'Source/JavaScriptCore/ftl/FTLCapabilities.cpp', u'Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp', u'Source/JavaScriptCore/jsc.cpp', u'Source/JavaScriptCore/runtime/ArrayBufferView.h', u'Source/JavaScriptCore/tests/stress/fold-typed-array-properties.js', u'Tools/ChangeLog', u'Tools/Scripts/run-javascriptcore-tests', '--commit-queue']" exit_code: 1
ERROR: Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp:43:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
Total errors found: 1 in 28 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Sam Weinig 2013-12-07 17:28:20 PST
Comment on attachment 218663 [details]
the patch

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

> Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp:126
> +    SamplingRegion samplingRegion("DFG Strength Reduction Phase");
> +    return runPhase<StrengthReductionPhase>(graph);

Given how often these two lines of code go together, perhaps we should make runPhase<> make the SamplingRegion at some point.
Comment 9 Filip Pizlo 2013-12-08 10:55:56 PST
(In reply to comment #8)
> (From update of attachment 218663 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=218663&action=review
> 
> > Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp:126
> > +    SamplingRegion samplingRegion("DFG Strength Reduction Phase");
> > +    return runPhase<StrengthReductionPhase>(graph);
> 
> Given how often these two lines of code go together, perhaps we should make runPhase<> make the SamplingRegion at some point.

Yeah, I know! :-)  https://bugs.webkit.org/show_bug.cgi?id=125419
Comment 10 Filip Pizlo 2013-12-08 10:58:30 PST
Landed in http://trac.webkit.org/changeset/160292