# US 2015/0149986 A1 · Systems and Methods for Loop Suspension in Java Programming

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

- Number: US 2015/0149986 A1
- Document ID: US20150149986A1
- Status: Published application
- Kind: A1
- Application number: 14/533,540
- Filed: 2014-11-05
- Published: 2015-05-28
- Earliest claimed: 2013-11-25
- Assignees: Marvell World Trade Ltd.
- Applicants: Marvell World Trade Ltd.
- Inventors: Haitao Huang; Liping Gao; Xinyu Qi; Ningsheng Jian
- Web page: https://patentgrep.com/patent/US20150149986A1

## CPC

- G06F 9/45508: {Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

System and methods are provided for loop process suspension. One or more loop instructions associated with a loop process are loaded in a code cache. One or more branch instructions associated with a branch of the loop process in the code cache are determined. A suspension event is detected. The branch instructions are replaced with one or more jump instructions in the code cache upon the detection of the suspension event. If the jump instructions are executed in the code cache, the branch instructions in the code cache are restored, and the loop process is suspended. One or more suspension instructions associated with the suspension event are executed in an interpreter.

## Claims

### Claim 1

A method for loop process suspension, the method comprising:
loading one or more loop instructions associated with a loop process in a code cache;
determining one or more branch instructions associated with a branch of the loop process in the code cache;
detecting a suspension event;
replacing the branch instructions with one or more jump instructions in the code cache upon the detection of the suspension event;
in response to the jump instructions being executed in the code cache,
restoring the branch instructions in the code cache;
suspending the loop process; and
executing one or more suspension instructions in an interpreter, the suspension instructions being associated with the suspension event.

### Claim 2 (depends on 1)

The method of claim 1, wherein the branch corresponds to a loop back edge associated with the loop process.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
jumping to the interpreter in response to the jump instructions being executed in the code cache.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
setting a suspend flag.

### Claim 5 (depends on 4)

The method of claim 4, wherein the suspend flag is not tested during the loop process.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
in response to the branch instructions being restored in the code cache, testing a suspend flag; and
in response to the suspend flag not being set, continuing the loop process.

### Claim 7

The method of wherein the code cache is associated with a Just-in-time (JIT) compiler.

### Claim 8 (depends on 1)

The method of claim 1, wherein the interpreter is associated with a Java virtual machine.

### Claim 9

A system for loop process suspension, the system comprising:
a code cache configured to store one or more loop instructions associated with a loop process;
a monitor component configured to determine one or more branch instructions associated with a branch of the loop process in the code cache and replace the branch instructions with one or more jump instructions in the code cache upon detection of a suspension event;
a running component configured to, in response to the jump instructions being executed in the code cache, restore the branch instructions in the code cache and suspend the loop process; and
an interpreter component configured to execute one or more suspension instructions associated with the suspension event.

### Claim 10 (depends on 9)

The system of claim 9, wherein the branch corresponds to a loop back edge associated with the loop process.

### Claim 11 (depends on 9)

The system of claim 9, wherein the running component is further configured to cause the interpreter to execute the suspension instructions in response to the jump instructions being executed in the code cache.

### Claim 12 (depends on 9)

The system of claim 9, wherein the monitor component is further configured to set a suspend flag.

### Claim 13 (depends on 12)

The system of claim 12, wherein the running component is configured not to test the suspend flag during the loop process.

### Claim 14 (depends on 9)

The system of claim 9, wherein the running component is further configured to:
upon the execution of the branch instructions, test a suspend flag; and
in response to the suspend flag not being set, continue the loop process.

### Claim 15 (depends on 9)

The system of claim 9, wherein the code cache is associated with a Just-in-time (JIT) compiler.

### Claim 16 (depends on 9)

The system of claim 9, wherein the interpreter is associated Java virtual machine.

### Claim 17

A system for loop process suspension, the system comprising:
a code cache configured to store one or more loop instructions associated with a loop process; and
one or more data processors configured to:
determine one or more branch instructions associated with a branch of the loop process in the code cache;
detect a suspension event;
replace the branch instructions with one or more jump instructions in the code cache upon the detection of the suspension event;
execute the jump instructions in the code cache;
restore the branch instructions in the code cache;
suspend the loop process; and
execute one or more suspension instructions in an interpreter, the suspension instructions being associated with the suspension event.

### Claim 18 (depends on 17)

The system of claim 17, wherein the branch corresponds to a loop back edge associated with the loop process.

### Claim 19 (depends on 17)

The system of claim 17, wherein the one or more data processors are further configured to jump to the interpreter upon the execution of the jump instructions.

### Claim 20 (depends on 17)

The system of claim 17, wherein the one or more data processors are further configured to:
upon the restoration of the branch instructions in the code cache, test a suspend flag; and
in response to the suspend flag not being set, continue the loop process.
