# US 2015/0309777 A1 · Method of call context encoding

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

- Number: US 2015/0309777 A1
- Document ID: US20150309777A1
- Status: Published application
- Kind: A1
- Application number: 14/260,706
- Filed: 2014-04-24
- Published: 2015-10-29
- Earliest claimed: 2014-04-24
- Assignees: Plumbr OÜ
- Applicants: Plumbr OÜ
- Inventors: Nikita SALNIKOV-TARNOVSKI; Vladimir Sor
- Web page: https://patentgrep.com/patent/US20150309777A1

## CPC

- G06F 11/3636: {by tracing the execution of the program}
- 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

The present invention provides methods, systems and computer-program products in support of dynamic calling context encoding, in which call graph evolution is recorded in parallel with call events. In part, this can enable a calling context to be encoded on the fly at a low processing overhead without advance knowledge of the complete call graph.

## Claims

### Claim 1

A computer-implemented method of encoding a calling context of a called function in an execution flow of a computer program on a computer having a processor and a memory, the method comprising:
receiving into the processor caller information and an encoded calling context identifier for a called function of a computer program;
determining, using code executing in the processor, whether or not a current calling graph for the computer program has changed;
if there is no change to the current calling graph, storing the called function and the encoded calling context identifier in the memory in association with the current calling graph;
if there is a change to the current calling graph, storing the called function and the encoded calling context identifier in the memory in association with an updated calling graph; wherein the updated calling graph corresponds to the current calling graph after the change has been made; and
outputting from the processor the encoded calling context identifier in association with either the current calling graph of the called function or the updated calling graph of the called function.

### Claim 2 (depends on 1)

A method according to claim 1, further comprising recording the change to the current calling graph in a calling graph evolution log.

### Claim 3 (depends on 1)

A method according to claim 1, wherein the encoded calling context identifier is set using a Ball-Larus path encoding type algorithm.

### Claim 4 (depends on 1)

A method according to claim 1, wherein determining whether or not a current calling graph has changed comprises comparing the caller information with stored caller information for previously called functions.

### Claim 5 (depends on 1)

A method according to claim 1, wherein the caller information includes a callee identifier and an originating callsite identifier.

### Claim 6 (depends on 1)

A method according to claim 1, wherein the change to the current calling graph is an addition of a new node.

### Claim 7 (depends on 1)

A method according to claim 1, wherein the change to the current calling graph is a change in property of an existing node.

### Claim 8 (depends on 1)

A method according to claim 1, wherein the change to the current calling graph is an addition of a new edge.

### Claim 9 (depends on 1)

A method according to claim 1, wherein storing the called function and the encoded calling context identifier comprises linking a calling graph version identifier to the called function and the encoded calling context identifier.

### Claim 10 (depends on 10)

A method according to claim 10, further comprising modifying the calling graph version identifier if they is a change to the current calling graph.

### Claim 11 (depends on 1)

A method according to claim 1, wherein the computer program is an application executed by a Java® virtual machine (JVM).

### Claim 12 (depends on 1)

A method according to claim 1, wherein storing the called function and the encoded calling context identifier requires 64 or fewer bits.

### Claim 13 (depends on 9)

A method according to claim 9, wherein storing the called function, the encoded calling context identifier and the calling graph version identifier requires 64 or fewer bits.

### Claim 14

A computer-implemented method of decoding a calling context of a called function in an execution flow of a computer program on a computer having a processor, the method comprising:
providing a memory accessible to the processor of the computer;
receiving a called function, an encoded calling context identifier associated with the called function, and a calling graph version identifier;
building, using code executing in the processor, a calling graph that corresponds to the calling graph version identifier;
decoding, using code executing in the processor, the calling context identifier based on the calling graph;
outputting an execution path based on the decoded calling context identifier and called function.

### Claim 15 (depends on 14)

A method according to claim 14, wherein building a calling graph that corresponds to the calling graph version identifier comprises extracting a series of calling graph changes from a calling graph evolution log based on the calling graph version identifier, and applying the changes in sequence to an initial calling graph.

### Claim 16 (depends on 15)

A method according to claim 15, wherein extracting the series of calling graph changes from the calling graph evolution log uses a line sweeping replay technique.

### Claim 17 (depends on 14)

A method according to claim 14, wherein the computer program is an application executed by a Java® virtual machine (JVM).

### Claim 18

A computer program product comprising a non-transitory storage media having computer executable instructions stored thereon, wherein the computer executable instructions, when executed in a computer, cause the computer to perform a method of encoding a calling context of a called function in an execution flow of a computer program, the method comprising:
receiving caller information and an encoded calling context identifier for a called function of a computer program;
determining whether or not a current calling graph for the computer program has changed;
if there is no change to the current calling graph, storing the called function and the encoded calling context identifier in association with the current calling graph,
if there is a change to the current calling graph, storing the called function and the encoded calling context identifier in association with an updated calling graph, wherein the updated calling graph corresponds to the current calling graph after the change has been made.

### Claim 19

A computer program product comprising a non-transitory storage media having computer executable instructions stored thereon, wherein the computer executable instructions, when executed in a computer, cause the computer to perform a method of decoding a calling context of a called function in an execution flow of a computer program, the method comprising:
receiving a called function, an encoded calling context identifier associated with the called function, and a calling graph version identifier;
building a calling graph that corresponds to the calling graph version identifier;
decoding the calling context identifier based on the calling graph;
outputting an execution path based on the decoded calling context identifier and called function.
