next up previous contents
Next: Comparison to Traditional Methods Up: Continuous Compilation for Software Previous: Program Modeling

 

Chapter 3
Continuous Compiler Model

The continuous compilation model proposed is shown in Figure 3.1. The Interpreter module is responsible for executing the program while the Compiler module is responsible for translating the source code into a natively executable format. The Interpreter and Compiler modules run concurrently, either physically or logically. Ideally, a dual-processor system would be used, with the Interpreter and Compiler modules running on separate processors; however, this is not a requirement. In Section 6.2 we discuss some of the issues involved in using a continuous compiler model on a dual-processor system as opposed to a traditional compilation model on a faster single processor.

  figure148
Figure 3.1: The Continuous Compiler 

The pieces of this model function as follows:

Code
The Code contains a mixture of interpreted (source) and native-code versions of the procedures of a program. Upon the initial start-up, all of the ``user'' code is assumed to be in source form; library routines are assumed always to be available in native-code format. As the program is executed, the Compiler module generates native-code translations of the interpreted procedures. Not until a procedure has been fully translated to native code does the native-code version become available to the Interpreter.

Compiler
The Compiler module translates the program's procedures from interpreted (source) form to native executable code. As the translation of each procedure is completed, the native-code version is made available to the Interpreter.

Interpreter
The Interpreter module is responsible for the actual execution of the program. It starts by interpreting the source code, making jumps to the native-code version of procedures as they become available. We examined two replacement strategies: replace-at-call will jump to the native code version of a function only at the time that function is called; replace-preemptive will jump to the native code as soon as it becomes available, even while the function is active. Section 3.3 discusses the replacement strategies in more detail.

Monitor
The two modules (the Compiler and the Interpreter) communicate through the Monitor structure. This is a shared data structure that contains information needed by both the Compiler and Interpreter. For example, some of the compilation strategies described in the next section require that the Compiler module have access to profile data about the program being executed. The Interpreter can gather this data while executing the program and then make it available to the Compiler by storing it in the Monitor structure.

While this thesis focuses on the initial transition from source code to native code, it is important to remember that compilation need not end when all of the source code has been translated to native form. The Compiler can continue to perform optimization while the program is executing.




next up previous contents
Next: Comparison to Traditional Methods Up: Continuous Compilation for Software Previous: Program Modeling