Remove unused instructions from the VM
aoh opened this issue · 2 comments
Remove at next fasl update / minor release.
While I'm at removing instructions: Would it be okay for you, if I replace car
, cdr
, ncar
, and ncdr
by functions which call (ref x 1)
or (ref x 2)
after type checking? cons
and ncons
(Or call them cons+
and cons-
for int+ and int- respectively?) could also share a common instruction, which gets the type passed as a third parameter.
Sounds good. I think there has been a fixme about a typed ref somewhere for a while. Note that mkt instruction is already there, so (ncons a b) = (mkt 40 a b).
Converting primops to function calls in hot spots will cause some unnecessary overhead at the moment. It might be a good idea to define ncons in (owl math)
as a macro for now. Partial evaluation, or at least inlining, will fix this later.