RESOLVED FIXED 150129
Snippefy op_add for the baseline JIT.
https://bugs.webkit.org/show_bug.cgi?id=150129
Summary Snippefy op_add for the baseline JIT.
Mark Lam
Reported 2015-10-14 10:55:13 PDT
Patch coming.
Attachments
the patch. (27.37 KB, patch)
2015-11-01 23:58 PST, Mark Lam
no flags
32-bit benchmark result 1 (63.62 KB, text/plain)
2015-11-02 00:00 PST, Mark Lam
no flags
32-bit benchmark result 2 (63.25 KB, text/plain)
2015-11-02 00:01 PST, Mark Lam
no flags
64-bit benchmark result 1 (64.22 KB, text/plain)
2015-11-02 00:01 PST, Mark Lam
no flags
64-bit benchmark result 2 (64.14 KB, text/plain)
2015-11-02 00:02 PST, Mark Lam
no flags
Added missing snippet files. (36.14 KB, patch)
2015-11-02 00:09 PST, Mark Lam
ggaren: review-
Patch 2: Fixed bug and incorporated feedback. (37.05 KB, patch)
2015-11-02 11:41 PST, Mark Lam
ggaren: review-
patch 3: svn up'ed (34.84 KB, patch)
2015-11-02 11:57 PST, Mark Lam
ggaren: review+
buildbot: commit-queue-
Archive of layout-test-results from ews101 for mac-mavericks (651.69 KB, application/zip)
2015-11-02 12:41 PST, Build Bot
no flags
Mark Lam
Comment 1 2015-11-01 23:58:45 PST
Created attachment 264559 [details] the patch.
Mark Lam
Comment 2 2015-11-02 00:00:52 PST
Created attachment 264560 [details] 32-bit benchmark result 1
Mark Lam
Comment 3 2015-11-02 00:01:16 PST
Created attachment 264561 [details] 32-bit benchmark result 2
Mark Lam
Comment 4 2015-11-02 00:01:39 PST
Created attachment 264562 [details] 64-bit benchmark result 1
Mark Lam
Comment 5 2015-11-02 00:02:05 PST
Created attachment 264563 [details] 64-bit benchmark result 2
Mark Lam
Comment 6 2015-11-02 00:09:57 PST
Created attachment 264564 [details] Added missing snippet files.
WebKit Commit Bot
Comment 7 2015-11-02 00:12:24 PST
Attachment 264564 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:56: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:57: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:58: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:59: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:60: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:61: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:62: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:63: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:64: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:65: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:66: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] Total errors found: 11 in 10 files If any of these errors are false positives, please file a bug against check-webkit-style.
Saam Barati
Comment 8 2015-11-02 07:26:28 PST
Comment on attachment 264564 [details] Added missing snippet files. View in context: https://bugs.webkit.org/attachment.cgi?id=264564&action=review > Source/JavaScriptCore/jit/JITAddGenerator.cpp:44 > + if (!m_leftType.mightBeNumber() && !m_rightType.mightBeNumber()) Should this be && or ||? It looks like the old code was || > Source/JavaScriptCore/jit/JITAddGenerator.cpp:45 > + m_slowPathJumpList.append(jit.jump()); I think you should return here because any code you emit after this is unreachable
Geoffrey Garen
Comment 9 2015-11-02 10:21:28 PST
Comment on attachment 264564 [details] Added missing snippet files. View in context: https://bugs.webkit.org/attachment.cgi?id=264564&action=review >> Source/JavaScriptCore/jit/JITAddGenerator.cpp:44 >> + if (!m_leftType.mightBeNumber() && !m_rightType.mightBeNumber()) > > Should this be && or ||? > It looks like the old code was || Yeah, this needs to be ||. > Source/JavaScriptCore/jit/JITAddGenerator.h:49 > + // Hence, we can never have BothAreConstInt32. It would be better just to say that we choose not to optimize the both constant case. Saying we can never have it suggests that we rely on it never happening. But we shouldn't rely on an optimization for correctness here.
Mark Lam
Comment 10 2015-11-02 11:41:44 PST
Created attachment 264605 [details] Patch 2: Fixed bug and incorporated feedback. Thanks for the reviews, and for catching the bug. Both Saam and Geoff's feedback have been incorporated. I changed the comment in JITAddGenerator.h as Geoff suggested, and added a comment to the ChangeLog instead to document why I don't implement the optimization for the 2 const operands case.
Geoffrey Garen
Comment 11 2015-11-02 11:43:51 PST
Comment on attachment 264605 [details] Patch 2: Fixed bug and incorporated feedback. EWS is red.
Mark Lam
Comment 12 2015-11-02 11:57:44 PST
Created attachment 264610 [details] patch 3: svn up'ed
WebKit Commit Bot
Comment 13 2015-11-02 11:59:39 PST
Attachment 264610 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:56: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:57: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:58: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:59: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:60: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:61: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:62: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:63: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:64: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:65: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITAddGenerator.h:66: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] Total errors found: 11 in 10 files If any of these errors are false positives, please file a bug against check-webkit-style.
Geoffrey Garen
Comment 14 2015-11-02 12:17:18 PST
Comment on attachment 264610 [details] patch 3: svn up'ed View in context: https://bugs.webkit.org/attachment.cgi?id=264610&action=review r=me > Source/JavaScriptCore/jit/JITAddGenerator.cpp:50 > + // Try to do intConstant + intVar. This is intVar + intConstant. > Source/JavaScriptCore/jit/JITAddGenerator.cpp:51 > + CCallHelpers::Jump tryDoubleAdd = jit.branchIfNotInt32(m_left); Let's call this notInt32 since it does not always try to do a double add. > Source/JavaScriptCore/jit/JITAddGenerator.cpp:63 > + // Try to do double(intConstant) + doubleVar. doubleVar + double(intConstant)
Build Bot
Comment 15 2015-11-02 12:41:40 PST
Comment on attachment 264610 [details] patch 3: svn up'ed Attachment 264610 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/373222 New failing tests: storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures.html
Build Bot
Comment 16 2015-11-02 12:41:43 PST
Created attachment 264615 [details] Archive of layout-test-results from ews101 for mac-mavericks The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-mavericks Platform: Mac OS X 10.9.5
Mark Lam
Comment 17 2015-11-02 13:13:54 PST
Thanks for the review. Feedback is applied. Landed in r191905: <http://trac.webkit.org/r191905>.
Michael Saboff
Comment 18 2015-11-02 19:31:02 PST
Looks like this broke some tests on iOS ARM. These tests started failing with r191905: jsc-layout-tests.yaml/js/script-tests/dfg-int16array.js.layout-no-llint jsc-layout-tests.yaml/js/script-tests/dfg-int32array-overflow-values.js.layout-no-llint jsc-layout-tests.yaml/js/script-tests/dfg-int32array.js.layout-no-llint jsc-layout-tests.yaml/js/script-tests/dfg-int8array.js.layout-no-llint jsc-layout-tests.yaml/js/script-tests/dfg-uint16array.js.layout-no-llint jsc-layout-tests.yaml/js/script-tests/dfg-uint32array-overflow-values.js.layout-no-llint jsc-layout-tests.yaml/js/script-tests/dfg-uint32array.js.layout-no-llint jsc-layout-tests.yaml/js/script-tests/dfg-uint8array.js.layout-no-llint jsc-layout-tests.yaml/js/script-tests/dfg-uint8clampedarray.js.layout-no-llint
Mark Lam
Comment 19 2015-11-03 15:54:02 PST
(In reply to comment #18) > Looks like this broke some tests on iOS ARM. These tests started failing > with r191905: > ... All of these were due to the op_add snippet increasing generated code size. Turns out that there op_add snippets have some inefficiencies that I've now fixed in http://trac.webkit.org/changeset/191978. With that fix, these tests now pass.
Note You need to log in before you can comment on or make changes to this bug.