A hybrid compiler-interpreter comprising a compiler for "compiling" source program code, and an interpreter for interpreting the "compiled" code, is provided to a computer system. The compiler comprises a code generator that generates code in intermediate form with data references made on a symbolic basis. The interpreter comprises a main interpretation routine, and two data reference handling routines, a dynamic field reference routine for handling symbolic references, and a static field reference routine for handling numeric references. The dynamic field reference routine, when invoked, resolves a symbolic reference and rewrites the symbolic reference into a numeric reference. After re-writing, the dynamic field reference routine returns to the main interpretation routine without advancing program execution to the next instruction, thereby allowing the rewritten instruction with numeric reference to be reexecuted. The static field reference routine, when invoked, obtain data for... |
Citations|
| US4636940 | Dec 20, 1985 | Jan 13, 1987 | Hewlett-Packard Company | Logic analyzer using source program or other user defined symbols in the trace specification and the trace listing | | US4667290 | Sep 10, 1984 | May 19, 1987 | 501 Philon, Inc. | Compilers using a universal intermediate language | | US4667920 | Oct 15, 1985 | May 26, 1987 | Daimler-Benz Aktiengesellschaft | Elastic support arrangement for a vehicle fuel pump or the like | | US4686623 | Jun 7, 1985 | Aug 11, 1987 | International Business Machines Corporation | Parser-based attribute analysis | | US4729096 | Oct 24, 1984 | Mar 1, 1988 | International Business Machines Corporation | Method and apparatus for generating a translator program for a compiler/interpreter and for testing the resulting translator program | | US4773007 | Feb 17, 1987 | Sep 20, 1988 | Hitachi, Ltd. | Complier code optimization method for a source program having a first and second array definition and use statements in a loop | | US5201050 | Jun 30, 1989 | Apr 6, 1993 | Digital Equipment Corporation | Line-skip compiler for source-code development system | | US5230050 | Feb 5, 1990 | Jul 20, 1993 | Hitachi, Ltd. | Method of recompiling a program by using result of previous compilation | | US5276881 | Jun 25, 1990 | Jan 4, 1994 | Hewlett-Packard Company | ANDF producer using the HPcode-Plus compiler intermediate language | | US5280613 | Jun 25, 1990 | Jan 18, 1994 | Hewlett-Packard Company | ANDF installer using the HPcode-Plus compiler intermediate language | | US5307492 | Mar 7, 1991 | Apr 26, 1994 | Digital Equipment Corporation | Mapping assembly language argument list references in translating code for different machine architectures | | US5313614 | Dec 6, 1988 | May 17, 1994 | AT&T Bell Laboratories | Method and apparatus for direct conversion of programs in object code form between different hardware architecture computer systems | | US5339419 | Jun 25, 1990 | Aug 16, 1994 | Hewlett-Packard Company | ANDF compiler using the HPcode-plus compiler intermediate language | | US5347632 | Jul 28, 1989 | Sep 13, 1994 | Prodigy Services Company | Reception system for an interactive computer network and method of operation | | US5428792 | Oct 26, 1994 | Jun 27, 1995 | International Business Machines Corporation | System for producing language neutral objects and generating an interface between the objects and multiple computer languages | | US5442771 | Nov 26, 1993 | Aug 15, 1995 | Prodigy Services Company | Method for storing data in an interactive computer network | | US5594910 | Nov 26, 1993 | Jan 14, 1997 | IBM Corp. | Interactive computer network and method of operation | | US5613117 | Apr 20, 1994 | Mar 18, 1997 | Digital Equipment Corporation | Optimizing compiler using templates corresponding to portions of an intermediate language graph to determine an order of evaluation and to allocate lifetimes to temporary names for variables | | US5649204 | Aug 22, 1991 | Jul 15, 1997 | REC Software, Inc. | Method and apparatus for consolidating software module linkage information used for starting a multi-module program | | US5758072 | Oct 23, 1996 | May 26, 1998 | International Business Machines Corp. | Interactive computer network and method of operation | | US5836014 | May 16, 1994 | Nov 10, 1998 | Digital Equipment Corporation | Method of constructing a constant-folding mechanism in a multilanguage optimizing compiler |
Referenced by|
| US6785683 | Jul 6, 2000 | Aug 31, 2004 | International Business Machines Corporation | Categorization and presentation tool for code resources | | US7483757 | Jul 22, 2005 | Jan 27, 2009 | Honeywell International, Inc. | Control system migration | | US7840952 | Jan 25, 2006 | Nov 23, 2010 | Micron Technology, Inc. | Method and system for generating object code to facilitate predictive memory retrieval |
Claims1. In a computer system comprising a program in source code form, a method for generating executable code for said program and resolving data references in said generated code, said method comprising the steps of: - a) generating executable code in intermediate form for said program in source code form with data references being made in said generated code on a symbolic basis, said generated code comprising a plurality of instructions of said computer system;
- b) interpreting said instructions, one at a time, in accordance to a program execution control;
- c) resolving said symbolic references to corresponding numeric references, replacing said symbolic references with their corresponding numeric references, and continuing interpretation without advancing program execution, as said symbolic references are encountered while said instructions are being interpreted; and
- d) obtaining data in accordance to said numeric references, and continuing interpretation after advancing program execution, as said numeric references are encountered while said instruction are being interpreted;
- said steps b) through d) being performed iteratively and interleaving.
2. The method as set forth in claim 1, wherein, said program in source code form is implemented in source code form of an object oriented programming language. 3. The method as set forth in claim 2, wherein said programming language is C. 4. The method as set forth in claim 2, wherein, said programming language is C. 5. The method as set forth in claim 1, wherein, said program execution control is a program counter said continuing interpretation in step c) is achieved by performing said step b) after said c) without incrementing said program counter; and - said continuing interpretation in said step d) is achieved by performing said step b) after said d) after incrementing said program counter.
6. In a computer system comprising a program in source code form, an apparatus for generating executable code for said program and resolving data references in said generated code, said apparatus comprising: - a) compilation means for receiving said program in source code form and generating executable code in intermediate form for said program in source code form with data references being made in said generated code on a symbolic basis, said generated code comprising a plurality of instructions of said computer system;
- b) interpretation means for receiving said generated code and interpreting said instructions, one at a time;
- c) dynamic reference handling means coupled to said interpretation means for resolving said symbolic references to corresponding numeric references, replacing said symbolic references with their corresponding numeric references, and continuing interpretation by said interpretation means without advancing program execution, as said symbolic references are encountered while said instructions are being interpreted by said interpretation means; and
- d) static reference handling means coupled to said interpretation means for obtaining data in accordance to said numeric references, and continuing interpretation by said interpretation means after advancing program execution, as said numeric references are encountered while said instruction are being interpreted by said interpretation means;
- said interpretation means, said dynamic reference handling means, and said static reference handling means performing their corresponding functions iteratively and interleavingly.
7. The apparatus as set forth in claim 6, wherein, said program in source code form is implemented in source code form of an object oriented programming language. 8. The apparatus as set forth in claim 7, wherein, said programming language is C. 9. The apparatus as set forth in claim 7, wherein, said programming language is C. 10. The apparatus as set forth in claim 6, wherein, and program execution control is a program counter. 11. An apparatus comprising: - a memory containing intermediate form object code constituted by a set of instructions, certain of said instructions containing one or more symbolic references; and
- a processor configured to execute said instructions containing one or more symbolic references by determining a numerical reference corresponding to said symbolic reference, storing said numerical references, and obtaining data in accordance to said numerical references.
12. A computer-readable medium containing instructions for controlling a data processing system to perform a method for interpreting intermediate form object code comprised of instructions, certain of said instructions containing one or more symbolic references, said method comprising the steps of: - interpreting said instructions in accordance with a program execution control; and
- resolving a symbolic reference in an instruction being interpreted, said step of resolving said symbolic reference including the substeps of:
- determining a numerical reference corresponding to said symbolic reference, and
- storing said numerical reference in a memory.
13. A computer-implemented method for executing instructions, certain of said instructions containing one or more symbolic references, said method comprising the steps of: - resolving a symbolic reference in an instruction, said step of resolving said symbolic reference including the substeps of:
- determining a numerical reference corresponding to said symbolic reference, and
- storing said numerical reference in a memory.
14. The method of claim 3, wherein said substep of storing said numerical reference comprises the substep of replacing said symbolic reference with said numerical reference. 15. The method of claim 3, wherein said step of resolving said symbolic reference further comprises the substep of executing said instruction containing said symbolic reference using the stored numerical reference. 16. The method of claim 3, wherein said step of resolving said symbolic reference further comprises the substep of advancing program execution control after said substep of executing said instruction containing said symbolic reference. 17. In a computer system comprising a program, a method for executing said program comprising the steps of: - receiving intermediate form object code for said program with symbolic data references in certain instructions of said intermediate form object code; and
- converting the instructions of the intermediate form object code having symbolic data references, said converting step comprising the substeps of:
- resolving said symbolic references to corresponding numerical references,
- storing said numerical references, and
- obtaining data in accordance to said numerical references.
18. A computer-implemented method for executing program operations, each operation being comprised of a set of instructions, certain of said instructions containing one or more symbolic references, said method comprising the steps of: - receiving a set of instructions reflecting an operation; and
- performing the operation corresponding to the received set of instructions, wherein at least one of said symbolic references is resolved by determining a numerical reference corresponding to said symbolic reference, storing said numerical reference, and obtaining data in accordance to said stored numerical reference.
19. A memory for use in executing a program by a processor, the memory comprising: - intermediate form code containing symbolic field references associated with an intermediate representation of source code for the program,
- the intermediate representation having been generated by lexically analyzing the source code and parsing output of said lexical analysis, and
- wherein the symbolic field references are resolved by determining a numerical reference corresponding to said symbolic reference, and storing said numerical reference in a memory.
20. A computer-implemented method comprising: - receiving a program that comprises a set instructions written in an intermediate form code;
- replacing each instruction in the program with a symbolic data reference with a new instruction containing a numeric reference resulting from invocation of a dynamic field reference routine to resolve the symbolic data reference; and
- executing the program by performing an operation in accordance with each instruction or new instruction, depending upon whether an instruction has been replaced with a new instruction in accordance with the replacing step.
21. A data processing system, comprising: - a processor; and
- a memory comprising a control program for causing the processor to (i) receive a program that comprises a set instructions written in an intermediate form code, (ii) replace each instruction in the program with a symbolic data reference with a new instruction containing a numeric reference resulting from invocation of a dynamic field reference routine to resolve the symbolic data reference, and (iii) execute the program by performing an operation in accordance with each instruction or new instruction, depending upon whether an instruction has been replaced with a new instruction in accordance with the replacing step.
22. An apparatus comprising: - a memory containing a compiled program in intermediate form object code constituted by a set of instructions, at least one of the instructions containing a symbolic reference; and
- a processor configured to execute the instruction by determining a numerical reference corresponding to the symbolic reference, and performing an operation in accordance with the instruction and data obtained in accordance with the numerical reference without recompiling the program or any portion thereof.
23. A computer-implemented method, comprising: - receiving a program with a set instructions written in an intermediate form code;
- analyzing each instruction of the program to determine whether the instruction contains a symbolic reference to a data object; and
- executing the program, wherein when it was determined that an instruction contains a symbolic reference, data from a storage location identified by a numeric reference correspoding to the symbolic reference is used thereafter to perform an operation corresponding to that instruction.
24. A computer-implemented method for executing a program comprised of bytecodes, the method comprising: - determining immediately prior to execution whether a bytecode of the program contains a symbolic data reference;
- when it is determined that the bytecode of the program contains a symbolic data reference, invoking a dynamic field reference routine to resolve the symbolic data reference; and
- executing thereafter the bytecode using stored data located using a numeric reference resulting from the resolution of the symbolic reference.
25. A data processing system, comprising: - a processor; and
- a memory comprising a program comprised of bytecodes and instructions for causing the processor to (i) determine immediately prior to execution of the program whether a bytecode of the program contains a symbolic data reference, (ii) when it is determined that the bytecode of the program contains a symbolic data reference, invoke a dynamic field reference routine to resolve the symbolic data reference, and (iii) execute thereafter the bytecode using stored data located using a numeric reference resulting from the resolution of the symbolic reference.
26. A computer program product containing instructions for causing a computer to perform a method for executing a program comprised of bytecodes, the method comprising: - determining immediately prior to execution whether a bytecode of the program contains a symbolic data reference;
- when it is determined that the bytecode of the program contains a symbolic data reference, invoking a dynamic field reference routine to resolve the symbolic data reference; and
- executing thereafter the bytecode using stored data located using a numeric reference resulting from the resolution of the symbolic reference.
27. A computer-implemented method comprising: - receiving a program with a set of original instructions written in an intermediate form code;
- generating a set of new instructions for the program that contain numeric references resulting from invocation of a routine to resolve any symbolic data references in the set of original instructions; and
- executing the program using the set of new instructions.
28. A data processing system, comprising: - a processor; and
- a memory comprising a control program for causing the processor to (i) receive a program with a set of original instructions written in an intermediate form code, (ii) generate a set of new instructions for the program that contain numeric references resulting from invocation of a routine to resolve any symbolic data references in the set of original instructions, and (iii) executing the program using the set of new instructions.
29. A computer program product containing instructions for causing a computer to perform a method, the method comprising: - receiving a program with a set of original instructions written in an intermediate form code;
- generating a set of new instructions for the program that contain numeric references resulting from invocation of a routine to resolve any symbolic data references in the set of original instructions; and
- executing the program using the set of new instructions.
30. A computer-implemented method comprising: - receiving a program that comprises a set instructions written in an intermediate form code;
- replacing each instruction in the program with a symbolic data reference with a new instruction containing a numeric reference resulting from invocation of a dynamic field reference routine to resolve the symbolic data reference; and
- executing the program by performing an operation in accordance with each instruction or new instruction, depending upon whether an instruction has been replaced with a new instruction in accordance with the replacing step.
31. A data processing system, comprising: - a processor; and
- a memory comprising a control program for causing the processor to (i) receive a program that comprises a set instructions written in an intermediate form code, (ii) replace each instruction in the program with a symbolic data reference with a new instruction containing a numeric reference resulting from invocation of a dynamic field reference routing to resolve the symbolic data reference, and (iii) execute the program by performing an operation in accordance with each instruction or new instruction, depending upon whether an instruction has been replaced with a new instruction in accordance with the replacing step.
32. A computer program product containing control instructions for causing a computer to perform a method, the method comprising: - receiving a program that comprises a set instructions written in an intermediate form code;
- replacing each instruction in the program with a symbolic data reference with a new instruction containing a numeric reference resulting from invocation of a dynamic field reference routine to resolve the symbolic data reference; and
- executing the program by performing an operation in accordance with each instruction or new instruction, depending upon whether an instruction has been replaced with a new instruction in accordance with the replacing step.
33. A computer-implemented method, comprising: - receiving a program with a set instructions written in an intermediate form code;
- analyzing each instruction of the program to determine whether the instruction contains a symbolic reference to a data object; and
- executing the program, wherein when it was determined that an instruction contains a symbolic reference, data from a storage location identified by a numeric reference corresponding to the symbolic reference is used thereafter to perform an operation corresponding to that instruction.
34. A data processing system, comprising: - a processor; and
- a memory comprising a control program for causing the processor to (i) receive a program with a set instructions written in an intermediate form code, (ii) analyze each instruction of the program to determine whether the instruction contains a symbolic reference to a data object, and (iii) execute the program, wherein when it was determined that an instruction contains a symbolic reference, data from a storage location identified by a numeric reference corresponding to the symbolic reference is used thereafter to perform an operation corresponding to that instruction.
35. A computer program product containing control instructions for causing a computer to perform a method, the method comprising: - receiving a program with a set instructions written in an intermediate form code;
- analyzing each instruction of the program to determine whether the instruction contains a symbolic reference to a data object; and
- executing the program, wherein when it was determined that an instruction contains a symbolic reference, data from a storage location identified by a numeric reference corresponding to the symbolic reference is used thereafter to perform an operation corresponding to that instruction.
36. A computer-implemented method for executing a program comprised of bytecodes, the method comprising: - determining whether a bytecode of the program contains a symbolic reference;
- when it is determined that the bytecode contains a symbolic reference, invoking a dynamic field reference routine to resolve the symbolic reference; and
- performing an operation identified by the bytecode thereafter using data from a storage location identified by a numeric reference resulting from the invocation of the dynamic field reference routine.
37. A data processing system, comprising: - a processor; and
- a memory comprising a program comprised of bytecodes and instructions for causing the processor to (i) determine whether a bytecode of the program contains a symbolic reference, (ii) when it is determined that the bytecode contains a symbolic reference, invoke a dynamic field reference routine to resolve the symbolic reference, and (iii) perform an operation identified by the bytecode thereafter using data from a storage location identified by a numeric reference resulting from the invocation of the dynamic field reference routine.
38. A computer program product containing instructions for causing a computer to perform a method for executing a program comprised of bytecodes, the method comprising: - determining whether a bytecode of the program contains a symbolic reference;
- when it is determined that the bytecode contains a symbolic reference, invoking a dynamic field reference routine to resolve the symbolic reference; and
- performing an operation identified by the bytecode therafter using data from a storage location identified by a numeric reference resulting from the invocation of the dynamic field reference routine.
39. A computer-implemented method comprising: - receiving a program formed of instructions written in an intermediate form code compiled from source code;
- analyzing each instruction to determine whether it contains a symbolic field reference; and
- executing the program by performing an operation identified by each instruction, wherein data from a storage location identified by a numeric reference is thereafter used for the operation when the instruction contains a symbolic field reference, the numeric reference having been resolved from the symbolic field reference.
40. A data processing system, comprising: - a processor; and
- a memory comprising a control program for causing the processor to (i) receive a program formed of instructions written in an intermediate form code compiled from source code, (ii) analyze each instruction to determine whether it contains a symbolic field reference, and (iii) execute the program by performing an operation identified by each instruction, wherein data from a storage location identified by a numeric reference is thereafter used for the operation when the instruction contains a symbolic field reference, the numeric reference having been resolved from the symbolic field reference.
41. A computer program product containing control instructions for causing a computer to perform a method, the method comprising: - receiving a program formed of instructions written in an intermediate form code compiled from source code;
- analyzing each instruction to determine whether it contains a symbolic field reference; and
- executing the program by performing an operation identified by each instruction, wherein data from a storage location identified by a numeric reference is used thereafter for the operation when the instruction contains a symbolic field reference, the numeric reference having been resolved from the symbolic field reference.
|