My old attempt was fast, but destructively modified each inlined function in the definition.
More memory (max 10 copied ops per inlined cv), but more speed. No costly arg handling, no costly call and leave handling. Using the stack naturally and not as hackish and expensive as currently. Supporting fast call-by-ref, constants and literals and call-by-value, everything compile-time.
Now the loop-unroller will also be trivial.
BTW: nextstate is horror. It ends a statement, every ';',
and it resets the SP, the stack pointer, for each new line. A normal compiler would keep track of the stack context and would not pollute the stack with unconsumed data. lhs expr should not push their results to the stack, unless it's the end of a function.
For my inliner I added 2 new state ops, to keep the SP inside inlined functions, setstate and keepstate. Horrible, but so far an easier hack than rewriting the compiler to honor the lhs context properly.