RESOLVED FIXED 151680
Snippefy bitwise operators for the baseline JIT.
https://bugs.webkit.org/show_bug.cgi?id=151680
Summary Snippefy bitwise operators for the baseline JIT.
Mark Lam
Reported 2015-11-30 15:55:50 PST
Working on it.
Attachments
proposed patch. (51.00 KB, patch)
2015-12-03 14:28 PST, Mark Lam
ggaren: review+
patch 2: fixed 32-bit regression in baseline JIT (51.56 KB, patch)
2015-12-04 13:39 PST, Mark Lam
ggaren: review+
x86_64 benchmark result. (65.07 KB, text/plain)
2015-12-04 13:40 PST, Mark Lam
no flags
x86 benchmark result. (64.45 KB, text/plain)
2015-12-04 13:41 PST, Mark Lam
no flags
x86_64 benchmark result without DFG. (64.29 KB, text/plain)
2015-12-04 13:41 PST, Mark Lam
no flags
x86 benchmark result without DFG. (64.48 KB, text/plain)
2015-12-04 13:42 PST, Mark Lam
no flags
Radar WebKit Bug Importer
Comment 1 2015-11-30 15:56:47 PST
Mark Lam
Comment 2 2015-12-03 14:28:27 PST
Created attachment 266558 [details] proposed patch. Tests and benchmarks are still being run.
WebKit Commit Bot
Comment 3 2015-12-03 14:30:14 PST
Attachment 266558 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/jit/JITBitOrGenerator.h:39: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITBitXorGenerator.h:39: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITBitwiseBinaryOpGenerator.h:40: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITBitwiseBinaryOpGenerator.h:41: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITBitwiseBinaryOpGenerator.h:42: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITBitwiseBinaryOpGenerator.h:43: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITBitwiseBinaryOpGenerator.h:44: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITBitwiseBinaryOpGenerator.h:45: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITBitAndGenerator.h:39: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] Total errors found: 9 in 19 files If any of these errors are false positives, please file a bug against check-webkit-style.
Geoffrey Garen
Comment 4 2015-12-03 14:50:04 PST
Comment on attachment 266558 [details] proposed patch. r=me
Mark Lam
Comment 5 2015-12-03 16:31:15 PST
This patch has passed the JSC tests on x86 and x86_64. It has passed the layout tests on x86_64. Benchmarks with the DFG and FTL enable shows perf to be neutral for both x86 and x86_64. Still waiting for benchmark results with no DFG.
Mark Lam
Comment 6 2015-12-04 13:39:34 PST
Created attachment 266651 [details] patch 2: fixed 32-bit regression in baseline JIT The only difference in this patch is the addition of this conditional in emitBitwiseBinaryOpFastPath(): #if USE(JSVALUE32_64) emitStoreInt32(result, resultRegs.payloadGPR(), op1 == result || op2 == result); #else emitPutVirtualRegister(result, resultRegs); #endif On x86, the emitStoreInt32() results in setting the result IntTag value using an immediate instead of getting it from another register which is already known to have the IntTag value. The 32-bit bitwise code was previous setting the result this way. This change basically restores the setting of the result to the way it was done before. This difference accounted for some noticeable perf difference on x86 when running without the DFG.
Mark Lam
Comment 7 2015-12-04 13:40:35 PST
Created attachment 266652 [details] x86_64 benchmark result.
WebKit Commit Bot
Comment 8 2015-12-04 13:40:52 PST
Attachment 266651 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/jit/JITBitOrGenerator.h:39: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITBitXorGenerator.h:39: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITBitwiseBinaryOpGenerator.h:40: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITBitwiseBinaryOpGenerator.h:41: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITBitwiseBinaryOpGenerator.h:42: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITBitwiseBinaryOpGenerator.h:43: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITBitwiseBinaryOpGenerator.h:44: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITBitwiseBinaryOpGenerator.h:45: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] ERROR: Source/JavaScriptCore/jit/JITBitAndGenerator.h:39: Wrong number of spaces before statement. (expected: 12) [whitespace/indent] [4] Total errors found: 9 in 19 files If any of these errors are false positives, please file a bug against check-webkit-style.
Mark Lam
Comment 9 2015-12-04 13:41:01 PST
Created attachment 266653 [details] x86 benchmark result.
Mark Lam
Comment 10 2015-12-04 13:41:33 PST
Created attachment 266654 [details] x86_64 benchmark result without DFG.
Mark Lam
Comment 11 2015-12-04 13:42:11 PST
Created attachment 266655 [details] x86 benchmark result without DFG.
Mark Lam
Comment 12 2015-12-04 13:49:32 PST
Perf is neutral with the DFG on. Perf is also mostly neutral with just the baseline JIT. On x86_64 baseline only, AsmBench tests shows some progression possibly because the snippet forms of bitor and bitxor has added support for constant operands (inherited from the 32-bit version). On x86 baseline only, JSRegress' is-function-fold does appear to have a regression. However, inspection of the test code shows that it doesn't even use bitand, bitor, or bitxor operators. A dump of the disassemble JIT code also shows no use of the operators. I'll count this one as being due to cache line effects, and ignore it.
Geoffrey Garen
Comment 13 2015-12-04 14:12:49 PST
Comment on attachment 266651 [details] patch 2: fixed 32-bit regression in baseline JIT r=me
Mark Lam
Comment 14 2015-12-04 14:29:16 PST
Thanks for the review. Landed in r193471: <http://trac.webkit.org/r193471>.
Note You need to log in before you can comment on or make changes to this bug.