| OCR Text |
Show Besides the information on object files, the interpreter maintains a separate table with the information on global symbols (see Figure 4.4). For each symbol, the information is maintained on its name, type, value and references. The type of a symbol is either hypothetical, host or executable. Hypothetical symbols are symbols in an object file with hypothetical code. Host symbols are symbols in an object file with host code. Executable symbols are symbols in the machine code of the interpreter. The value of the symbol is its address in the executor's state. Files that reference the symbol are enumerated under references. When dslink is called with a file name and a symbol name as parameters, the value of the symbol from this file is taken as the global value. The new value is incorporated in all object files that reference the symbol by patching the corresponding locations. The patching is a straightforward linking procedure, except in the case of mixed references: from hypothetical code to host code or vice versa. The implementation of mixed references is described in the next section. 4.3.2 Mixing of Hypothetical and Host Code The interpreter provides support for mixed references. Mixed references work with object files regardless of their type. They are transparent to the executor and to the director. There are two types of references: references to data and function calls. References to data present no problems, since the Dynascope interpreter and the hardware treat data identically. The layout of data structures by the hypothetical compiler and by the host compiler is the same. The main problem are function calls. If a function call is mixed, the control must be transferred between the software interpreter and the hardware processor. Two types of mixed function calls are from hypothetical code to host code and from host code to hypothetical code. The current implementation of the interpreter 75 |