https://github.com/jkirsteins/hashlink-arm
M1 runtime for Hashlink (wip, far from usable)
https://github.com/jkirsteins/hashlink-arm
Last synced: about 1 month ago
JSON representation
M1 runtime for Hashlink (wip, far from usable)
- Host: GitHub
- URL: https://github.com/jkirsteins/hashlink-arm
- Owner: jkirsteins
- Created: 2022-10-03T06:51:28.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-01T21:07:16.000Z (over 2 years ago)
- Last Synced: 2025-04-09T20:58:12.425Z (about 1 month ago)
- Language: Swift
- Size: 1.82 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hashlink-arm
This repository contains a work-in-progress ARM (Aarch64) JIT compiler for the [Hashlink](https://github.com/HaxeFoundation/hashlink) [Haxe](https://haxe.org/) target.
It is [made by Jānis Kiršteins](https://mastodon.gamedev.place/@jki)
**The motivation is the [lack of official Hashlink support for ARM](https://github.com/HaxeFoundation/hashlink/issues/77). Thus it can not be used on e.g. Apple Silicon)**

## Current status
Most of the opcodes are implemented. Currently (ignoring bugs) missing support for:
- 🔴 OToUFloat
- 🔴 ORefData
- 🔴 ORefOffset
- 🟡 `OCallClosure` and `OCallMethod` (these are partially implemented, but not for every edge case)‼️ Also importantly - this relies on a fork of the official `libhl`.
To guarantee the same behaviour, a lot of the internal code relies on `libhl` methods shared with the official runtime. Some of these methods are not exported for external processes, so it needs to be forked. I'll make this fork public eventually.
## References
Reference documents useful when working on this:
-
-
-
-## Getting started
To have colorized output first:
brew install xcbeautify
Then run tests via:
./test.sh [--filter ]
## TODO
Quick and dirty task list:
- [ ] Finish caching support (fails when caching invalid ccompat addresses)
- [ ] appendLoad/appendStore should use an offset immediate when possible (when e.g. >256 but divisible by 4)
- [ ] Remove non-static appendLoad/appendStore methods
- [ ] Combine appendLoad() methods
- [ ] deduplicate appendStore (offset immediate vs register)
- [ ] deduplicate appendLoad (offset immediate vs register)
- [ ] wrap entrypoint in safe call