Writing a JIT Compiler in C#
mono-project.com
Writing a JIT Compiler in C#
1–5 of 5 posts
Re: Writing a JIT Compiler in C#
#2I couldn't find the authors' logic in a cursory look at the source code. Does anyone know where it actually is?
Re: Writing a JIT Compiler in C#
#3The appendix ( Converting Stack-Based OpCodes into Register Operations ) is the most interesting part to me. Targeting a stack machine is much easier when writing a compiler for the first time, but real-world machines are generally register based. I couldn't find the authors' logic in a cursory look at the source code. Does anyone know where it actually is?
Re: Writing a JIT Compiler in C#
#4The appendix ( Converting Stack-Based OpCodes into Register Operations ) is the most interesting part to me. Targeting a stack machine is much easier when writing a compiler for the first time, but real-world machines are generally register based. I couldn't find the authors' logic in a cursory look at the source code. Does anyone know where it actually is?
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....
Re: Writing a JIT Compiler in C#
#5https://github.com/johandanforth/good-for-nothing-compiler (not my github)
And read an expanded/in depth version of the original article (with a link to download the original source) here:
https://www.cs.helsinki.fi/u/vihavain/k14/code_generation/pr...