Factbites
 Where results make sense
About us   |   Why use us?   |   Reviews   |   PR   |   Contact us  

Topic: Indirect threaded code


Related Topics

In the News (Sun 20 Dec 09)

  
 [No title]   (Site not responding. Last check: 2007-11-01)
Threaded code is somewhat in the middle between native machine code and interpreted bytecodes
This paper introduces the indirect threaded code and compares it with James Bell's direct threaded
code, segment threaded code) with illustrative examples, which are very helpful to understand these
www.ics.uci.edu /~qxie/report/1.html   (157 words)

  
 [No title]
In order for it to be possible to garbage collect in the presence of threads, it must be possible for the collector to decode the thread control blocks of all suspended threads, and trace outward from their saved state.
In RScheme, the usual representation of the code pointer is a pointer to a C procedure.
The C code generated for a Scheme procedure call is thus a few dereferences to accomplish the "setup" of the Scheme environment, and a call to the C procedure that implements the code.
www.cs.utexas.edu /ftp/pub/garbage/schnotes/rscheme.txt   (8542 words)

  
 Interpretation Techniques
Indirect threaded code [21] adds a level of indirection and makes the technique more portable.
Cint [18], a C language interpreter, shuns threaded code techniques, claiming they are machine dependent.
To avoid the machine dependency problem, Ertl [31] uses a feature of GNU gcc [90] to generate a threaded code interpreter from a C language source.
www.cs.unm.edu /~riesen/prop/node37.html   (510 words)

  
 Gforth Manual   (Site not responding. Last check: 2007-11-01)
Traditionally Forth has been implemented as indirect threaded code, because this allows to use only one cell to reference a non-primitive (basically you point to the data, and find the code address there).
However, threaded code in Gforth (since 0.6.0) uses two cells for non-primitives, one for the code address, and one for the data address; the data pointer is an immediate argument for the virtual machine instruction represented by the code address.
Primitive-centric threaded code allows us to use (faster) direct threading as dispatch method, completely portably (direct threaded code in Gforth before 0.6.0 required architecture-specific code).
www.complang.tuwien.ac.at /forth/gforth/Docs-html/Direct-or-Indirect-Threaded-.html   (421 words)

  
 University of Missouri - Rolla, Computer Science   (Site not responding. Last check: 2007-11-01)
The design, structure and performance of threaded code are examined through the development of a threaded code classification system and the modification of the threaded code technique used by a Forth programming language implementation.
Threaded code designs from the literature are described using the new classification scheme.
The threaded code techniques of variable depth indirect threaded code and token-indirect token threaded code are examined in a Forth programming language system on an INMOS IMS T222 transputer.
www.cs.umr.edu /technicalreports1991.html   (2787 words)

  
 Tcl bytecode optimization: some experiences
The speedup that can be achieved by careful coding at the Tcl level is much greater than the speedup obtained by upgrading; the fastest implementation in 8.3.4 is 8.5 times faster than the naïve implementation, while upgrading to 8.4 would gain only a 20% improvement.
A more interesting possibility[10] is to have the Tcl compiler generate indirect threaded code instead, storing, instead of bytecodes, the machine addresses of the C statements that execute the constructs.
Compiled code that has been stored for one machine may need to be loaded upon another, and the enviroment in which it is loaded may not be the same version of the execution engine.
aspn.activestate.com /ASPN/Tcl/TclConferencePapers2002/Tcl2002papers/kenny-bytecode/paperKBK.html   (6004 words)

  
 Converting Python Virtual Machine Code to C
This may not be the best strategy, since it can result in reams of C code being output; this time-space tradeoff has been noted in similar projects [14].
It is telling that programs which convert Forth and Java VM code into C begin by mapping stack locations into ``registers'' by placing their values into C variables [16,6].
``Threaded code'' and ``indirect threaded code'' are two techniques which are used in interpreter implementation [2,5].
www.python.org /workshops/1998-11/proceedings/papers/aycock-211/aycock211.html   (2780 words)

  
 ds.forth Programmer's Manual
The threaded code needs to be executed by the special primitives EXNEXT and RETURN.
The execution of threaded codes is slower than the execution of primitives, but it allows to make the machine independent part of DSFORTH system.
All codes in MODULE allocates the units divided by 4 and always aligned on 4.
www.delosoft.com /files/pr02_02.htm   (551 words)

  
 Win32Forth
All the other threading schemes are "variations" on this, so you need to understand ITC to appreciate the others.
ITC is neither the smallest nor the fastest threading technique.
ITC is the classical Forth model, so it may be preferred for education.
win32forth.sourceforge.net /doc/p-arch2.htm   (1091 words)

  
 FORTH, Inc. -- Evolution of Forth
He found free-form input to be both more efficient (smaller and faster code) and reliable than the more common Fortran practice of formatting into specific columns, which had resulted in numerous re-runs due to mis-aligned columns.
Within a dictionary entry was a "code field" containing the address of code to be executed for that routine.
The use of indirect threaded code was an important innovation, since an indirect jump was the only overhead once a word had been found.
burks.brighton.ac.uk /burks/language/forth/hist4th/histo002.htm   (2072 words)

  
 New Micros, Inc - Keypads
Whether subroutine-threaded code or direct- or indirect-threaded code is faster is determined by the particular architecture of the processor.
Even when subroutine-threaded code is slower than other threadings, there are optimizations that can speed it up which are available only to it, such as converting the last call of a colon definition to a jump, eliminating a return.
Authors of a variety of Forths, including subroutine threaded, patiently tried to explain why your ideas might fail, giving specific examples which you seemed to ignore.
www.newmicros.com /discussion/printthread.php?t=17   (740 words)

  
 FIG-FORTH Internals
ITC allows all defined words to be revectored to new definitions.
A machine code routine named NEXT is the part of the inner interpreter that executes the next FORTH word.
Code words are directly executed by the host processor.
www.jimbrooks.org /web/forth/forthInternals.php   (2448 words)

  
 Re: Ladder parser or compiler
It is a *very* fast threaded code interpreter implemented in gcc (note that I did not say Ansi C because it depends on some gcc-specific features for its speed).
Upgrading to gforth style indirect threaded code (direct threaded loses on iX86) will probably gain a factor 2-4+ but be more work and less portable.
In summary, I think that Hugh's code could be a big step forward, but that the execution engine portion should be broken off, simplified and sped up.
www.control.com /955385059/index_html   (735 words)

  
 Python and Indirect Threading   (Site not responding. Last check: 2007-11-01)
Direct threading is the fastest way to dispatch the control flow in an interpreter inner-most loop (the inner interpreter).
For a short overview on threaded code (what is it, how to write it, what are the speed versus portability tradeoffs, sample benchmarks and some bibliography) see
The indirect threading version of the macros are used (and the inclusion of
starship.python.net /crew/vlad/cevalc/threaded_code   (283 words)

  
 kForth Technical Information   (Site not responding. Last check: 2007-11-01)
Upon execution, the vector of byte codes is passed on to a virtual machine which looks up the execution address of the words and performs either a call or an indirect jump to the next execution address.
The type of threading used in the virtual machine is a hybrid of indirect call threading and indirect jump threading.
The source code is made available to users under the GNU General Public License.
ccreweb.org /software/kforth/kforth5.html   (1736 words)

  
 Forth Programmers Handbook   (Site not responding. Last check: 2007-11-01)
To avoid problems and to maximize the transportability of code, the names of the words provided in a standard system are defined in all upper-case letters and should always be referred to in all upper-case letters when using them in subsequent definitions.
The code field, pointing to the run-time code for a definition, causes different behaviors depending on the type of word being defined.
The code field of the executing word contains a pointer to machine code for an address interpreter, which sequentially executes those definitions by performing indirect jumps through register I, which is used to keep its place.
www.forth.com /forth/fph-1-1.html   (3727 words)

  
 Forth: An underview
This is assuming that we are using the popular indirect threaded code system and not one of the native code generating compilers.
The last field of the definition's head is a pointer to the code to be executed by the function, the address of this field in known as the "code field address" or "cfa".
The "code pointer" is the cfa of the first instruction to be executed for the word, this forms the first entry in the body of the definition.
burks.bton.ac.uk /burks/language/forth/undervu/forth.htm   (6451 words)

  
 The Evolution of Forth
It is often slower than direct-threaded code, but it is an enabling technique to allow the progression to native code generation.
A variant of native code generation, these were invented for the Forth processors (discussed in Section 1.5) that can execute several Forth primitives in a single cycle.
Token threading was used in a version of Forth for a Panasonic hand-held computer developed in the early 1980's, for example, and is a key element in MacForth.
www.forth.com /resources/evolution/evolve_5.html   (1723 words)

  
 Optimization Considerations (Life in the FastForth Lane)
The code to be copied (and hence the length of the word for copying purposes) must exclude the return instruction at the end.
With indirect threading, all references to words in the array were the same length.
Properly done, conversion of a 68000 32-bit Forth from indirect threaded code to subroutine threaded code will be rewarding in both speed improvements and in application and nucleus size improvements.
www.forth.org /fd/curley2.html   (4128 words)

  
 Moving Forth: Part 1
All the other threading schemes are "improvements" on this, so you need to understand ITC to appreciate the others.
The principal disadvantage of segment threading is the 16-byte "granularity" of the memory space.
In ITC you must be able to jump indirect using X. X may also be used by a few CODE words to do arithmetic and such.
www.zetetics.com /bj/papers/moving1.htm   (4648 words)

  
 Cliff Hacks Things.
Basically, this code constructs a pipeline of producers and consumers, each of which does some processing or conversion of the data.
It's typed as a Block, which is a standard Mongoose class describing a block of code (as in Smalltalk).
The code in ProducerSupport will run within the class that includes it, so we've eliminated the concept of "owner" and the accompanying code — now, the ProducerSupport is the owner, and vice versa.
cliffhacks.blogspot.com   (4034 words)

  
 [No title]   (Site not responding. Last check: 2007-11-01)
The indirect threaded Forth engine is completely machine-independent, direct threading requires a few machine-specific lines for each machine.
However, OS threads tend to be expensive, so this choice can limit the performance and scalability of the concurrent language.
The main contribution of this paper is a language design that provides a neat solution to this problem, allowing the implementor of the language enough flexibility to provide cheap lightweight threads, while still providing the programmer with control over the mapping between internal threads and external threads where necessary.
www.eecs.harvard.edu /~mainland/doclib/doclib.py?allbibtex=1   (1778 words)

  
 Ladder parser or compiler   (Site not responding. Last check: 2007-11-01)
Both or one of these examples is hard to code in most PLC:s IL without parantheses, this is heavily depending on the definition of the IL language however.
Upon opening your source code in an editor, and seeing it was written in C++, I was filled with despair as I began counting down the time until it would be rejected __here__ on this list...
I started to code the thing all by myself, but I thought and still think it would be better and mean a lot more if it were a community project.
www.control.com /955227774/index_html   (6801 words)

  
 [No title]   (Site not responding. Last check: 2007-11-01)
Focus is on compiling to either high- or low-level intermediate code, rather than interpretation of source text a la Bourne shell or compilation to assembly or machine code.
One branch per iteration, and it's possible to move code outside the loop without paying extra in the case where the loop is iterated zero times.
The code generator forgoes case analysis and emits naive code that is improved by a retargetable object code optimizer.
www.eecs.harvard.edu /~nr/toolkit/working/prose/cs.bib   (1930 words)

  
 6502.org: Source: Zero-Overhead Forth Interrupt Service
The zero-overhead interrupt support is very simple, adds only about 100 bytes to your overall code, and can be nested-- ie, you can allow a higher-priority interrupt to interrupt the servicing of a lower-priority one-- as many interrupt levels deep as you wish.
If interrupts are enabled, this piece of code will be executed like any other short machine-language ISR as soon as the hardware interrupt-request line goes true and the currently executing machine-language instruction finishes.
Again, this is for an indirect-threaded Forth implementation, which is probably the slowest of four or five methods but yields the most compact code, allows this simple interrupt method, and has some other advantages in interactive code development.
www.6502.org /tutorials/zero_overhead_forth_interrupts.html   (3511 words)

  
 DPANS94
Forth-83 relaxed the implementation restrictions of Forth-79 to allow any kind of threaded code, but it did not fully allow compilation to native machine code (this was not specifically prohibited, but rather was an indirect consequence of another provision).
With traditional threaded code implementations, the choice was generally quite clear (with the single exception of the word LEAVE), and the standard could specify which words should be immediate.
In the context of ANS Forth, which permits other implementation techniques in addition to threaded code, it is very difficult, if not impossible, to describe the behavior of the traditional COMPILE.
www.cs.wisc.edu /~bolo/forth/dpans/dpansd.htm   (4838 words)

  
 FORTH-83 STANDARD - EXPERIMENTAL PROPOSAL
FORTH users are encouraged to study, implement, and try these proposals to aid in the analysis of and the decision for or against future adoption into the Standard.
Readers are cautioned that these proposals contain opinions and conclusions of the authors of the proposals and that these proposals may contain non-standard source code.
This code assumes a FORTH system which uses indirect threaded code, heads contiguous to bodies, and a definition structure of the following format: Name field, 4 bytes long, fixed length.
forth.sourceforge.net /std/fst83/fst83-c.htm   (1286 words)

  
 Chuck Moore: The Invention of Forth
The code field was an important innovation, since an indirect jump was the only overhead, once a word had been found.
I had coded a report generator in Forth and was confident I could code order-entry.
It was a natural development from my work at Mohasco, though I later heard that DEC had used direct-threaded code in one of their compilers.
colorforth.com /HOPL.html   (3692 words)

  
 1.2 A Brief History of SETL
It included many of the now familiar techniques such as redundant code elimination and strength reduction, dealt extensively with graphs of control flow and their partitioning into ``intervals'', and showed how to split nodes in an irreducible flow graph to obtain a reducible one.
In the fall of that year, there was some talk of a unified language definition and implementation, but this was prevented by the fact that Snyder did not want to permit access to his system's source code, and by the fact that we both considered SETL and SETL2 to be works in progress.
The worst collision was that some ambiguities in the syntax of loop headers were a little awkward to resolve, but this only led to some minor patchwork in the compiler and scarcely incommoded the SETL programmer.
cs1.cs.nyu.edu /bacon/phd-thesis/diss/node7.html   (4064 words)

  
 91.540 Topics in Programming Languages and Compilers
Robert B. Dewar "Indirect threaded code" CACM 1975
In class: examples of of various threaded code styles from A. Ertl's thesis.
An interpreter that can loop or use threaded code depending on setting in.h file: O'Caml interpreter documentation.
www.cs.uml.edu /~dimock/courses/540-S2004/readings.html   (1447 words)

Try your search on: Qwika (all wikis)

Factbites
  About us   |   Why use us?   |   Reviews   |   Press   |   Contact us  
Copyright © 2005-2007 www.factbites.com Usage implies agreement with terms.