Open
Description
Currently our stack safety behavior relies on thrown exceptions that are caught and rehandled at every single stack frame. Since exceptions are a known trigger for JS JITs to de-optimize code, we ought to try to eliminate them.
Since Cont
exceptions are already not valid Pyret values, we don't really need to change our representations. We just need to change the try
/catch
mechanism to be an if
test at the end of the switch
statement in every Pyret function. Additionally, we need to consider how this impacts safeCall
, which probably does need to keep its try
/catch
, in case raw JS functions throw an exception that needs to be converted into a Pyret error.