摘要 |
A method for facilitating handling of exceptions in object code transformed from a 1-to-1 threading model to a M-to-N threading model comprises transforming object code having a 1-to-1 threading model to a M-to-N threading model, saving context of a Runnable section of the object code into a context object in response to an exception occurring and rethrowing the exception after performing the saving. The transforming includes creating a Boolean enable value in a method context for an exception handler in the method context, mapping an exception type to the exception handler and wrapping a Runnable section of the object code within a respective synthetic exception handler. The respective synthetic exception handler is configured for saving context of the object code Runnable into a context object in response to an exception occurring and rethrowing the exception after performing the saving.
|