Message416409
Rather than maintaining the offset of the "last instruction" (`f_lasti`), interpreter frames should instead just maintain a pointer to the true next instruction. This has several benefits, most notably reducing the register pressure associated with loading first_instr on every instruction and call in the main interpreter loop:
When entering a frame:
- Before: `next_instr = first_instr + frame->f_lasti + 1;`
- After: `next_instr = frame->next_instr;`
When starting a new instruction:
- Before: `frame->next_instr = next_instr++ - first_instr;`
- After: `frame->next_instr = ++next_instr;`
Benchmarks suggest that this overhead is surprisingly significant (something like 2%). |
|
| Date |
User |
Action |
Args |
| 2022-03-31 01:12:26 | brandtbucher | set | recipients:
+ brandtbucher, Mark.Shannon |
| 2022-03-31 01:12:26 | brandtbucher | set | messageid: <[email protected]> |
| 2022-03-31 01:12:26 | brandtbucher | link | issue47177 messages |
| 2022-03-31 01:12:26 | brandtbucher | create | |
|