public abstract class ExceptionDeliverer extends Object
The exception delivery implementation is specific to the compiler that generated the method's machine instructions.
Note that the "deliverException" and "unwindStackFrame" methods of this class will be called in an environment that does not permit garbage collection: see VM.disableGC(). We must do this because some of the parameters to these methods are raw machine addresses. They are not recognized by the garbage collector as Object references and so would not be correctly fixed up in the event of object motion during GC. As a consequence, implementors of these methods must not cause object allocations to take place (i.e. by calling "new" either directly or indirectly).
Constructor and Description |
---|
ExceptionDeliverer() |
Modifier and Type | Method and Description |
---|---|
abstract void |
deliverException(CompiledMethod compiledMethod,
Address catchBlockInstructionAddress,
Throwable exceptionObject,
AbstractRegisters registers)
Stackframe's method has a "catch" block for exception being
thrown and control is to be passed to that catch block.
|
abstract void |
unwindStackFrame(CompiledMethod compiledMethod,
AbstractRegisters registers)
Stackframe's method has no "catch" block for exception being thrown
and stackframe is to be "unwound" as follows:
1. for a synchronized method, call ObjectModel.genericUnlock(),
passing it the appropriate "lock" object
for non-static methods, the lock is the method's
first argument ("this")
for static methods, the lock is the method's java.lang.Class
2. restore the non-volatile registers (including fp) that were saved
in the method's prologue, by copying them from the method's stackframe
save area into the provided "registers" object
|
public ExceptionDeliverer()
public abstract void deliverException(CompiledMethod compiledMethod, Address catchBlockInstructionAddress, Throwable exceptionObject, AbstractRegisters registers)
Note: Implementers must issue the following two lines just before transferring control to the catch block:
VM.enableGC(); registers.inuse = false;
Note: this method does not return (execution resumes at catchBlockInstructionAddress)
compiledMethod
- method whose catch block is to receive controlcatchBlockInstructionAddress
- instruction address at which
to begin execution of catch blockexceptionObject
- exception object to be passed as argument to
catch blockregisters
- registers to be loaded before passing control to
catch blockpublic abstract void unwindStackFrame(CompiledMethod compiledMethod, AbstractRegisters registers)
compiledMethod
- method whose stackframe is to be unwoundregisters
- thread state to be updated by restoring non-volatiles
and unwinding the stackframe