Search Images Maps Play YouTube News Gmail Drive More »
Advanced Patent Search | Web History | Sign in

Patents

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...

InventorJames Gosling
Original AssigneeSun Microsystems, Inc.
Primary Examiner: Thomas M. Heckler
Attorney: Finnegan, Henderson, Farabow, Garrett & Dunner, L.L.P.
Current U.S. Classification717/140; 717/106; 717/136; 717/139; 717/142; 717/146
International Classification: G06F/945

View patent at USPTO
Search USPTO Assignment Database

Citations

Cited PatentFiling dateIssue dateOriginal AssigneeTitle
US4636940Dec 20, 1985Jan 13, 1987Hewlett-Packard CompanyLogic analyzer using source program or other user defined symbols in the trace specification and the trace listing
US4667290Sep 10, 1984May 19, 1987501 Philon, Inc.Compilers using a universal intermediate language
US4667920Oct 15, 1985May 26, 1987Daimler-Benz AktiengesellschaftElastic support arrangement for a vehicle fuel pump or the like
US4686623Jun 7, 1985Aug 11, 1987International Business Machines CorporationParser-based attribute analysis
US4729096Oct 24, 1984Mar 1, 1988International Business Machines CorporationMethod and apparatus for generating a translator program for a compiler/interpreter and for testing the resulting translator program
US4773007Feb 17, 1987Sep 20, 1988Hitachi, Ltd.Complier code optimization method for a source program having a first and second array definition and use statements in a loop
US5201050Jun 30, 1989Apr 6, 1993Digital Equipment CorporationLine-skip compiler for source-code development system
US5230050Feb 5, 1990Jul 20, 1993Hitachi, Ltd.Method of recompiling a program by using result of previous compilation
US5276881Jun 25, 1990Jan 4, 1994Hewlett-Packard CompanyANDF producer using the HPcode-Plus compiler intermediate language
US5280613Jun 25, 1990Jan 18, 1994Hewlett-Packard CompanyANDF installer using the HPcode-Plus compiler intermediate language
US5307492Mar 7, 1991Apr 26, 1994Digital Equipment CorporationMapping assembly language argument list references in translating code for different machine architectures
US5313614Dec 6, 1988May 17, 1994AT&T Bell LaboratoriesMethod and apparatus for direct conversion of programs in object code form between different hardware architecture computer systems
US5339419Jun 25, 1990Aug 16, 1994Hewlett-Packard CompanyANDF compiler using the HPcode-plus compiler intermediate language
US5347632Jul 28, 1989Sep 13, 1994Prodigy Services CompanyReception system for an interactive computer network and method of operation
US5428792Oct 26, 1994Jun 27, 1995International Business Machines CorporationSystem for producing language neutral objects and generating an interface between the objects and multiple computer languages
US5442771Nov 26, 1993Aug 15, 1995Prodigy Services CompanyMethod for storing data in an interactive computer network
US5594910Nov 26, 1993Jan 14, 1997IBM Corp.Interactive computer network and method of operation
US5613117Apr 20, 1994Mar 18, 1997Digital Equipment CorporationOptimizing 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
US5649204Aug 22, 1991Jul 15, 1997REC Software, Inc.Method and apparatus for consolidating software module linkage information used for starting a multi-module program
US5758072Oct 23, 1996May 26, 1998International Business Machines Corp.Interactive computer network and method of operation
US5836014May 16, 1994Nov 10, 1998Digital Equipment CorporationMethod of constructing a constant-folding mechanism in a multilanguage optimizing compiler

Referenced by

Citing PatentFiling dateIssue dateOriginal AssigneeTitle
US6785683Jul 6, 2000Aug 31, 2004International Business Machines CorporationCategorization and presentation tool for code resources
US7483757Jul 22, 2005Jan 27, 2009Honeywell International, Inc.Control system migration
US7840952Jan 25, 2006Nov 23, 2010Micron Technology, Inc.Method and system for generating object code to facilitate predictive memory retrieval

Claims

1. 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.