-
-
Notifications
You must be signed in to change notification settings - Fork 938
BEGIN/END to be wrtten into Script/Eval as IR #2330
Copy link
Copy link
Closed
Labels
Milestone
Description
BEGIN blocks will end up being inserted into the front of the script as callouts or inlined.
END blocks will be at the end of the scope. Instead of RecourseEndBlockInstr we will allocate a temp var in the script scope. Where RRBI was we will instead set the temp to a particular value. At the end of the script the END block the temp represents will wrap execution of the END with an if (IR-equiv).
The additional complexity of changing this is that all END blocks must effectively be in a finally. And they, I think, must each execute whether they error or not. So all of this will be something like this pseudo code:
try { BEGINs; code } finally { if %t_end_1 { try { END } {}} if %t_end2 { try {END2} {} }
The benefits of this change:
- remove an instr
- simplify eval/script handling so the no longer need to separately record BEGIN/END blocks
- zero work needed after this change for JIT to work
Reactions are currently unavailable