RESOLVED FIXED 133596
make css jit work on armv7
https://bugs.webkit.org/show_bug.cgi?id=133596
Summary make css jit work on armv7
Alex Christensen
Reported 2014-06-06 18:09:37 PDT
I haven't tested this code on a device and there are some hacky things, but I think this is a big step in the right direction.
Attachments
Patch (17.25 KB, patch)
2014-06-06 18:24 PDT, Alex Christensen
no flags
Patch (16.39 KB, patch)
2014-06-09 10:54 PDT, Alex Christensen
no flags
Patch (12.46 KB, patch)
2014-06-13 10:58 PDT, Alex Christensen
no flags
Patch (15.91 KB, patch)
2014-06-13 11:15 PDT, Alex Christensen
no flags
Alex Christensen
Comment 1 2014-06-06 18:24:37 PDT
Yusuke Suzuki
Comment 2 2014-06-07 10:20:44 PDT
Comment on attachment 232641 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=232641&action=review Great patch! > Source/WebCore/cssjit/SelectorCompiler.cpp:1474 > + m_assembler.m_assembler.sdiv(resultRegister, inputDividend, divisorRegister); IIRC, APPLE_ARMV7S (ARMv7s) supports sdiv, but ARMv7 doesn't support it. So I think fallback path is needed. > Source/WebCore/cssjit/SelectorCompiler.cpp:1866 > +#endif Calculating element pointer + member's offset to lookup struct's member. So using addPtr (or addPtrNoFlags) instead and we can remove this ifdef :) > Source/WebCore/cssjit/StackAllocator.h:220 > +#endif `MacroAssembler::pushToSaveByteOffset` implementation for ARM_THUMB2 is `sizeof(void*)` and I think this ifdef is not necessary.
Alex Christensen
Comment 3 2014-06-09 10:54:15 PDT
Benjamin Poulain
Comment 4 2014-06-10 16:38:26 PDT
Comment on attachment 232713 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=232713&action=review > Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h:1415 > + // use addressTempRegister incase the branch32 we call uses dataTempRegister. :-/ I don't understand the problem here. Why isn't addressTempRegister the right register in this case? > Source/WebCore/cssjit/FunctionCall.h:94 > +#elif CPU(ARM_THUMB2) What about MIPS? ;) > Source/WebCore/cssjit/RegisterAllocator.h:67 > + JSC::ARMRegisters::r6, We cannot use r6, it could be used for addressTempRegister. I believe r4->r6 are callee saved registers ( https://developer.apple.com/library/ios/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARMv6FunctionCallingConventions.html#//apple_ref/doc/uid/TP40009021-SW10 ) > Source/WebCore/cssjit/SelectorCompiler.cpp:1095 > + prologueRegisters.append(JSC::ARMRegisters::fp); Do we care about fp? > Source/WebCore/cssjit/SelectorCompiler.cpp:1138 > + // ARM_THUMB2 does not have enough registers to compile complicated selectors. > + // Compiling should always succeed on non-ARM_THUMB2 CPUs. > + ASSERT_NOT_REACHED(); Indent.
Alex Christensen
Comment 5 2014-06-13 10:58:06 PDT
Alex Christensen
Comment 6 2014-06-13 11:12:07 PDT
(In reply to comment #4) > (From update of attachment 232713 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=232713&action=review > > > Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h:1415 > > + // use addressTempRegister incase the branch32 we call uses dataTempRegister. :-/ > > I don't understand the problem here. Why isn't addressTempRegister the right register in this case? I don't know. This was me making the code look like the code around it without fully understanding what the registers are used for. > Do we care about fp? I use fp as a caller saved register, and pushing 2 registers takes the same number of operations as pushing one. See comments in new patch, which will remind us to change this if we optimize for selectors that don't do function calls that won't need a prologue or epilogue. This works and passes all fast/selectors tests on armv7s.
Alex Christensen
Comment 7 2014-06-13 11:15:50 PDT
WebKit Commit Bot
Comment 8 2014-06-13 13:44:02 PDT
Comment on attachment 233062 [details] Patch Clearing flags on attachment: 233062 Committed r169947: <http://trac.webkit.org/changeset/169947>
WebKit Commit Bot
Comment 9 2014-06-13 13:44:05 PDT
All reviewed patches have been landed. Closing bug.
Csaba Osztrogonác
Comment 10 2014-06-14 02:14:25 PDT
Comment on attachment 233062 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=233062&action=review > Source/WebCore/cssjit/SelectorCompiler.cpp:1405 > +#else > +#error SelectorCodeGenerator::addFlagsToElementStyleFromContext not implemented for this architecture. > +#endif It broke the EFL ARM64 build: /home/webkitbuildbot/slaves/efl-ARM64-build/buildslave/efl-linux-arm64-release/build/Source/WebCore/cssjit/SelectorCompiler.cpp:1404:2: error: #error SelectorCodeGenerator::addFlagsToElementStyleFromContext not implemented for this architecture. #error SelectorCodeGenerator::addFlagsToElementStyleFromContext not implemented for this architecture.
Benjamin Poulain
Comment 11 2014-06-14 13:58:55 PDT
(In reply to comment #10) > (From update of attachment 233062 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=233062&action=review > > > Source/WebCore/cssjit/SelectorCompiler.cpp:1405 > > +#else > > +#error SelectorCodeGenerator::addFlagsToElementStyleFromContext not implemented for this architecture. > > +#endif > > It broke the EFL ARM64 build: > > /home/webkitbuildbot/slaves/efl-ARM64-build/buildslave/efl-linux-arm64-release/build/Source/WebCore/cssjit/SelectorCompiler.cpp:1404:2: error: #error SelectorCodeGenerator::addFlagsToElementStyleFromContext not implemented for this architecture. > #error SelectorCodeGenerator::addFlagsToElementStyleFromContext not implemented for this architecture. Quick fix (hopefully): <http://trac.webkit.org/changeset/169980>. Any chance to get a ARM64 EWS some day? :)
Note You need to log in before you can comment on or make changes to this bug.