title: What can a JIT compiler do that an AOT compiler cannot?
body: <p>A Just-in-Time (JIT) compiler can optimize a program based on runtime information that is unavailable to an Ahead-of-Time (AOT) compiler.</p>
  
  <p>The most obvious example of this runtime information is the target platform, e.g. the exact CPU on which the program is running, or any accelerators such as GPUs that might be available. This is the sense in which OpenCL is JIT-compiled.</p>
  
  <p>But suppose we do know ahead of time what the target platform is: we know which SIMD extensions will be available, etc. What other runtime information can a JIT-compiler exploit that is unavailable to an AOT-compiler?</p>
  
  <p>A HotSpot-style JIT-compiler will automatically optimize a program's hot spots... but can't an AOT-compiler just optimize the whole program, hot spots and all?</p>
  
  <p>I would like some examples of specific optimizations that a JIT-compiler can perform which an AOT-compiler cannot. Bonus points if you can provide any evidence for the effectiveness of such optimizations in "real world" scenarios.</p>