3 ms·
Targeting a stack machine is much easier when writing a compiler for the first time, but real-world machines are generally register based. In general this is t
by lewurm 8y ago
Targeting a stack machine is much easier when writing a compiler for the first time, but real-world machines are generally register based.
In general this is true, here however, we are targeting LLMV IR which is register based with infinite registers; so it's kinda easy again :-) The hard part, register allocation, is actually done by LLVM.
This class implements the conversion:
https://github.com/lambdageek/mono/blob/mjit/mcs/class/Mono.Compiler/Mono.Compiler.BigStep/CILSymbolicExecutor.cs https://github.com/lambdageek/mono/blob/mjit/mcs/class/Mono....