Bug 162764 - B3::moveConstants should be able to edit code to minimize the number of constants
Summary: B3::moveConstants should be able to edit code to minimize the number of const...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on:
Blocks: 162796
  Show dependency treegraph
 
Reported: 2016-09-29 18:48 PDT by Filip Pizlo
Modified: 2016-09-30 15:32 PDT (History)
9 users (show)

See Also:


Attachments
it works on simple things (6.69 KB, patch)
2016-09-29 18:58 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch (14.38 KB, patch)
2016-09-30 11:29 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch (15.18 KB, patch)
2016-09-30 11:39 PDT, Filip Pizlo
ggaren: review-
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews117 for mac-yosemite (2.60 MB, application/zip)
2016-09-30 12:48 PDT, Build Bot
no flags Details
the patch (15.19 KB, patch)
2016-09-30 13:14 PDT, Filip Pizlo
saam: 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 2016-09-29 18:48:21 PDT
Patch forthcoming.
Comment 1 Filip Pizlo 2016-09-29 18:58:49 PDT
Created attachment 290283 [details]
it works on simple things
Comment 2 Filip Pizlo 2016-09-30 11:29:58 PDT
Created attachment 290355 [details]
the patch
Comment 3 Filip Pizlo 2016-09-30 11:38:28 PDT
Comment on attachment 290355 [details]
the patch

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

> Source/JavaScriptCore/b3/air/AirFixObviousSpills.cpp:194
> -
> +        

I'll revert.
Comment 4 Filip Pizlo 2016-09-30 11:39:52 PDT
Created attachment 290358 [details]
the patch
Comment 5 Build Bot 2016-09-30 12:48:06 PDT
Comment on attachment 290358 [details]
the patch

Attachment 290358 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/2176850

New failing tests:
js/slow-stress/call-spread.html
imported/w3c/canvas/2d.text.draw.fill.maxWidth.negative.html
imported/w3c/canvas/2d.gradient.interpolate.zerosize.fillText.html
fast/forms/input-maxlength.html
fast/workers/worker-cloneport.html
js/slow-stress/nested-function-parsing-random.html
js/slow-stress/new-spread.html
js/dom/stack-trace.html
imported/w3c/canvas/2d.gradient.interpolate.zerosize.strokeText.html
inspector/debugger/call-frame-this-strict.html
js/dfg-inline-function-dot-caller.html
inspector/debugger/call-frame-this-nonstrict.html
js/slow-stress/array-prototype-filter.html
inspector/debugger/breakpoint-columns.html
fast/forms/input-implicit-length-limit.html
webgl/1.0.2/conformance/uniforms/out-of-bounds-uniform-array-access.html
Comment 6 Build Bot 2016-09-30 12:48:11 PDT
Created attachment 290366 [details]
Archive of layout-test-results from ews117 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 7 Geoffrey Garen 2016-09-30 12:53:18 PDT
Comment on attachment 290358 [details]
the patch

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

Looks good to me but the EWS result indicates a bug.

> Source/JavaScriptCore/b3/B3MoveConstants.cpp:146
> +                                if (criteria(value)) {

FWIW, I like to call arguments like this "predicate".

One downside to criteria is that it presupposes a plural.

One upside to predicate is that it matches the STL.
Comment 8 Filip Pizlo 2016-09-30 13:14:19 PDT
(In reply to comment #7)
> Comment on attachment 290358 [details]
> the patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=290358&action=review
> 
> Looks good to me but the EWS result indicates a bug.
> 
> > Source/JavaScriptCore/b3/B3MoveConstants.cpp:146
> > +                                if (criteria(value)) {
> 
> FWIW, I like to call arguments like this "predicate".
> 
> One downside to criteria is that it presupposes a plural.
> 
> One upside to predicate is that it matches the STL.

I changed it to predicate.
Comment 9 Filip Pizlo 2016-09-30 13:14:49 PDT
Created attachment 290373 [details]
the patch
Comment 10 Saam Barati 2016-09-30 14:34:34 PDT
Comment on attachment 290373 [details]
the patch

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

> Source/JavaScriptCore/ChangeLog:20
> +        This change makes moveConstants() pick the most dominant constant that works for an value. In

s/an/a

> Source/JavaScriptCore/b3/B3MoveConstants.cpp:193
> +                            //     @q + c + @p - @q

nifty
Comment 11 Filip Pizlo 2016-09-30 14:40:11 PDT
I'll wait for the bots, since they found things last time.
Comment 12 Filip Pizlo 2016-09-30 15:32:18 PDT
landed in https://trac.webkit.org/changeset/206682