How does Unity compilation work?

I’m trying to understand how Unity compilation works, and how this differs from Flash, which also seems to be cross-platform-able via a virtual player/machine.

There is very sparse info in http://docs.unity3d.com/Documentation/ScriptReference/index.Script_compilation_28Advanced29.html … so the order I am guessing may not be accurate:

Is this the order that Unity compiles:

  1. Upon saving script from MonoDevelop/VS/UniSCiTE, switch to IDE, Unity compiles Unity JS/C#/Boo to .NET dll.

  2. Upon building the project, it is packaged into a virtual machine for each platform, where the .dll are JIT-compiled at runtime EXCEPT for iOS, where an AOT process happens when the project is built in XCode?

The AOT process happens as part of the build process in Unity. After that, when you load XCode you’ll see a bunch of .s files (assembly language files) which are your AOT-compiled sources.

I assume Flash, when you use Adobe Air, does some kind of AOT compile process when you build. The ActionScript interpreter running on the iOS device (if there is one) must also be purely an interpreter with no JIT dynamic code generation.