|
enter_try | ||||
· Operation | Enter try context for the
current method | |||
· Format |
| |||
· Direct Format |
| |||
· Forms | enter_try = 255, 30 (0xFF, 0x1E) | |||
· Description | The exception frame height for the current method is set to the current height of the stack. | |||
· Notes | This must be in the prolog of any method that includes
try blocks. It sets the "base height" of the stack
so that throw instructions know where to unwind the stack
to when an exception is thrown. |
jsr | |||||||||||||||
· Operation | Jump to local subroutine | ||||||||||||||
· Format |
| ||||||||||||||
· Direct Format |
| ||||||||||||||
· Forms | jsr = 218 (0xDA) | ||||||||||||||
· Stack | ... => ..., address | ||||||||||||||
· Description | The program counter for the next instruction (pc + 6)
is pushed on the stack as type ptr . Then the program
branches to pc + offset. | ||||||||||||||
· Notes | This instruction is used to implement finally
blocks. |
ret_jsr | |||
· Operation | Return from local subroutine | ||
· Format |
| ||
· Direct Format |
| ||
· Forms | ret_jsr = 219 (0xDB) | ||
· Stack | ..., address => ... | ||
· Description | The address is popped from the stack as the
type ptr and transferred into pc. | ||
· Notes | This instruction is used to implement finally
blocks. |
set_stack_trace | ||||
· Operation | Set the stack trace in an exception object at the throw point | |||
· Format |
| |||
· Direct Format |
| |||
· Forms | set_stack_trace = 255, 33 (0xFF, 0x21) | |||
· Stack | ..., object => ..., object | |||
· Description | The object is popped from the stack as
type ptr ; information about the current method's
stack calling context is written into object; and then
object is pushed back onto the stack. | |||
· Notes | This opcode will have no effect if object is
null , or if its class does not inherit from
System.Exception . |
throw | ||||
· Operation | Throw an exception | |||
· Format |
| |||
· Direct Format |
| |||
· Forms | throw = 255, 31 (0xFF, 0x1F) | |||
· Stack | ..., working1, ..., workingN, object => ..., object | |||
· Description | The object is popped from the stack as
type ptr . The stack is then reset to the same
as the current method's exception frame height. Then,
object is re-pushed onto the stack and control is
passed to the current method's exception matching code. | |||
· Notes | This is used to throw exceptions within methods that
have an enter_try instruction. Use throw_caller
if the method does not include try blocks.Setting the stack height to the exception frame height ensures that all working values are removed from the stack prior to entering the exception matching code. |
throw_caller | ||||
· Operation | Throw an exception to the caller of this method | |||
· Format |
| |||
· Direct Format |
| |||
· Forms | throw_caller = 255, 32 (0xFF, 0x20) | |||
· Stack | ..., working1, ..., workingN, object => ..., object | |||
· Description | The object is popped from the stack as
type ptr . The call frame stack is then unwound
until a call frame with a non-zero exception frame height is found.
The stack is then reset to the specified exception frame height.
Then, object is re-pushed onto the stack and control is
passed to the call frame method's exception matching code. | |||
· Notes | This is used to throw exceptions from within methods that
do not have an enter_try instruction. Use throw
if the method does include try blocks. |
Copyright © Southern
Storm Software Pty Ltd 2002
Licensed under GNU FDL