News for hackers. Stuff that matters.
Re:Building a baseline JIT for Lua automatically by russellsprouts on Friday May 12, 2023 @08:44PM (#35924294)
> To solve [forward branches], those bytecodes would push information about how the branch destination address shall be fixed up into a late-patch buffer.

This reminds me of how Forth `if` and `then` can be compiled in a single pass -- `if` writes the branch instruction and pushes the current instruction pointer to the stack, and `then` pops it and patches the instruction to point to the current instruction pointer.

Re:Building a baseline JIT for Lua automatically by sillycross on Saturday May 13, 2023 @01:42AM (#35925928)
That's an interesting approach :) Though it only works if the control flow in the language is exactly "paired" (no continue/break, no goto, etc), I guess?