发明名称 METHOD AND APPARATUS FOR FACILITATING EXCEPTION HANDLING USING A CONDITIONAL TRAP INSTRUCTION
摘要 One embodiment of the present invention provides a system that supports exception handling through use of a conditional trap instruction. The system supports a head thread that executes program instructions and a speculative thread that speculatively executes program instructions in advance of the head thread. During operation, the system uses the speculative thread to execute code, which includes an instruction that can cause an exception condition. After the instruction is executed, the system determines if the instruction caused the exception condition. If so, the system writes an exception condition indicator to a register. At some time in the future, the system executes a conditional trap instruction which examines a value in the register. If the value in the register is an exception condition indicator, the system executes a trap handling routine to handle the exception condition. Otherwise, the system proceeds with execution of the code. In one embodiment of the present invention, prior to executing the instruction, the system allows a compiler to optimize a program containing the instruction. This optimization process includes scheduling an exception testing instruction associated with the instruction to occupy a free instruction slot following the instruction. This exception testing instruction determines if the instruction causes the exception condition. In one embodiment of the present invention, the trap handling routine triggers a rollback operation to undo operations performed by the speculative thread.
申请公布号 WO0167239(A2) 申请公布日期 2001.09.13
申请号 WO2001US06931 申请日期 2001.03.01
申请人 SUN MICROSYSTEMS, INC. 发明人 TREMBLAY, MARC;CHAUDHRY, SHAILENDER
分类号 G06F9/38;(IPC1-7):G06F9/38 主分类号 G06F9/38
代理机构 代理人
主权项
地址