Claims
- 1. In a computer system, a method of implementing message dispatch for an object-oriented program, comprising:collecting receiver type information at a site of a method that dispatches messages to receiver objects; saving the receiver type information for a subsequent execution of the program; determining that is would be desirable to compile the method that includes the site that dispatches messages to receiver objects; wherein the receiver type information is collected while the program is being interpreted; and wherein determining that it would be desirable to compile a method includes determining that the method has been invoked more than a predetermined number of times.
- 2. The method of claim 7, wherein the receiver type information includes each different receiver type to which messages were dispatched from the site.
- 3. The method of claim 7, wherein the receiver type information includes references to call sites for each different receiver type to which messages were dispatched from the site.
- 4. The method of claim 7, wherein the receiver type information includes receiver types encountered at call sites of inlined methods.
- 5. The method of claim 1, further comprising compiling the method to include the receiver type information at the site that dispatches messages to receiver objects.
- 6. The method of claim 5, wherein the compiled method continues to collect receiver type information.
- 7. The method of claim 1, wherein the receiver type information is collected in a polymorphic inline cache.
- 8. The method of claim 1, wherein the receiver type information is saved in a class file for the method.
- 9. The method of claim 8, wherein the receiver type information is saved in an attributes section of the class file.
- 10. A computer program product that implements message dispatch for an object-oriented program, comprising:computer code that collects receiver type information at a site of a method that dispatches messages to receiver objects; and computer code that saves the receiver type information for a subsequent execution of the program; a computer readable medium that stores the computer code; computer code that determines whether is would be desirable to compile the method that includes the site that dispatches messages to receiver objects; and wherein the receiver type information is collected while the program is being interpreted, and wherein determining whether it would be desirable to compile a method includes determining that the method has been invoked more than a predetermined number of times.
- 11. A computer system that implements message dispatch for an object-oriented program, comprising:a processor that executes computer code; computer code that collects receiver type information at a site of a method that dispatches messages to receiver objects; and computer code that saves the receiver type information for a subsequent execution of the program; a computer readable medium that stores the computer code for the processor to execute; a computer code that determines whether is would be desirable to compile the method that includes the site that dispatches messages to receiver objects; and wherein the receiver type information is collected while the program is being interpreted, and wherein determining whether it would be desirable to compile a method includes determining that the method has been invoked more than a predetermined number of times.
- 12. In a computer system, a method of implementing message dispatch for an object-oriented program, comprising:during interpretation, collecting receiver type information at a site of a method that dispatches messages to receiver objects, wherein the receiver type information includes each different receiver type and a reference to the site for each different receiver type to which messages were dispatched from the site; determining that it would be desirable to compile the method that includes the site that dispatches messages to receiver objects; compiling the method to include the receiver type information at the site that dispatches messages to receiver objects; saving the receiver type information for a subsequent execution of the program; and wherein determining that it would be desirable to compile a method includes determining that the method has been invoked more than a predetermined number of times.
- 13. The method of claim 12, wherein the receiver type information includes receiver types encountered at call sites of inlined methods.
- 14. The method of claim 12, wherein the compiled method continues to collect receiver type information.
- 15. The method of claim 12, wherein the receiver type information is collected in a polymorphic inline cache.
- 16. The method of claim 12, wherein the receiver type information is saved in a Java class file for the method.
- 17. The method of claim 16, wherein the receiver type information is saved in an attributes section of the Java class file.
- 18. A computer program product that implements message dispatch for an object-oriented program, comprising:computer code that during interpretation, collects receiver type information at a site of a method that dispatches messages to receiver objects, wherein the receiver type information includes each different receiver type and a reference to the site for each different receiver type to which messages were dispatched from the site; computer code that determines that it would be desirable to compile the method that includes the site that dispatches messages to receiver objects; computer code that compiles the method to include the receiver type information at the site that dispatches messages to receiver objects; computer code that saves the receiver type information for a subsequent execution of the program; and a computer readable medium that stores the computer code; and wherein determining whether it would be desirable to compile a method includes determining that the method has been invoked more than a predetermined number of times.
- 19. A computer system that implements message dispatch for an objectoriented program, comprising:a processor that executes computer code; computer code that during interpretation, collects receiver type information at a site of a method that dispatches messages to receiver objects, wherein the receiver type information includes each different receiver type and a reference to the site for each different receiver type to which messages were dispatched from the site; computer code that determines that it would be desirable to compile the method that includes the site that dispatches messages to receiver objects; computer code that compiles the method to include the receiver type information at the site that dispatches messages to receiver objects; and computer code that saves the receiver type information for a subsequent execution of the program; a computer readable medium that stores the computer code for the processor to execute; and wherein determining whether it would be desirable to compile a method includes determining that the method has been invoked more than a predetermined number of times.
CROSS REFERENCE TO RELATED APPLICATIONS
This application is related to U.S. patent application No. 08/944,331, entitled “Site Specific Message Dispatch in Object-Oriented Systems,” U.S. patent application No. 08/1944,735, entitled “Method and Apparatus for Performing Byte-Code Optimization During Pauses,” U.S. patent application No. 08/944,335, entitled “Mixed Execution Stack and Exception Handling,” U.S. patent application No. 08/944,326, entitled “Method and Apparatus for Implementing Multiple Return Sites,” U.S. patent application No. 08/944,334, entitled “Method and Apparatus for Dynamically Optimizing Byte-Coded Programs,” U.S. patent application No. 08/944,330, entitled “Method and Apparatus for Dynamically Optimizing Compiled Activations,” all filed concurrently herewith, U.S. patent application No. 08/884,856, entitled “Interpreting Functions Utilizing a Hybrid of Virtual and Native Machine Instructions,” filed Jun. 30, 1997, and U.S. patent application No. 08/885,008, entitled “Interpreter Generation and Implementation Utilizing Interpreter States and Register Caching,” filed Jun. 30, 1997, which are all incorporated herein by reference for all purposes in their entirety.
US Referenced Citations (12)
Non-Patent Literature Citations (5)
| Entry |
| Holzle et al., “Reconciling Responsiveness with Performance in Pure Object-Oriented Languages,” AMC Transactions on Programming Languages and Systems, ACM, USA, vol. 18, No. 4, Jul. 1996. |
| Hozle et al., “Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches,” Proceedings of ECOOP '91, European Conference on Object-Oriented Programming, Geneva, Switzerland, Jul. 1991. |
| Grove et al., “Profile-Guided Receiver Class Prediction,”OOPSLA '95: Conference on Object Oriented Programming Systems Languages and Applications, Tenth Annual Conference, Austin TX, USA, Oct. 15-19, 1995, vol. 30, No. 10, pp. 108-123. |
| Cramer et al. “Compiling Java Just in Time” IEEE Micro, IEEE Inc. New York, vol. 17, No. 3, May 1, 1997, pp. 36-43. |
| Arjomandi et al., “ABC++: Concurrency by inheritance in C++,” IBM Systems Journal, vol. 34, No. 1, pp. 1-20, 1995. |