Update on "[compiler] Effects for Return/MaybeThrow terminals"
Adds explicit freeze effects for Return terminals and, more importantly, adds effects for MaybeThrow terminals. MaybeThrow is super interesting. The idea of the terminal is to represent that control-flow can break from nearly any instruction to the error handler (catch). InferMutableRanges has a pass that explicitly handles the corresponding data flow, saying that for any instruction in a block ending in MaybeThrow, to alias the instruction's lvalue to the catch handler. This is to handle cases like this: ```js const x = []; try { throwInput(x); } catch (x_alias) { mutate(x_alias); // mutates x! } ``` One realization is that this logic was overly pessimistic: most instruction types cannot actually throw their lvalue. In fact, the only things that can throw their lvalue are call expressions! `c = a.b` can throw, for example, but only with an error generated by the runtime, not with a user value. Doing this allows us to encode the data flow once and then not have to handle wiring up this data again later. [ghstack-poisoned]
Showing
No files found.
Please register or sign in to comment