When dnx executes, it loads a list of IAssemblyLoaders, of which one is a ProjectAssemblyLoader
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.