Patent ID: 8516502

Claim:
A process of handling an interrupt by execution of Java bytecodes inside an interrupt execution flow without making a context switch, comprising: A. executing Java code as a thread 1 according to a first stack frame and a first program counter; B. while thread 1 is executing, detecting an interrupt, suspending the execution of thread 1 , pushing the first stack frame onto a stack, and switching program execution flow to an Interrupt Service Routine, the Interrupt Service Routine including both a micro-sequence handler and a Java portion, the Java portion including at least one Java method, the micro-sequence handler including a first micro-sequence portion that executes prior to the Java portion and a second micro-sequence portion that executes after the Java portion; C. upon transferring program execution flow to the Interrupt Service Routine, making a second program counter an active program counter during execution of the first micro-sequence portion and fetching and decoding the instructions of the first micro-sequence portion, the switch from the first program counter to the second program counter being effective immediately upon occurrence of the interrupt, thereby reducing latency; D. making an invocation in the first micro-sequence portion to create a second stack frame for executing the Java portion to handle the interrupt, pushing the second stack frame onto the stack for execution of the Java portion, and transferring execution of the interrupt to the Java portion, wherein the transfer makes the first program counter the active program counter and references the first instruction of the Java portion; E. executing the Java portion, utilizing Java bytecodes and Java object references, which increases the Java platform stability and security, and ending the Java portion with a return bytecode transferring execution to the second micro-sequence portion and the second program counter; and F. executing the second micro-sequence portion to delete the second stack frame that was used for execution of the Java portion, executing a return from interrupt to switch from the second program counter to the first program counter, popping the first stack frame on the stack, and continuing execution of thread 1 .