titzer / virgil

A fast and lightweight native programming language
1.23k stars 44 forks source link

[unbox] Unbox Variants with Scalar Sets #231

Closed btwj closed 6 months ago

btwj commented 6 months ago

This PR reworks how variants are solved. Instead of the previous approach using unifyRepresentations, the target provides a mapping from Type to a Scalar.set.

TODOs/Issues

btwj commented 6 months ago

@titzer I'm currently having trouble with the JVM target when it generates the heap image wrt closures. This happens when we have code pointers from a closure stored in a reference slot (#ref), see ub_cell00.v3. I'm also not that sure what the JVMV3ClosureAdapterGen is doing. Could you give me a couple pointers?

Scratch that, I figured out how to fix it.