RESOLVED FIXED 139295
[EFL] FTL JIT not working on ARM64
https://bugs.webkit.org/show_bug.cgi?id=139295
Summary [EFL] FTL JIT not working on ARM64
Dániel Bátyai
Reported 2014-12-05 04:58:53 PST
Currently the FTL JIT does not work on ARM64 EFL, because the ARM64 specific code part for stack unwinding is missing.
Attachments
Patch (20.46 KB, patch)
2014-12-05 05:00 PST, Dániel Bátyai
no flags
Patch (20.91 KB, patch)
2014-12-09 04:23 PST, Dániel Bátyai
no flags
Dániel Bátyai
Comment 1 2014-12-05 05:00:51 PST
Created attachment 242627 [details] Patch Added the missing code for stack unwinding and some additional small fixes
Akos Kiss
Comment 2 2014-12-05 05:54:02 PST
Comment on attachment 242627 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=242627&action=review > Source/JavaScriptCore/ftl/FTLCompile.cpp:68 > +#elif OS(LINUX) This is strange to me. Why do you need to care about this code in mmAllocateCodeSection? Both EFL & GTK use LLVM 3.5.0 now, so no "older" LLVM. Did you experience LLVM emitting eh_frame as a code section? If not, I would not touch this legacy code here. However, I'd tacke the same code in mmAllocateDataSection below, since the #if/#elif/#endif guards, as they stand now, may produce invalid C++ code after the preprocessing is done. If both OS(DARWIN) and OS(LINUX) are false then we are left with a missing "if (...) {" line and a dangling closing curly brace. So, it seems to be worthwhile to add #else #error "Unrecognized OS" here, so that we are on the safe side. > Source/JavaScriptCore/ftl/FTLCompile.cpp:635 > +#else I'd apply the "if Linux then this, if Darwin then that, error otherwise" idea here as well, instead of assuming that if we are not on Linux then it's Darwin. > Source/JavaScriptCore/ftl/FTLUnwindInfo.cpp:396 > +#else Similar to the above: make sure that we are on x86-64 and bail out otherwise. > Source/JavaScriptCore/ftl/FTLUnwindInfo.cpp:-737 > - // FIXME: Implement stackunwinding based on eh_frame on ARM64 In the x86-64 code path, there are some RELEASE_ASSERTs here. Have they no counterpart on ARM64? > Tools/efl/patches/llvm-elf-add-stackmaps.patch:60 > + I don't think that patching up an "official" patch is a good idea. That is, both llvm-elf-add-stackmaps.patch and llvm-elf-allow-fde-references-outside-the-2gb-range.patch have been accepted to and landed in LLVM trunk. They bear their commit ID, author's name, timestamp, comments, etc. Now, this would just change the "content" of the patches leaving everything else unchanged. It may become confusing later if someone checks out the changes from the LLVM repository by commit ID and finds that there are differences. So, I'd either replace the "official" patches with new patches that don't have references to the LLVM repository, or add two new patches in Tools/efl/patches that add whatever is missing for ARM64 to work. (I'd vote for the second option.)
Dániel Bátyai
Comment 3 2014-12-05 09:30:20 PST
(In reply to comment #2) > Comment on attachment 242627 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=242627&action=review > > > Source/JavaScriptCore/ftl/FTLCompile.cpp:68 > > +#elif OS(LINUX) > > This is strange to me. Why do you need to care about this code in > mmAllocateCodeSection? Both EFL & GTK use LLVM 3.5.0 now, so no "older" > LLVM. Did you experience LLVM emitting eh_frame as a code section? If not, I > would not touch this legacy code here. You're probably right, let me double-check this. > > However, I'd tacke the same code in mmAllocateDataSection below, since the > #if/#elif/#endif guards, as they stand now, may produce invalid C++ code > after the preprocessing is done. If both OS(DARWIN) and OS(LINUX) are false > then we are left with a missing "if (...) {" line and a dangling closing > curly brace. So, it seems to be worthwhile to add > #else > #error "Unrecognized OS" > here, so that we are on the safe side. Good point. > > > Source/JavaScriptCore/ftl/FTLCompile.cpp:635 > > +#else > > I'd apply the "if Linux then this, if Darwin then that, error otherwise" > idea here as well, instead of assuming that if we are not on Linux then it's > Darwin. > > > Source/JavaScriptCore/ftl/FTLUnwindInfo.cpp:396 > > +#else > > Similar to the above: make sure that we are on x86-64 and bail out otherwise. > > > Source/JavaScriptCore/ftl/FTLUnwindInfo.cpp:-737 > > - // FIXME: Implement stackunwinding based on eh_frame on ARM64 > > In the x86-64 code path, there are some RELEASE_ASSERTs here. Have they no > counterpart on ARM64? You are correct, I shouldn't have forgot about those. My bad. > > > Tools/efl/patches/llvm-elf-add-stackmaps.patch:60 > > + > > I don't think that patching up an "official" patch is a good idea. That is, > both llvm-elf-add-stackmaps.patch and > llvm-elf-allow-fde-references-outside-the-2gb-range.patch have been accepted > to and landed in LLVM trunk. They bear their commit ID, author's name, > timestamp, comments, etc. Now, this would just change the "content" of the > patches leaving everything else unchanged. It may become confusing later if > someone checks out the changes from the LLVM repository by commit ID and > finds that there are differences. > > So, I'd either replace the "official" patches with new patches that don't > have references to the LLVM repository, or add two new patches in > Tools/efl/patches that add whatever is missing for ARM64 to work. (I'd vote > for the second option.) Okay, I'll add seperate patches for the ARM64 parts.
Dániel Bátyai
Comment 4 2014-12-09 04:23:42 PST
Akos Kiss
Comment 5 2014-12-09 05:15:57 PST
(In reply to comment #4) > Created attachment 242908 [details] > Patch Looks good to me now. (But that does not mean much. Let's see what a reviewer has to say.)
Gyuyoung Kim
Comment 6 2014-12-09 06:44:21 PST
I also think JSC reviewer should review this patch. Pizlo ?
Michael Saboff
Comment 7 2014-12-15 10:16:01 PST
Comment on attachment 242908 [details] Patch r=me
WebKit Commit Bot
Comment 8 2014-12-15 14:57:34 PST
Comment on attachment 242908 [details] Patch Clearing flags on attachment: 242908 Committed r177315: <http://trac.webkit.org/changeset/177315>
WebKit Commit Bot
Comment 9 2014-12-15 14:57:38 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.