Threaded code (was Re: P-Code and virtual machines)

mark@godzilla.Quotron.COM (Mark T. Price (sg))
Sat, 26 Mar 1994 04:47:43 GMT

          From comp.compilers

Related articles
P-Code and virtual machines ghmilmei@iiic.ethz.ch (1994-03-23)
Threaded code (was Re: P-Code and virtual machines) mark@godzilla.Quotron.COM) (1994-03-26)
Threaded code dmr@plan9.research.att.com (1994-03-27)
Threaded code (was Re: P-Code and virtual machines) bevan@cs.man.ac.uk (Stephen J Bevan) (1994-03-27)
Re: Threaded code (was Re: P-Code and virtual m ivan@cadence.com (1994-03-28)
Re: Threaded code (was Re: P-Code and virtual machines) pardo@cs.washington.edu (1994-03-29)
Re: Threaded code (was Re: P-Code and virtual machines) uho@informatik.uni-kiel.d400.de (Ulrich Hoffmann) (1994-03-30)
| List of all articles for this month |
Newsgroups: comp.compilers
From: mark@godzilla.Quotron.COM (Mark T. Price (sg))
Keywords: interpreter, question, comment
Organization: Quotron Systems, Inc.
References: 94-03-104
Date: Sat, 26 Mar 1994 04:47:43 GMT

pardo@cs.washington.edu (David Keppel) writes:
> ...
> Stack machines have the advantage that the code is compact, easy to
> decode and easy to convert to threaded code (for fast decode) and can be
> implemented with similar efficiency across a fair range of machines.


I've heard threaded code mentioned here before, but don't have any formal
exposure to the topic. Can someone provide some good references for threaded
code in general, as well as some specifics on the above mentioned conversion
of stack code to threaded code?


--
Mark T. Price (sg) mark@godzilla.Quotron.COM
[The point of threaded code is that in an interpreter, instead of having
a list of arbitrary byte codes, you have a list of addresses of interpretive
routines, and each routine does an indirect jump through the list to dispatch
directly to the next routine, cutting interpreter overhead close to zero.
This was very popular on the PDP-11, where the threaded jump was the single
instruction JMP @(R5)+ and was used in both the DEC and the Unix Fortran
compilers. I don't know where it originated, but wouldn't be surprised if
it was back in the 50's, like most other interesting software techniques.
-John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.