1. A system that caches runtime-generated code comprising: a component executing in a managed code environment on a computer, the component caching an entity in a first cache or a second cache the cached entity comprising runtime-generated code, the runtime-generated code generated by a dynamic-code-generating entity at runtime, wherein the dynamic-code-generating entity does not perturb global state, wherein the cached entity is retrieved from the first cache or the second cache in subsequent executions of the cached entity, bypassing at least one phase of code generation, the at least one phase of code generation bypassed comprising generation of intermediate byte code or generation of native binary code.