Skip to content

cppia JIT: bring up the arm64 code generator #271

Closed

Description

@dimensionscape

The cppia JIT is off on arm64 for 6.0.0. Until now its arm64 code had never run in CI: on Apple Silicon it could not get executable memory (#266), and Linux arm64 only runs with the Haxe nightly. With MAP_JIT in place it ran on macOS arm64 for the first time (run https://github.com/openfl/libhxcpp/actions/runs/39885412835). libhxcpp's own cppia suite passed under it, but Haxe's unit tests under cppia, which pass interpreted (10,982 assertions), ended as soon as they started:

src/unit/TestMain.hx:44: START
libc++abi: terminating due to uncaught exception of type Dynamic
Abort trap: 6           bin/cppia/Host-debug bin/unit.cppia -jit

Jitted code cannot unwind C++ exceptions, so every native helper it calls catches them (TRY_NATIVE and CATCH_NATIVE) and leaves them for the jitted code's checkException. The same tests pass under the JIT on x86 and x86-64, so either a helper only arm64 code reaches lets an exception through, or the arm64 code generator gets the exception path wrong.

To work on it, build with -D HXCPP_CPPIA_JIT_ARM64, which turns the JIT on for arm64. Next steps: run Haxe's unit tests under cppia with the JIT on macOS arm64 under lldb (.github/workflows/traced.sh), so the abort shows the native frame the exception came from and the jitted frame it hit; fix that; then run the cppia suite, the cppia regression tests and Haxe's unit tests under the JIT on macOS arm64 before turning it on by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions