Claims
- 1. In a computer system, a method of implementing message dispatch for an object-oriented program, comprising:performing a first dynamic message dispatch technique at a specific site to dispatch messages to receiver objects; dynamically determining during program execution if a second message dispatch technique is desirable at the specific site based at least in part on a determination of a number of different receiver types that the specific site has dispatched messages to; and performing the second message dispatch technique at the specific site to dispatch messages to the receiver objects if the second message dispatch technique is desirable.
- 2. The method of claim 1, wherein the determining during program execution if a second message dispatch technique is desirable includes determining if the specific site has dispatched messages to more than a first predetermined number of different receiver types.
- 3. The method of claim 2, further comprising maintaining a count of different receiver types to which the first dispatch technique has dispatched messages.
- 4. The method of claim 3, where in the count is represented by dispatching messages to NOP instructions preceding a method that performs an operation specified by a dispatched message.
- 5. The method of claim 1, wherein the first message dispatch technique is determined statically before program execution.
- 6. The method of claim 1, wherein the first message dispatch technique is inline caching.
- 7. The method of claim 1, wherein the second message dispatch technique is selected from polymorphic inline caching and hashing.
- 8. The method of claim 1, further comprising:dynamically determining during program execution if a third message dispatch technique is desirable at the specific site; and performing the third message dispatch technique at the specific site to dispatch messages to the receiver objects.
- 9. The method of claim 8, wherein the determining during program execution that a third message dispatch technique would be desirable includes determining if the specific site has dispatched messages to more than a second predetermined number of different receiver types if the third message dispatch technique is desirable.
- 10. The method of claim 1, wherein dynamically determining during program execution if a second message dispatch technique is desirable at the specific site includes dynamically determining during program execution if the second message dispatch technique is desirable at the specific site after performing the first message dispatch technique at the specific site.
- 11. A computer program product that implements message dispatch for an object-oriented program, comprising:computer code that performs a first dynamic message dispatch technique at a specific site to dispatch messages to receiver objects; computer code that dynamically determines during program execution if a second message dispatch technique is desirable at the specific site based at least in part on a determination of a number of different receiver types that the specific site has dispatched messages to; and computer code that performs the second message dispatch technique at the specific site to dispatch messages to the receiver objects if the second message dispatch technique is desirable; and a computer readable medium that stores the computer code.
- 12. The computer program product of claim 11, wherein the computer readable medium is selected from the group consisting of CD-ROM, floppy disk, tape, flash memory, system memory, hard drive, and data signal embodied in a carrier wave.
- 13. A computer system that implements message dispatch for an object-oriented program, comprising:a processor that executes computer code; computer code that performs a first dynamic message dispatch technique at a specific site to dispatch messages to receiver objects; computer code that dynamically determines during program execution if a second message dispatch technique is desirable at the specific site based at least in part on a determination of a number of different receiver types that the specific site has dispatched messages to; and computer code that subsequently performs the second message dispatch technique at the specific site to dispatch messages to the receiver objects if the second message dispatch technique is desirable; and a computer readable medium that stores the computer code for the processor to execute.
- 14. In a computer system, a method of implementing message dispatch for an object-oriented program, comprising:performing an inline caching based message dispatch technique at a specific site to dispatch messages to receiver objects; dynamically determining during program execution if a second message dispatch technique is desirable at the specific site based at least in part on a determination of a number of different receiver types that the specific site has dispatched messages to; and performing the second message dispatch technique at the specific site to dispatch messages to the receiver objects if the second message dispatch technique is desirable.
- 15. The method of claim 14, wherein the second message dispatch technique is selected from polymorphic inline caching and hashing.
- 16. The method of claim 15, wherein the determining during program execution if a second message dispatch technique is desirable includes determining if the specific site has dispatched messages to more than a first predetermined number of different receiver types.
- 17. The method of claim 16, further comprising maintaining a count of different receiver types to which the first dispatch technique has dispatched messages.
- 18. The method of claim 17, wherein the count is represented by dispatching messages to NOP instructions preceding a method that performs an operation specified by a dispatched message.
- 19. The method of claim 16, further comprising:dynamically determining during program execution if a third message dispatch technique is desirable at the specific site; and performing the third message dispatch technique at the specific site to dispatch messages to the receiver objects.
- 20. The method of claim 16, wherein the determining during program execution that a third message dispatch technique would be desirable includes determining if the specific site has dispatched messages to more than a second predetermined number of different receiver types if the third message dispatch technique is desirable.
- 21. The method of claim 15, further comprising:dynamically determining during program execution if a third message dispatch technique is desirable at the specific site; and performing the third message dispatch technique at the specific site to dispatch messages to the receiver objects.
CROSS REFERENCE TO RELATED APPLICATIONS
This application is related to U.S. Patent Application No. 08/944,332, now U.S. Pat. No. 6,317,796 entitled “Inline Database for Receiver Types in Object-Oriented Systems,” U.S. patent application Ser. No. 08/944,735, now U.S. Pat. No. 5,970,249 entitled “Method and Apparatus for Performing Byte-Code Optimization During Pauses, U. patent application Ser. No. 08/944,335, now U.S. Pat. No. 6,009,517 entitled “Mixed Execution Stack and Exception Handling,” U.S. patent application Ser. No. 08/944,326, entitled “Method and Apparatus for Implementing Multiple Return Sites,” U.S. patent application Ser. No. 08/944,334, now U.S. Pat. No. 5,995,754 entitled “Method and Apparatus for Dynamically Optimizing Byte-Coded Programs,” U.S. patent application Ser. No. 08/944,330, now U.S. Pat. No. 5,933,635 entitled “Method and Apparatus for Dynamically Optimizing Compiled Activations, ” all filed concurrently herewith, U.S. patent application Ser. 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 Ser. No. 08/885,008, now U.S. Pat. No. 6,021,273 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 (15)
Foreign Referenced Citations (1)
| Number |
Date |
Country |
| 0546684 |
Jun 1993 |
EP |
Non-Patent Literature Citations (11)
| Entry |
| Holzle et al., “Reconciling Responsiveness with Performance in Pure Object-Oriented Languages,” ACM Transactions on Programming Languages and Systems, vol. 18, No. 4, pp. 355-400, Jul. 1996.* |
| Agesen et al., “Type Feedback vs. Concrete Type Inference: A Comparison of Optimization Techniques for Object-Oriented Languages,” OOPSLA-ACM, pp. 91-94, Dec. 1995.* |
| Grove et al., “Profile-Guided Receiver Class Prediction,” OOPSLA-ACM, pp. 108-123, Dec. 1995.* |
| Cramer et al., “Compiling Java Just in Time,” May/Jun. 1997, IEEE Micro, pp. 36-43. |
| Grove et al., “Profile-Guided Receiver Class Prediction,” OOPSLA '95: Conference on Object Oriented Programming Systems Languages and Applications, Oct. 15-19, 1995, Tenth Annual Conference,, vol. 30, No. 10, pp. 108-123. |
| Hozle et al., “Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches,” Jul. 1991, Proceedings of ECOOP '91, European Conference on Object-Oriented Programming, Geneva, Switzerland. |
| Hölzle and Ungar, “Optimizing Dynamically-Dispatched Calls with Run-Time Type Feedback,”Jun. 1994, SIGPLAN Conference on Programming Language Design and Implementation, Orlando, FL. |
| Hölzle and Agesen, “Dynamic vs. Static Optimization Techniques for Object-Oriented Languages”, 1996, TAPOS. |
| Karl Driesen, “Method Lookup Strategies in Dynamically Typed Object-Oriented Programming Languages,” 1992-1993, Dissertation submitted in partial fulfillment for the degree of Masters in Computer Science from Vrije Universiteit Brussel. |
| Driesen et al., “Message Dispatch on Pipelined Processors”, 1995, Accepted at ECOOP′ 95, to appear in Lecture Notes in Computer Science. |
| Plevyak et al., “Type Directed Cloning for Object-Oriented Programs”, Languages and Compilers for Parallel Computing, 8th International Workshop, LCPC 1995 Columbus, Aug. 10-12, 1995, No. Workshop 8, Aug. 10, 1995, pp. 566-580. |