Skip to content

jkirsteins/hashlink-arm

Repository files navigation

hashlink-arm

This repository contains a work-in-progress ARM (Aarch64) JIT compiler for the Hashlink Haxe target.

It is made by Jānis Kiršteins

The motivation is the lack of official Hashlink support for ARM. Thus it can not be used on e.g. Apple Silicon)

Bash screenshot

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

About

M1 runtime for Hashlink (wip, far from usable)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages