When dnx executes, it loads a list of IAssemblyLoaders, of which one is a ProjectAssemblyLoader
https://github.com/aspnet/dnx/blob/master/src/Microsoft.Dnx.Runtime/Loader/ProjectAssemblyLoader.cs
and the ProjectAssemblyLoader embeds an ICompilationEngine,
Dnx also includes a DesignTimeHost. https://github.com/aspnet/dnx/blob/master/src/Microsoft.Dnx.DesignTimeHost/Program.cs I'm not sure where this is used, but a DTH usually embeds a Roslyn compiler.
Update: See https://github.com/aspnet/dnx/commit/a3d1f0f29c1f4e49326cf66e330dc56cd0105576 where you can pass a command line option to ApplicationHost.cs to use an out of process DesignTimeHost compiler.