Caching runtime generated code

US9250938B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-9250938-B2
Application numberUS-25149708-A
CountryUS
Kind codeB2
Filing dateOct 15, 2008
Priority dateOct 15, 2008
Publication dateFeb 2, 2016
Grant dateFeb 2, 2016

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

A program entity that generates code but that does not perturb global state is identified. Code produced by the identified program entity can be assigned an identifier and cached the first time it is executed. Subsequent executions of the program entity can eliminate generation of the code and/or translation of the generated code into native binary code. The runtime generated code and native binary code can be cached in a machine-wide cache, or can be added to the metadata of the assembly generated from the source code of the program entity.

First claim

Opening claim text (preview).

What is claimed: 1. A system that caches runtime-generated code comprising: a processor; and a memory coupled to the processor that contains a program, which, when executed by the processor, is configured to cache a cacheable entity in a cache by performing the steps of: determining whether a dynamic-code-generating entity is a pure function; in response to determining that the dynamic-code-generating entity is a pure function, calculating an identifier for the cacheable entity, the cacheable entity comprising runtime-generated code generated based on the dynamic-code-generating entity, the runtime-generated code comprising intermediate byte code; determining whether the calculated identifier is found in a first cache configured to store the runtime-generated code; in response to determining that the calculated identifier is not found in the first cache, generating and storing the cacheable entity in the first cache; and in response to determining that the calculated identifier is found in the first cache: determining whether the calculated identifier is found in a second cache configured to store native binary code for the runtime-generated code that is generated from the intermediate byte code; and generating, loading, and executing the native binary code and storing the generated native binary code in the second cache in response to determining that the calculated identifier is not found in the second cache. 2. The system of claim 1 , the steps further comprising: in response to determining that the calculated identifier is found in the first cache, bypassing generation of intermediate byte code for the runtime-generated code for subsequent executions of the dynamic-code-generating entity. 3. The system of claim 1 , the steps further comprising: in response to determining that the calculated identifier is found in the second cache, bypassing generation of native binary code for the runtime-generated code for subsequent executions of the dynamic-code-generating entity. 4. The system of claim 1 , wherein the intermediate byte code for the runtime-generated code is generated by a Reflection Emit mechanism when the dynamic-code-generating entity executes. 5. The system of claim 1 , wherein the calculated identifier is comprised of a name associated with the dynamic-code-generating entity, at least one argument passed to the dynamic-code-generating entity and a version indicator for the dynamic-code-generating entity. 6. The system of claim 1 , wherein the first cache comprises a system-wide cache and the second cache comprises a system-wide cache. 7. A method of caching runtime-generated code comprising: determining whether a runtime-code-generating entity is a pure function; in response to determining the runtime-code-generating entity is a pure function: calculating an identifier for an entity comprising runtime-generated code generated based on the runtime-code-generating entity, the runtime-generated code entity comprising intermediate byte code created by a Reflection Emit mechanism, the calculated identifier comprising execution-context-specific characteristics of the runtime-generated code, the execution-context-specific characteristics identifying a version of the runtime-code-generating entity; determining whether the calculated identifier is found in a first cache configured to store the runtime-generated code entity; in response to determining that the calculated identifier is not found in the first cache, generating and storing the runtime-generated code entity in the first cache keyed on the calculated identifier upon a first execution of the runtime-generated code entity; in response to determining that the calculated identifier is found in the first cache: determining whether the calculated identifier is found in a second cache configured to store native binary code for the runtime-generated code entity that is generated from the intermediate byte code; and loading and executing the native binary code from second cache in response to determining that the calculated identifier is found in the second cache; and returning the stored runtime-generated code entity in response to a second execution of the stored runtime-generated code entity, wherein generation of the intermediate byte code for the stored runtime-generated code entity is bypassed for the second execution of the stored runtime-generated code entity. 8. The method of claim 7 , further comprising: in response to determining that the calculated identifier is not found in the second cache, generating the native binary code for the runtime-generated code from the intermediate byte code for the stored runtime-generated code entity. 9. The method of claim 7 , wherein the first cache is a source assembly comprising the stored runtime-generated code entity. 10. The method of claim 7 , wherein the calculated identifier comprises an identifier comprised of a name associated with the runtime-code-generating entity, at least one argument passed to the runtime-code-generating entity and a version indicator for the runtime-code-generating entity. 11. A computer-readable storage medium, the computer-readable storage medium being hardware and comprising computer-executable instructions which when executed cause a managed computing environment to: determine whether a runtime-code-generating entity is a pure function; and in response to determining the runtime-code-generating entity is a pure function: calculate an identifier for a cacheable entity, the cacheable entity comprising runtime-generated code generated based on the runtime-code-generating entity, the runtime-generated code comprising intermediate byte code; determine whether the calculated identifier is found in a first cache configured to store the runtime-generated code; in response to determining that the calculated identifier is not found in the first cache, generate and store the cacheable entity in the first cache; and in response to determining that the calculated identifier is found in the first cache: determine whether the calculated identifier is found in a second cache configured to store native binary code for the runtime-generated code that is generated from the intermediate byte code; and generate, load, and execute the native binary code and store the generated native binary code in the second cache in response to determining that the calculated identifier is not found in the second cache. 12. The computer-readable storage medium of claim 11 , comprising further computer-executable instructions, which when executed cause the computing environment to: in response to determining that the calculated identifier is found in the first cache, bypass generation of the intermediate byte code for the runtime-generated code for subsequent executions of the runtime-code-generating entity. 13. The computer-readable storage medium of claim 11 , comprising further computer-executable instructions, which when executed cause the computing environment to: in response to determining that the calculated identifier is found in the second cache, bypass generation of the native binary code from the intermediate byte code for the runtime-generated code for the subsequent executions of the runtime-code-generating entity. 14. The computer-readable storage medium of claim 11 , comprising further computer-executable instructions, which when executed cause the computing environment to: cache the native binary code in a source assembly of the runtime-code-generating entity. 15. The computer-readable storage medium of claim 11 , comprising further computer-

Assignees

Inventors

Classifications

  • G06F9/4552Primary

    Involving translation to a different instruction set architecture, e.g. just-in-time translation in a JVM · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US9250938B2 cover?
A program entity that generates code but that does not perturb global state is identified. Code produced by the identified program entity can be assigned an identifier and cached the first time it is executed. Subsequent executions of the program entity can eliminate generation of the code and/or translation of the generated code into native binary code. The runtime generated code and native bi…
Who is the assignee on this patent?
Herring Nathan, Wrighton David C, Microsoft Technology Licensing Llc
What technology area does this patent fall under?
Primary CPC classification G06F9/4552. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Feb 02 2016 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 8 related publications on this page (citations in our corpus or others sharing the same primary CPC).