ReadyTalk / avian

[INACTIVE] Avian is a lightweight virtual machine and class library designed to provide a useful subset of Java's features, suitable for building self-contained applications.
https://readytalk.github.io/avian/
Other
1.22k stars 173 forks source link

add ARM64 JIT support #383

Closed dicej closed 9 years ago

dicej commented 9 years ago

This adds support for JIT compilation on Linux/ARM64. All the tests are currently passing for the default and debug builds, but more work will be needed to support tail calls, continuations, and AOT compilation.

dicej commented 9 years ago

@joshuawarner32, it looks like I broke the codegen-targets=all build due to conditional compilation in operations32.cpp and operations64.cpp. Any suggestions on how I should fix it?

joshuawarner32 commented 9 years ago

codegen-targets=all is supposed to build all of the backend code to prevent silly build regressions, so ideally we should either merge the arm/arm64 code to the point that they can be distinguished by normal ifs, or compile the arm backend twice (once for arm and once for arm64).

For the moment, you might try either explicitly setting AVIAN_TARGET_ARCH for the codegen-targets=all build (I don't think the x86 target pays attention to it, so just setting it to AVIAN_ARCH_ARM(64) for the whole build shouldn't be harmful, even if it is completely non-intuitive). Alternatively, you could predicate the conditional compilation on TARGET_BYTES_PER_WORD == 8 instead.

dicej commented 9 years ago

Thanks, @joshuawarner32. I took the easy route of using TARGET_BYTES_PER_WORD. Switching it to normal ifs shouldn't be difficult, but I'll leave that for later.

dicej commented 9 years ago

I've just fixed a bug with the bootimage=true build, so AOT compilation now works.

dicej commented 9 years ago

I just pushed another commit to support continuations and replace some of the preprocessor conditionals with C++ ones.