Skip to content

BEGIN/END to be wrtten into Script/Eval as IR #2330

@enebo

Description

@enebo

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:

  1. remove an instr
  2. simplify eval/script handling so the no longer need to separately record BEGIN/END blocks
  3. zero work needed after this change for JIT to work

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions