Posts Tagged ‘compiler’

Examining .NET’s JIT output

October 18, 2007

This post explains how to look at the optimized x86 generated by the CLR.

Compiler generator using method inlining

October 18, 2007

It should be possible to write a language interpreter on top of Java or .NET and rely on method inlining to instantly get compiled code. Implement most of your interpreter opcodes as small static methods: Add, Subtract, LessThan, etc. Translate your language into Java/C# methods that call these opcodes. When the JIT sees all these small static methods, it should inline and optimize them. Presto! You’ve just written a compiler. It’s a bit like using partial evaluation to generate a compiler from an interpreter. I think Peter Sestof did this the hard way a long time ago.


Follow

Get every new post delivered to your Inbox.