Going all the way to native code is hard. I would probably recommend both of:
* Compilers, Principles, and Tools (the Dragon Book)
* Engineering a Compiler
You can skim a lot of the Dragon Book, but it will introduce you to a lot of the basics around type checking and generating code. Then Engineering a Compiler (which roughly assumes you have some familiarity with compilers already) does a very good job of walking through all of the key algorithms behind control flow analysis, register allocation, instruction selection, optimization, etc.
* Compilers, Principles, and Tools (the Dragon Book)
* Engineering a Compiler
You can skim a lot of the Dragon Book, but it will introduce you to a lot of the basics around type checking and generating code. Then Engineering a Compiler (which roughly assumes you have some familiarity with compilers already) does a very good job of walking through all of the key algorithms behind control flow analysis, register allocation, instruction selection, optimization, etc.