# US 2013/0159980 A1 · Process for generating dynamic type

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2013/0159980 A1
- Document ID: US20130159980A1
- Status: Published application
- Kind: A1
- Application number: 13/325,879
- Filed: 2011-12-14
- Published: 2013-06-20
- Earliest claimed: 2011-12-14
- Assignees: Microsoft Corporation
- Inventors: Michael J. Braude
- Web page: https://patentgrep.com/patent/US20130159980A1

## CPC

- G06F 8/437: {Type checking}
- G06F 9/30181: {Instruction operation extension or modification}
- G06F 9/45504: {Abstract machines for program code execution, e.g. Java virtual machine [JVM], interpreters or emulators}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A process for generating dynamic type is disclosed. A compiler generated template method including a mark for custom instruction is selected for cloning. Dynamic code is injected at the mark for the custom instructions. The template method including the injected dynamic code is compiled.

## Claims

### Claim 1

A process for generating dynamic type, comprising
selecting a compiler generated template method for cloning, the compiler generated template method including a mark for custom instructions;
injecting dynamic code at the mark for custom instructions; and
compiling the template method including the injected dynamic code.

### Claim 2 (depends on 1)

The process of claim 1 wherein template method is compiled into an application.

### Claim 3 (depends on 2)

The process of claim 2 wherein the application includes a plurality of template methods.

### Claim 4 (depends on 1)

The process of claim 1 and further comprising cloning original instructions of the template method.

### Claim 5 (depends on 4)

The process of claim 4 wherein cloning includes converting the original instruction into a stream of instruction language operation codes and objects.

### Claim 6 (depends on 4)

The process of claim 4 wherein cloning the original instructions of the template method includes checking instructions for the mark.

### Claim 7 (depends on 6)

The process of claim 6 wherein checking instructions includes checking each instruction emitted during cloning.

### Claim 8 (depends on 6)

The process of claim 6 wherein custom instructions are injected instead of the original instructions at the mark.

### Claim 9 (depends on 8)

The process of claim 8 wherein the custom instructions are injected with a patching procedure.

### Claim 10 (depends on 8)

The process of claim 8 wherein the emitted original instructions of the template method and custom code are compiled.

### Claim 11 (depends on 1)

The process of claim 1 wherein compiling includes compiling original instructions emitted during cloning and the dynamic code.

### Claim 12

A process for generating dynamic type, comprising;
emitting original instructions of a selected compiler-generated template method template having a mark for injecting custom instructions;
calling a procedure to inject dynamic code in the context of the dynamic type at the mark for custom instructions rather than emitting original instructions at the mark.

### Claim 13 (depends on 12)

The process of claim 12 and further comprising compiling the emitted original instructions and the dynamic code.

### Claim 14 (depends on 12)

The process of claim 12 wherein the emitting original instruction is performed with a cloning procedure.

### Claim 15 (depends on 12)

The process of claim 12 and further comprising checking the original instruction for the mark prior to emitting the original instructions.

### Claim 16 (depends on 12)

The process of claim 12 wherein the template method includes embedded calls to the procedure.

### Claim 17 (depends on 16)

The process of claim 16 wherein the procedure is a static generic method in a selected class.

### Claim 18 (depends on 12)

The process of claim 12 wherein the procedure manually emits a small block of custom code that depends on the context of the dynamic type.

### Claim 19

A process for generating dynamic type, comprising:
selecting a compiler generated template method within an application, the template method including original instructions and an embedded call to a patching procedure;
emitting the original instructions;
injecting custom instructions with the patching procedure instead of cloning the embedded call; and
compiling the emitted original instructions and the injected custom instruction at runtime.

### Claim 20 (depends on 19)

The process of claim 19 wherein the patching procedure manually emits a block of custom code that depends on the context of the dynamic type.
