Copyright © 2004 Southern Storm Software, Pty Ltd
|[ << ]||[ < ]||[ Up ]||[ > ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
|1 Introduction and rationale for libjit|
|2 Features of libjit|
|3 Tutorials in using libjit|
|4 Initializing the JIT|
|5 Building and compiling functions with the JIT|
|6 Manipulating system types|
|7 Working with temporary values in the JIT|
|8 Working with instructions in the JIT|
|9 Working with basic blocks in the JIT|
|10 Intrinsic functions available to libjit users|
|11 Handling exceptions|
|12 Hooking a breakpoint debugger into libjit|
|13 Manipulating ELF binaries|
|14 Miscellaneous utility routines|
|15 Diagnostic routines|
|16 Using libjit from C++|
|20 Porting libjit to new architectures|
|Index of concepts and facilities|
Just-In-Time compilers are becoming increasingly popular for executing dynamic languages like Perl and Python and for semi-dynamic languages like Java and C#. Studies have shown that JIT techniques can get close to, and sometimes exceed, the performance of statically-compiled native code.
However, there is a problem with current JIT approaches. In almost every case, the JIT is specific to the object model, runtime support library, garbage collector, or bytecode peculiarities of a particular system. This inevitably leads to duplication of effort, where all of the good JIT work that has gone into one virtual machine cannot be reused in another.
JIT’s are not only useful for implementing languages. They can also be used in other programming fields. Graphical applications can achieve greater performance if they can compile a special-purpose rendering routine on the fly, customized to the rendering task at hand, rather than using static routines. Needless to say, such applications have no need for object models, garbage collectors, or huge runtime class libraries.
Most of the work on a JIT is concerned with arithmetic, numeric type conversion, memory loads/stores, looping, performing data flow analysis, assigning registers, and generating the executable machine code. Only a very small proportion of the work is concerned with language specifics.
The goal of the
libjit project is to provide an extensive set of
routines that takes care of the bulk of the JIT process, without tying the
programmer down with language specifics. Where we provide support for
common object models, we do so strictly in add-on libraries,
not as part of the core code.
Unlike other systems such as the JVM, .NET, and Parrot,
is not a virtual machine in its own right. It is the foundation upon which a
number of different virtual machines, dynamic scripting languages,
or customized rendering routines can be built.
The LLVM project (http://www.llvm.org/) has some similar
libjit in that its intermediate format is
generic across front-end languages. It is written in C++ and provides
a large set of compiler development and optimization components;
much larger than
libjit itself provides. According to its author,
Chris Lattner, a subset of its capabilities can be used to build JIT’s.
Libjit should free developers to think about the design of their front ends, and not get bogged down in the details of code execution. Meanwhile, experts in the design and implementation of JIT’s can concentrate on solving code execution problems, instead of front end support issues.
This document describes how to use the library in application programs.
We start with a list of features and some simple tutorials. Finally,
we provide a complete reference guide for all of the API functions in
libjit, broken down by function category.
|[ << ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
This document was generated on April 29, 2015 using texi2html 5.0.