A Simple showcase for the Sea-of-Nodes compiler IR
A Simple showcase for the Sea-of-Nodes compiler IR
This repo is intended to demonstrate the Sea-of-Nodes compiler IR.
The Sea-of-Nodes is the core IR inside of HotSpot’s C2 compiler
and Google’s V8 compiler and Sun/Oracle’s Graal compiler.
Since we are show casing the SoN IR, the language being implemented is less important.
We’re using a very simple language similar to C or Java, but with far fewer features.
The Sea-of-Nodes is used for machine code generation in these industrial
strength systems - but for this demonstration the backend is both difficult
and less important.
This repo also is not intended to be a complete language in any sense,
and so the backend will probably start with levering C or Java.
The following is a rough plan, subject to change.
Each chapter will be self-sufficient and complete; in the sense that each chapter will fully implement
a subset of the Simple language, and include everything that was created in the previous chapter.
Each chapter will also include a detailed commentary on relevant aspects of the
Sea Of Nodes intermediate representation.
The Simple language will be styled after a subset of C or Java
return
statement.arg
. Binary and Comparison operators involving constants and arg
. Non-zero values will be truthy. Peephole optimizations involving algebraic simplifications.if
statement. CFG construction.while
statement. Looping construct - eager phi approach.break
and continue
statements.