RESOLVED FIXED Bug 190923
Re-introduce op_bitnot
https://bugs.webkit.org/show_bug.cgi?id=190923
Summary Re-introduce op_bitnot
Caio Lima
Reported 2018-10-25 15:48:27 PDT
With the introduction of BigInt, emitting BitNotNode as x ^ -1 is not safe anymore. This way, we need to re-introduce op_bitnot.
Attachments
WIP - Patch (29.67 KB, patch)
2018-11-14 10:36 PST, Caio Lima
no flags
Archive of layout-test-results from ews201 for win-future (12.75 MB, application/zip)
2018-11-14 12:35 PST, EWS Watchlist
no flags
WIP - Patch (30.39 KB, patch)
2018-11-14 18:00 PST, Caio Lima
no flags
Archive of layout-test-results from ews203 for win-future (12.75 MB, application/zip)
2018-11-14 20:53 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews202 for win-future (12.85 MB, application/zip)
2018-11-14 22:43 PST, EWS Watchlist
no flags
EWS win test (30.29 KB, patch)
2018-11-15 07:54 PST, Caio Lima
no flags
Archive of layout-test-results from ews205 for win-future (12.78 MB, application/zip)
2018-11-15 10:02 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews204 for win-future (12.82 MB, application/zip)
2018-11-15 11:45 PST, EWS Watchlist
no flags
Patch (30.33 KB, patch)
2018-11-15 14:31 PST, Caio Lima
no flags
Patch to test ews (30.37 KB, patch)
2018-11-15 14:47 PST, Caio Lima
no flags
Patch (30.30 KB, patch)
2018-11-16 05:09 PST, Caio Lima
no flags
Patch (30.19 KB, patch)
2018-11-16 15:28 PST, Caio Lima
no flags
Archive of layout-test-results from ews201 for win-future (12.81 MB, application/zip)
2018-11-16 19:30 PST, EWS Watchlist
no flags
Patch (30.24 KB, patch)
2018-11-16 20:13 PST, Caio Lima
no flags
Archive of layout-test-results from ews122 for ios-simulator-wk2 (2.70 MB, application/zip)
2018-11-16 23:01 PST, EWS Watchlist
no flags
Patch (30.91 KB, patch)
2018-11-17 13:13 PST, Caio Lima
no flags
Patch for news (30.91 KB, patch)
2018-11-17 14:03 PST, Caio Lima
no flags
Archive of layout-test-results from ews202 for win-future (12.87 MB, application/zip)
2018-11-17 16:00 PST, EWS Watchlist
no flags
Patch to test ews (30.91 KB, patch)
2018-11-17 17:59 PST, Caio Lima
no flags
WIP - Patch (33.37 KB, patch)
2018-11-18 15:55 PST, Caio Lima
no flags
WIP - Patch (33.03 KB, patch)
2018-11-19 06:35 PST, Caio Lima
no flags
WIP - Patch (34.46 KB, patch)
2018-11-19 07:29 PST, Caio Lima
no flags
Patch (34.38 KB, patch)
2018-11-21 11:08 PST, Caio Lima
no flags
Patch (33.88 KB, patch)
2018-11-26 04:21 PST, Caio Lima
no flags
Benchmarks (96.66 KB, text/plain)
2018-11-26 16:06 PST, Caio Lima
no flags
Patch (35.20 KB, patch)
2018-11-26 17:41 PST, Caio Lima
no flags
Caio Lima
Comment 1 2018-11-14 10:36:04 PST
Created attachment 354831 [details] WIP - Patch
EWS Watchlist
Comment 2 2018-11-14 12:35:26 PST
Comment on attachment 354831 [details] WIP - Patch Attachment 354831 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/9992336 New failing tests: js/kde/md5-2.html
EWS Watchlist
Comment 3 2018-11-14 12:35:39 PST
Created attachment 354843 [details] Archive of layout-test-results from ews201 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews201 Port: win-future Platform: CYGWIN_NT-6.1-2.10.0-0.325-5-3-x86_64-64bit
Caio Lima
Comment 4 2018-11-14 18:00:12 PST
Created attachment 354881 [details] WIP - Patch
EWS Watchlist
Comment 5 2018-11-14 20:53:02 PST
Comment on attachment 354881 [details] WIP - Patch Attachment 354881 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/9998041 New failing tests: js/kde/md5-2.html
EWS Watchlist
Comment 6 2018-11-14 20:53:13 PST
Created attachment 354887 [details] Archive of layout-test-results from ews203 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews203 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Yusuke Suzuki
Comment 7 2018-11-14 21:35:38 PST
Comment on attachment 354881 [details] WIP - Patch View in context: https://bugs.webkit.org/attachment.cgi?id=354881&action=review I think this direction is good. Some nits before the review. > Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h:1053 > + void not32(RegisterID srcDest, RegisterID) The second argument is not necessary. > Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:3539 > + m_jit.not32(resultGPR, resultGPR); Use `not32(resultGPR);`.
EWS Watchlist
Comment 8 2018-11-14 22:43:12 PST
Comment on attachment 354881 [details] WIP - Patch Attachment 354881 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/9998659 New failing tests: js/kde/md5-2.html
EWS Watchlist
Comment 9 2018-11-14 22:43:24 PST
Created attachment 354891 [details] Archive of layout-test-results from ews202 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews202 Port: win-future Platform: CYGWIN_NT-6.1-2.10.0-0.325-5-3-x86_64-64bit
Caio Lima
Comment 10 2018-11-15 07:54:27 PST
Created attachment 354933 [details] EWS win test
EWS Watchlist
Comment 11 2018-11-15 10:02:14 PST
Comment on attachment 354933 [details] EWS win test Attachment 354933 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/10004727 New failing tests: js/kde/md5-2.html
EWS Watchlist
Comment 12 2018-11-15 10:02:25 PST
Created attachment 354952 [details] Archive of layout-test-results from ews205 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews205 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
EWS Watchlist
Comment 13 2018-11-15 11:45:48 PST
Comment on attachment 354933 [details] EWS win test Attachment 354933 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/10005721 New failing tests: js/kde/md5-2.html
EWS Watchlist
Comment 14 2018-11-15 11:45:59 PST
Created attachment 354964 [details] Archive of layout-test-results from ews204 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews204 Port: win-future Platform: CYGWIN_NT-6.1-2.10.0-0.325-5-3-x86_64-64bit
Caio Lima
Comment 15 2018-11-15 14:31:02 PST
Caio Lima
Comment 16 2018-11-15 14:47:59 PST
Created attachment 354991 [details] Patch to test ews
Caio Lima
Comment 17 2018-11-16 05:09:03 PST
Caio Lima
Comment 18 2018-11-16 15:28:01 PST
EWS Watchlist
Comment 19 2018-11-16 19:30:39 PST
Comment on attachment 355141 [details] Patch Attachment 355141 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/10027970 New failing tests: sputnik/Conformance/11_Expressions/11.4_Unary_Operators/11.4.8_Bitwise_NOT_Operator/S11.4.8_A2.1_T1.html js/kde/md5-2.html
EWS Watchlist
Comment 20 2018-11-16 19:30:50 PST
Created attachment 355171 [details] Archive of layout-test-results from ews201 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews201 Port: win-future Platform: CYGWIN_NT-6.1-2.10.0-0.325-5-3-x86_64-64bit
Caio Lima
Comment 21 2018-11-16 20:13:48 PST
EWS Watchlist
Comment 22 2018-11-16 23:01:24 PST
Comment on attachment 355175 [details] Patch Attachment 355175 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/10029681 New failing tests: imported/w3c/web-platform-tests/webrtc/simplecall-no-ssrcs.https.html
EWS Watchlist
Comment 23 2018-11-16 23:01:26 PST
Created attachment 355184 [details] Archive of layout-test-results from ews122 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews122 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Caio Lima
Comment 24 2018-11-17 13:13:13 PST
Caio Lima
Comment 25 2018-11-17 14:03:48 PST
Created attachment 355203 [details] Patch for news
EWS Watchlist
Comment 26 2018-11-17 16:00:27 PST
Comment on attachment 355203 [details] Patch for news Attachment 355203 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/10047326 New failing tests: sputnik/Conformance/11_Expressions/11.4_Unary_Operators/11.4.8_Bitwise_NOT_Operator/S11.4.8_A2.1_T1.html js/kde/md5-2.html
EWS Watchlist
Comment 27 2018-11-17 16:00:38 PST
Created attachment 355212 [details] Archive of layout-test-results from ews202 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews202 Port: win-future Platform: CYGWIN_NT-6.1-2.10.0-0.325-5-3-x86_64-64bit
Caio Lima
Comment 28 2018-11-17 17:59:56 PST
Created attachment 355216 [details] Patch to test ews
Caio Lima
Comment 29 2018-11-18 15:55:10 PST
Created attachment 355241 [details] WIP - Patch
Caio Lima
Comment 30 2018-11-18 15:55:58 PST
Comment on attachment 355241 [details] WIP - Patch Rebasing with master
Caio Lima
Comment 31 2018-11-19 06:35:49 PST
Created attachment 355277 [details] WIP - Patch
Caio Lima
Comment 32 2018-11-19 07:29:29 PST
Created attachment 355280 [details] WIP - Patch
Caio Lima
Comment 33 2018-11-21 11:08:34 PST
Caio Lima
Comment 34 2018-11-26 04:21:34 PST
Yusuke Suzuki
Comment 35 2018-11-26 06:16:27 PST
Comment on attachment 355636 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=355636&action=review r=me with nits. Please ensure it does not cause any performance regression before landing. > Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:388 > + setConstant(node, JSValue(~a)); Insert `break;` here. > Source/JavaScriptCore/dfg/DFGNodeType.h:114 > + macro(ArithBitNot, NodeResultInt32) \ Add `NodeMustGenerate` since the Untyped case can cause anything. And clear `NodeMustGenerate` when the edge is fixed by `Int32` in the fixup phase. Later, if you add ValueBitNot, then you can make this non-MustGenerate, and handle Untyped cases in ValueBitNot.
Caio Lima
Comment 36 2018-11-26 16:06:43 PST
Created attachment 355689 [details] Benchmarks The Patch is perf neutral on x86_64 macOS.
Caio Lima
Comment 37 2018-11-26 17:41:43 PST
Caio Lima
Comment 38 2018-11-26 17:43:09 PST
Thank you very much for the review! (In reply to Yusuke Suzuki from comment #35) > Comment on attachment 355636 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=355636&action=review > > r=me with nits. Please ensure it does not cause any performance regression > before landing. > > > Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:388 > > + setConstant(node, JSValue(~a)); > > Insert `break;` here. Done! > > Source/JavaScriptCore/dfg/DFGNodeType.h:114 > > + macro(ArithBitNot, NodeResultInt32) \ > > Add `NodeMustGenerate` since the Untyped case can cause anything. > And clear `NodeMustGenerate` when the edge is fixed by `Int32` in the fixup > phase. > Later, if you add ValueBitNot, then you can make this non-MustGenerate, and > handle Untyped cases in ValueBitNot. Done. I also added a test case. thx for catching this.
WebKit Commit Bot
Comment 39 2018-11-26 18:26:06 PST
The commit-queue encountered the following flaky tests while processing attachment 355698 [details]: webgl/2.0.0/conformance2/rendering/blitframebuffer-filter-outofbounds.html bug 191991 (author: justin_fan@apple.com) webgl/2.0.0/conformance/more/functions/readPixels.html bug 191992 (author: justin_fan@apple.com) The commit-queue is continuing to process your patch.
WebKit Commit Bot
Comment 40 2018-11-26 18:27:05 PST
Comment on attachment 355698 [details] Patch Clearing flags on attachment: 355698 Committed r238543: <https://trac.webkit.org/changeset/238543>
WebKit Commit Bot
Comment 41 2018-11-26 18:27:08 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 42 2018-11-26 18:28:55 PST
Guillaume Emont
Comment 43 2018-11-29 10:10:45 PST
r238543 introduced a regression on Armv7. See Bug 192152.
Saam Barati
Comment 44 2018-11-29 18:00:29 PST
Comment on attachment 355698 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=355698&action=review > Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:390 > + JSValue operand = forNode(node->child1()).value(); > + if (operand && operand.isInt32()) { > + int32_t a = operand.asInt32(); > + setConstant(node, JSValue(~a)); > + break; > + } This constant folding can happen irrespective of being UntypedUse or Int32Use
Saam Barati
Comment 45 2018-11-29 18:07:59 PST
Comment on attachment 355698 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=355698&action=review > Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:2855 > + LValue result = vmCall(pointerType(), m_out.operation(operationValueBitNot), m_callFrame, operand); nit: Should be Int64 not pointerType()
Caio Lima
Comment 46 2018-11-30 12:43:55 PST
(In reply to Saam Barati from comment #45) > Comment on attachment 355698 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=355698&action=review > > > Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:2855 > > + LValue result = vmCall(pointerType(), m_out.operation(operationValueBitNot), m_callFrame, operand); > > nit: Should be Int64 not pointerType() I will handle both comments into https://bugs.webkit.org/show_bug.cgi?id=182216
Caio Lima
Comment 47 2018-11-30 12:44:43 PST
(In reply to Guillaume Emont from comment #43) > r238543 introduced a regression on Armv7. See Bug 192152. This probably will be fixed by https://bugs.webkit.org/show_bug.cgi?id=192203
Note You need to log in before you can comment on or make changes to this bug.