[Vm-dev] context change versus primitive failure return value (was: FFI exception failure support on Win64 (Win32 also?))
tim at rowledge.org
Thu Aug 30 16:59:16 UTC 2018
I can answer that at least in part - history.
> On 2018-08-30, at 9:22 AM, Ben Coman <btc at openinworld.com> wrote:
> Now a naive question, since as a 13,000 line function its a bit hard to absorb intepret()...
> why inline by direct code generation rather than as using the "inline" directive on individually generated functions ??
Remember that the basics of this code are not much changed since 1994/5/6 and that the original code was very much Mac oriented. The Mac C compiler of the day didn't really do the inlining thing very well (it's too long ago to remember if many compilers in general use did!) and so a text based approach was used. It literally did simple text substitution and similar hacks. Because it became an essential element of the VM code in that far off time we even got to the point (several times, probably) where *not* doing the inlining run(s) produced code that wouldn't compile. To tell the truth, I have no idea if that is the current state; bursts of hard work over the years has fixed it at least once.
An interesting question to answer would be whether current general compilers actually do a good job with inlining. My last experiments were before I moved to Canada in '04, so very out of date, but IIRC it seemed things got slower back then.
It *should* be the better solution, logically. Compilers are meant to be better at this than us meatbags. If you, or anybody, can find a way to make the considerable time to work on it then we could find out and hopefully benefit.
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Useful Latin Phrases:- Fac ut gaudeam = Make my day.
More information about the Vm-dev