Claims
- 1. A computer system, comprising:
a processor configured with read/write register locations and configured to execute a computer program; a system memory coupled to said processor; a run-time program optimizer loaded into the memory configured to create and execute an alternate representation of the computer program; and at least one input/output device coupled to at least one processor; wherein the optimizer is debugged by a debugger that compares the outputs of the optimizer versus the outputs of the processor.
- 2. The computer system of claim 1 wherein:
the alternate representation of the computer program is an intermediate representation or a translation of a hot path within the computer program; wherein the debugger completes a verification process that compares the output of the alternate representation of the computer program with the output of the original hot path.
- 3. The computer system of claim 2 further comprising:
an interpreter within the optimizer that computes the results of the alternate representation.
- 4. The computer system of claim 3 further comprising:
pseudo-registers configured to hold copies of the contents of the processor registers; and a memory buffer configured to hold updated copies of system memory blocks; wherein the pseudo-registers and pseudo-memories are used to store data changes as instructed during execution of the alternate representation.
- 5. The computer system of claim 4 wherein:
the debugger compares the contents of the pseudo-registers to the contents of the processor registers and wherein if the contents are the same, the alternate representation is classified as being as correct as the original code to which the alternate representation is compared.
- 6. The computer system of claim 4 wherein:
the debugger compares the contents of the memory buffer to the contents of the processor memory and wherein if the contents are the same, the alternate representation is classified as being as correct as the original code to which the alternate representation is compared.
- 7. A method of debugging a dynamic program optimizer, comprising:
creating a plurality of copies of the contents of the registers in a computer processor; loading a first copy of the register contents to pseudo-registers; loading a test sequence comprising an intermediate representation of a program hot path in a software buffer; executing instructions in the test sequence and fulfilling register read and write commands with the pseudo-registers; loading a second copy of the register contents to the processor registers; executing instructions in the program hot path and fulfilling register read and write commands with the processor registers; and checking contents of the registers and pseudo-registers; wherein if the register contents match, the test sequence is valid and wherein if the register contents do not match, the test sequence is invalid.
- 8. The method of claim 7 wherein:
the test sequence comprises a translated copy of the program hot path.
- 9. The method of claim 8 wherein:
the program hot path comprises an intermediate representation of a program hot path trace.
- 10. The method of claim 7 further comprising:
executing instructions in the test sequence and;
fulfilling memory write commands to a memory buffer; fulfilling memory read commands from the memory buffer if the requested memory exists in the memory buffer; fulfilling memory read commands from system memory if the requested memory does not exist in memory buffer; executing instructions in the program hot path and fulfilling memory read and write commands with system memory; and checking contents of the memory and memory buffer; wherein if the memory contents match, the test sequence is valid and wherein if the memory contents do not match, the test sequence is invalid.
- 11. The method of claim 7 further comprising:
debugging the intermediate representation before the optimizer analyzes the interpreter output to translate the hot path.
- 12. The method of claim 8 further comprising:
debugging the translated copy before the optimizer overwrites program hot path with the translated copy.
- 13. The method of claim 7 further comprising:
storing the starting and stopping decision points in the program hot path.
- 14. The method of claim 13 further comprising:
creating bailout points in the test sequence corresponding to decision points in the original program and using the same start and stop points for the test sequence as for the program hot path.
- 15. A computer program optimizer debugger, comprising:
read/write access to registers in a computer system processor; read/write access to computer system memory; a temporary memory location in the computer system memory; a temporary register location in the computer system memory; and wherein the debugger is configured to make duplicate copies of the contents of the registers of the computer processor and wherein one copy of the register contents is placed in the temporary register location; and wherein after a program optimizer creates an intermediate representation of a portion of a computer program, the debugger performs a test execution of the instructions in the intermediate representation using data in the temporary register and temporary memory locations and verifies that the contents of the temporary register match the contents of the processor registers and that the temporary memory location matches the contents of the system memory after a verification execution of the original portion of the computer program by the computer system.
- 16. The system of claim 15 wherein:
during the test execution, the debugger reads and writes exclusively to the temporary register location, writes exclusively to the temporary memory location and reads from the temporary memory location or from the system memory location if the requested data does not exist in the temporary memory location.
- 17. The system of claim 16 wherein:
during the verification execution, the computer system reads and writes exclusively to the processor register location and reads and writes exclusively to the system memory.
- 18. The system of claim 15 wherein:
the intermediate representation is an interpretable alternative representation of a hot path in a program image.
- 19. The system of claim 15 further comprising:
the intermediate representation is a translated copy containing machine instructions of a hot path in a program image.
- 20. The system of claim 15 wherein:
if debugger verification shows that the contents of the temporary register location do not match the contents of the processor registers or that the temporary memory location does not match the contents of the system memory, the debugger reports an error.
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This application claims priority to the following commonly assigned provisional application entitled:
[0002] “A Dynamic Optimization and Specialization Tool,” Serial No. 60/212,223, filed Jun. 16, 2000, which is hereby incorporated by reference herein.
Provisional Applications (1)
|
Number |
Date |
Country |
|
60212223 |
Jun 2000 |
US |