RESOLVED FIXED 191548
Enable JIT on ARM/Linux
https://bugs.webkit.org/show_bug.cgi?id=191548
Summary Enable JIT on ARM/Linux
Dominik Inführ
Reported 2018-11-12 09:29:38 PST
Enable JIT on ARM/Linux
Attachments
Patch (139.86 KB, patch)
2018-11-12 09:32 PST, Dominik Inführ
no flags
Patch (134.99 KB, patch)
2018-11-20 01:06 PST, Dominik Inführ
no flags
Patch (137.00 KB, patch)
2018-11-20 12:44 PST, Dominik Inführ
no flags
Patch (137.00 KB, patch)
2018-11-21 01:10 PST, Dominik Inführ
no flags
Dominik Inführ
Comment 1 2018-11-12 09:32:54 PST
Dominik Inführ
Comment 2 2018-11-13 10:26:34 PST
This patch enables the baseline JIT on ARM/Linux. It also contains patch https://bugs.webkit.org/show_bug.cgi?id=191256, since that hasn't been reviewed yet. It probably makes sense to land them separately.
Yusuke Suzuki
Comment 3 2018-11-19 22:18:49 PST
Could you rebase the patch?
Dominik Inführ
Comment 4 2018-11-20 01:06:44 PST
Yusuke Suzuki
Comment 5 2018-11-20 04:03:44 PST
Comment on attachment 355322 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=355322&action=review r=me with comments. > Source/JavaScriptCore/jit/JITCall32_64.cpp:298 > + if (compileCallEval(bytecode)) { This brace is not necessary. > Source/JavaScriptCore/llint/LowLevelInterpreter.asm:628 > +elsif ARMv7 > + macro probe(action) > + push a0 > + push a1 > + push a2 > + push a3 > + push t0 > + push t1 > + push t2 > + push t3 > + push t4 > + push t5 > + push lr > + push csr0 > + > + action() > + > + pop csr0 > + pop lr > + pop t5 > + pop t4 > + pop t3 > + pop t2 > + pop t1 > + pop t0 > + pop a3 > + pop a2 > + pop a1 > + pop a0 > + end The implementation is almost the same to the above implementation for X86_64 or ARM64 or ARM64E. Can we share the code with it? > Source/JavaScriptCore/runtime/SamplingProfiler.cpp:447 > + > + if (!codeBlock->instructions().size()) { > + isValid = false; > + return 0; > + } I think this is unnecessary if we add InstructionStream::contains, which is described below. > Source/JavaScriptCore/runtime/SamplingProfiler.cpp:451 > + const Instruction* begin = codeBlock->instructions().at(0).ptr(); > + const Instruction* end = reinterpret_cast<const Instruction*>(reinterpret_cast<const uint8_t*>(begin) + codeBlock->instructions().size()); > + if (instruction >= begin && instruction < end) { I think this should be encapsulated in InstructionStream class. Adding InstructionStream::contains, and if (codeBlock->instructions().contains(nstruction)) { looks better. > Source/cmake/WebKitFeatures.cmake:71 > elseif (WTF_CPU_ARM AND WTF_OS_UNIX) Should we switch this `UNIX` to `LINUX` because `OS(LINUX)` is checked in Platform.h?
Dominik Inführ
Comment 6 2018-11-20 12:44:33 PST
Dominik Inführ
Comment 7 2018-11-20 12:46:56 PST
Thanks for the review! I think I've addressed your comments. The braces are removed. The probe-macro from x64 and arm64 is now also used for arm. I added InstructionStream::contains and in CMakeLists.txt I am now using WTF_OS_LINUX instead of WTF_OS_UNIX (I had to introduce that flag).
Yusuke Suzuki
Comment 8 2018-11-21 00:02:51 PST
Comment on attachment 355356 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=355356&action=review r=me > Source/JavaScriptCore/bytecode/InstructionStream.cpp:49 > + const Instruction* begin = at(0).ptr(); > + const Instruction* end = reinterpret_cast<const Instruction*>(reinterpret_cast<const uint8_t*>(begin) + size()); > + > + return instruction >= begin && instruction < end; Actually, you do not need to use `Instruction*` here. You can define this function simply by, const uint8_t* pointer = bitwise_cast<const uint8_t*>(instruction); return pointer >= m_instructions.data() && pointer < (m_instructions.data() + m_instructions.size()); > Source/JavaScriptCore/jit/GPRInfo.h:531 > +#define NUMBER_OF_CALLEE_SAVES_REGISTERS 1u This is only correct for ARM_THUMB2.
Dominik Inführ
Comment 9 2018-11-21 01:10:10 PST
Yusuke Suzuki
Comment 10 2018-11-21 01:12:15 PST
Comment on attachment 355395 [details] Patch r=me, nice!
WebKit Commit Bot
Comment 11 2018-11-21 03:03:36 PST
Comment on attachment 355395 [details] Patch Clearing flags on attachment: 355395 Committed r238414: <https://trac.webkit.org/changeset/238414>
WebKit Commit Bot
Comment 12 2018-11-21 03:03:38 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 13 2018-11-21 03:04:22 PST
Note You need to log in before you can comment on or make changes to this bug.