1. A method for accessing code, comprising: detecting an event in an emulated environment; determining compiled code associated with the event is not stored in a code cache; and accessing compiled code from a secondary memory, the compiled code associated with the event and generated before detection of the event.