"KF" == Ken Fox writes:
KF> Adam Turoff wrote:
when dealing with threaded bytecode is that the threading specifically
eliminates the indirection in the name of speed.
KF> Yes. Chaim was saying that for the functions that need indirection,
KF> they could use stubs. You don't need to guess in advance which ones
KF> need indirection because at run-time you can just copy the old code
KF> to a new location and *write over* the old location with a "fetch pointer
KF> and tail call" stub. All bytecode pointers stay the same -- they just
KF> point to the stub now. The only restriction on this technique is that
KF> the no sub body can be smaller than the indirection stub. (We could
KF> easily make a single bytecode op that does a symbol table lookup
KF> and tail call so I don't see any practical restrictions at all.)

We may not even need to copy the body. If the header of the function
is target location, the header could any one of
nest another inner loop
lookup current symbol
fixup caller
or jump to new target.

(Hmm, with Q::S, it could be all of them in constant time.)

Chaim Frenkel Nonlinear Knowledge, Inc.
chaimf@pobox.com +1-718-236-0183

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 15 of 16 | next ›
Discussion Overview
groupperl6-internals @
postedOct 20, '00 at 12:01p
activeOct 26, '00 at 2:10p



site design / logo © 2018 Grokbase