Bug 151747 - Polymorphic operand types for DFG and FTL div.
Summary: Polymorphic operand types for DFG and FTL div.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
: 151749 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-12-02 09:05 PST by Mark Lam
Modified: 2015-12-08 13:45 PST (History)
10 users (show)

See Also:


Attachments
x86_64 benchmark results with FTL. (63.59 KB, text/plain)
2015-12-07 23:57 PST, Mark Lam
no flags Details
x86_64 benchmark results with DFG only. (63.87 KB, text/plain)
2015-12-07 23:58 PST, Mark Lam
no flags Details
x86 benchmark results with DFG. (63.81 KB, text/plain)
2015-12-07 23:59 PST, Mark Lam
no flags Details
proposed patch. (27.88 KB, patch)
2015-12-08 00:20 PST, Mark Lam
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews102 for mac-yosemite (799.98 KB, application/zip)
2015-12-08 01:07 PST, Build Bot
no flags Details
Archive of layout-test-results from ews105 for mac-yosemite-wk2 (975.78 KB, application/zip)
2015-12-08 01:10 PST, Build Bot
no flags Details
Archive of layout-test-results from ews114 for mac-yosemite (934.42 KB, application/zip)
2015-12-08 01:30 PST, Build Bot
no flags Details
proposed patch 2: fixed EWS failure. (28.68 KB, patch)
2015-12-08 11:31 PST, Mark Lam
no flags Details | Formatted Diff | Diff
patch 3: fixed valid style issues. (28.68 KB, patch)
2015-12-08 11:38 PST, Mark Lam
no flags Details | Formatted Diff | Diff
patch 4: Changed comment about 2 operands being const. (28.23 KB, patch)
2015-12-08 11:48 PST, Mark Lam
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2015-12-02 09:05:02 PST
Patch coming.
Comment 1 Radar WebKit Bug Importer 2015-12-02 09:08:23 PST
<rdar://problem/23725121>
Comment 2 Mark Lam 2015-12-07 23:02:33 PST
*** Bug 151749 has been marked as a duplicate of this bug. ***
Comment 3 Mark Lam 2015-12-07 23:57:29 PST
Created attachment 266846 [details]
x86_64 benchmark results with FTL.
Comment 4 Mark Lam 2015-12-07 23:58:38 PST
Created attachment 266847 [details]
x86_64 benchmark results with DFG only.
Comment 5 Mark Lam 2015-12-07 23:59:10 PST
Created attachment 266848 [details]
x86 benchmark results with DFG.
Comment 6 Mark Lam 2015-12-08 00:20:21 PST
Created attachment 266851 [details]
proposed patch.
Comment 7 WebKit Commit Bot 2015-12-08 00:22:39 PST
Attachment 266851 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/ftl/FTLInlineCacheDescriptorInlines.h:40:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/ftl/FTLInlineCacheDescriptorInlines.h:40:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
Total errors found: 2 in 20 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Build Bot 2015-12-08 01:07:25 PST
Comment on attachment 266851 [details]
proposed patch.

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

New failing tests:
svg/in-html/sizing/svg-inline.html
Comment 9 Build Bot 2015-12-08 01:07:28 PST
Created attachment 266856 [details]
Archive of layout-test-results from ews102 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 10 Build Bot 2015-12-08 01:10:39 PST
Comment on attachment 266851 [details]
proposed patch.

Attachment 266851 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/531797

New failing tests:
svg/in-html/sizing/svg-inline.html
Comment 11 Build Bot 2015-12-08 01:10:41 PST
Created attachment 266858 [details]
Archive of layout-test-results from ews105 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 12 Build Bot 2015-12-08 01:30:47 PST
Comment on attachment 266851 [details]
proposed patch.

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

New failing tests:
svg/in-html/sizing/svg-inline.html
Comment 13 Build Bot 2015-12-08 01:30:49 PST
Created attachment 266860 [details]
Archive of layout-test-results from ews114 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 14 Mark Lam 2015-12-08 09:18:37 PST
Comment on attachment 266851 [details]
proposed patch.

Taking off review while I investigate the EWS failure.
Comment 15 Mark Lam 2015-12-08 11:31:37 PST
Created attachment 266918 [details]
proposed patch 2: fixed EWS failure.

The EWS crashed test is due https://bugs.webkit.org/show_bug.cgi?id=151997.  Applied a workaround in this patch.
Comment 16 WebKit Commit Bot 2015-12-08 11:34:17 PST
Attachment 266918 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:3754:  Should have only a single space after a punctuation in a comment.  [whitespace/comments] [5]
ERROR: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp:1985:  Should have only a single space after a punctuation in a comment.  [whitespace/comments] [5]
ERROR: Source/JavaScriptCore/ftl/FTLInlineCacheDescriptorInlines.h:40:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/ftl/FTLInlineCacheDescriptorInlines.h:40:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
Total errors found: 4 in 20 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 17 Geoffrey Garen 2015-12-08 11:34:41 PST
Comment on attachment 266918 [details]
proposed patch 2: fixed EWS failure.

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

> Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp:1972
> +            if (leftOperand.isConst()) {
> +                // FIXME: https://bugs.webkit.org/show_bug.cgi?id=151997
> +                // The DFG should have folded a division of a const by a const into a const result,
> +                // but doesn't.  For now, we work around it by treating the rightChild as not const.
> +                // We only saw this issue manifest with the DFG backend, but this check is added here
> +                // as a conservative defense until the issue is in the DFG front end.
> +            } else if (rightChild->isInt32Constant())
> +                rightOperand.setConstInt32(rightChild->asInt32());
> +#if USE(JSVALUE64)
> +            else if (rightChild->isDoubleConstant())
> +                rightOperand.setConstDouble(rightChild->asNumber());

Do all of our snippets make this assumption that they will never see two constants?

I don't think this is a good assumption to make. Thought the DFG often optimizes constants, it does not promise to.
Comment 18 Mark Lam 2015-12-08 11:38:18 PST
Created attachment 266920 [details]
patch 3: fixed valid style issues.
Comment 19 WebKit Commit Bot 2015-12-08 11:39:15 PST
Attachment 266920 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/ftl/FTLInlineCacheDescriptorInlines.h:40:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/ftl/FTLInlineCacheDescriptorInlines.h:40:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
Total errors found: 2 in 20 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 20 Mark Lam 2015-12-08 11:48:16 PST
Created attachment 266923 [details]
patch 4: Changed comment about 2 operands being const.
Comment 21 WebKit Commit Bot 2015-12-08 11:50:32 PST
Attachment 266923 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/ftl/FTLInlineCacheDescriptorInlines.h:40:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/ftl/FTLInlineCacheDescriptorInlines.h:40:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
Total errors found: 2 in 20 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 22 Geoffrey Garen 2015-12-08 13:39:30 PST
Comment on attachment 266923 [details]
patch 4: Changed comment about 2 operands being const.

r=me
Comment 23 Mark Lam 2015-12-08 13:45:48 PST
Thanks for the review.  Landed in r193781: <http://trac.webkit.org/r193781>.