An open API service indexing awesome lists of open source software.

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)

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)**

![Bash screenshot](carbon.png)

## 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