Posts

Posts uit mei, 2017 tonen

Function call return values

Hi there, it's been about a month since last I wrote on the progress of the even-moar-jit branch, so it is probably time for another update. Already two months ago I wrote about adding support for function calls in the expression JIT compiler. This was a major milestone as calling C functions is essential for almost everything that is not pure numerical computing. Now we can also use the return values of function calls (picture that!) The main issue with this was something I've come to call the 'garbage restore' problem, by which I mean that the register allocator would attempt to 'restore' an earlier, possibly undefined, version of a value over a value that would result from a function call. This has everything to do with the spill strategy  used by the compiler. When a value has to be stored to memory ( spilled ) in order to avoid being overwritten and lost, there are a number of things that can be done. The default, safest strategy is to store a value t