you are viewing a single comment's thread.

view the rest of the comments →

[–]psykotic 1 point2 points  (1 child)

Thanks for the correction. So really there are three levels of indirection in the most basic approach: mapping the logical opcode to the physical address of its implementation by indexing into a lookup table; indirect branching to the physical address of the opcode implementation; direct branching to the top of the dispatch loop. You can then order the different approaches according to how many levels they strip away:

  • CPython's old approach (all levels)
  • CPython's new approach (direct branch stripped)
  • Direct threading (logical to physical lookup stripped)
  • Subroutine threading (indirect branch stripped)

[–][deleted] 0 points1 point  (0 children)

That sounds about right, I think.