x-lang

← Index

x/tool/asm-compile

JIT compiler: x-lang to native code via assembler.

asm-compile-fresh

Emit native code for an x-lang (fn …) expression, with no cache in the way. asm-compile-cached – the cache behind the compile-asm door, in asm-cache.x – calls this only when the byte cache misses, which is why this module is imported lazily from there: loading it costs 2.5M evals, and a warm cache never needs it. Takes the fvar alist and the MODE already decided by that door: #f an integer function, #t an analyse callback, the symbol object an object function called from x, whose params stay the objects they evaluate to and whose result is returned as one, the symbol operative an object function whose one param is its argument list unevaluated, each argument evaluated where the body says (%eval x), or (run TYPE …) a routine for a slot of the base’s slot vector, whose params are the words of its argument run. An fvar holding a prim may be CALLED by name; (%call HEAD arg …) calls a prim the code computes, and refuses at run time if the head is not one.

Returns: CALLABLE — X-lang callable prim