Currently, in release mode, Ferlium only shows functions in the backtrace upon an execution error. In debug mode, it also shows the local variable names, but it achieves that by modifying the IR instructions to maintain this locals vector, which is slow and does not scale to release mode.
A better solution is to build a static debug information data structure, that maps local names to spans (and later to instruction index), and use this structure to look the local names up when printing the backtrace, regardless of the mode.
This will also allow to scale this display up to lower IR than the current tree-based IR.
Currently, in release mode, Ferlium only shows functions in the backtrace upon an execution error. In debug mode, it also shows the local variable names, but it achieves that by modifying the IR instructions to maintain this locals vector, which is slow and does not scale to release mode.
A better solution is to build a static debug information data structure, that maps local names to spans (and later to instruction index), and use this structure to look the local names up when printing the backtrace, regardless of the mode.
This will also allow to scale this display up to lower IR than the current tree-based IR.