Claims
- 1. A method of reducing dispatch times during the execution of an object-oriented language program, the program having a plurality of interface Methods, the method comprising:
creating a plurality of dispatch tables; creating an interface hash table for at least one of the plurality of dispatch tables, the interface hash table having a pointer as an index for one of the group consisting of a specific location in the corresponding dispatch table and one interface Method of the program; and when the program executes an instruction requiring one of the interface Methods, looking up the one of the interface Methods using the interface hash table.
- 2. A method as claimed in claim 1, further comprising determining whether two or more hash values in the interface hash table conflict.
- 3. A method as claimed in claim 2, further comprising calling a recovery Method when two or more hash values in the interface hash table conflict.
- 4. A method as claimed in claim 1, further comprising creating hash values that reduce the frequency of conflicts between two or more hash values in the interface hash table.
- 5. A method as claimed in claim 4, further comprising creating hash values for the interface hash table by deriving pseudo-random values based on the attributes of the interface Methods.
- 6. A method as claimed in claim 1, further comprising choosing a starting hash value and allocating other hash values sequentially from the starting hash value.
- 7. A method as claimed in claim 1, further comprising configuring the interface hash table to contain one of the group of a slot number of the dispatch table and function pointers.
- 8. A method as claimed in claim 1, further comprising defining each class of the program and a set of the interface Methods implemented by each class.
- 9. A method as claimed in claim 8, further comprising creating a fixed size interface hash table for each class, each fixed size interface hash table mapping an interface Method hash value to a dispatch table index.
- 10. A computer system comprising:
a program having a plurality of interface Methods; a plurality of dispatch tables; an interface hash table for at least one of the plurality of dispatch tables, the interface hash table having a pointer as an index for one of the group consisting of a specific location in the corresponding dispatch table and one interface Method of the program.
- 11. A computer system as claimed in claim 10, further comprising a recovery Method for resolving conflicts when two or more slots in the interface hash table contain clashing values.
- 12. A computer system as claimed in claim 10, wherein the interface hash table includes values derived from pseudo-random values based on attributes of the interface Methods.
- 13. A computer system as claimed in claim 10, wherein the interface hash table includes a starting hash value and a plurality of other hash values allocated sequentially from the starting hash value.
- 14. A computer system as claimed in claim 10, wherein the interface hash table includes one of the group consisting of a slot number of the dispatch table and function pointers.
- 15. A computer system comprising:
a program having a plurality of interface Methods; a compiler for compiling code of the program, the compiler arranged to compile a fragment of the code of the program; a compiler manager coupled to the compiler; an interpreter for interpreting the code of the program, the interpreter coupled to an execution history recorder, the execution history recorder arranged to record the number of times a fragment of code is executed, to record information regarding execution of fragments of code, and to alert the compiler manager when a fragment of code has been executed a threshold number of times; a plurality of dispatch tables; an interface hash table for at least one of the plurality of dispatch tables, the interface hash table having a pointer as an index for one of the group consisting of a specific location in the corresponding dispatch table and one interface Method of the program.
- 16. A computer system as claimed in claim 15, further comprising a recovery Method for resolving conflicts when two or more slots in the interface hash table contain clashing values.
- 17. A computer system as claimed in claim 15, wherein the interface hash table includes values derived from pseudo-random values based on attributes of the interface Methods.
- 18. A computer system as claimed in claim 15, wherein the interface hash table includes a starting hash value and a plurality of other hash values allocated sequentially from the starting hash value.
- 19. A computer system as claimed in claim 15, wherein the interface hash table includes one of the group consisting of a slot number of the dispatch table and function pointers.
- 20. A computer system as claimed in claim 15, wherein the execution history recorder is arranged to record a path of execution from a first fragment to a second fragment.
- 21. A computer system as claimed in claim 15, wherein the system is multi-threaded and the compiler runs on a thread separate from the thread executing the code.
- 22. A computer system as claimed in claim 15, further comprising a queue coupled to the compiler.
- 23. A computer system as claimed in claim 15, wherein the compiler, compiler manager and interpreter are part of a virtual machine.
- 24. A computer system as claimed in claim 15, further comprising a memory manager that monitors memory available to the compiler.
- 25. A computer system as claimed in claim 24, further comprising a deleter coupled to the memory manager.
- 26. A computer system as claimed in claim 24, wherein only dominant path or near dominant path fragments of code are compiled.
- 27. A method of invoking an interface Method for an object of a program, the method comprising:
creating a plurality of dispatch tables; creating an interface hash table for at least one of the plurality of dispatch tables, the interface hash table having a pointer as an index for one of the group consisting of a specific location in the corresponding dispatch table and a Method of the program, the interface hash table having an address and a plurality of slots, each slot having a hash value related to one interface Method; and loading the address of the interface hash table in a memory location; retrieving a slot number for a particular interface Method using its respective hash value; loading a unique identifier for a destination interface Method into a register; and performing a virtual invocation.
- 28. A method as claimed in claim 27, wherein the interface hash table is included in at least one of the plurality of dispatch tables.
- 29. A method as claimed in claim 27, wherein the interface hash table includes Method pointers.
- 30. A method of compiling an object-oriented language program, the program having a plurality of interface Methods, the method comprising:
establishing an execution threshold; executing a number of fragments of the program; recording the number of times each of the fragments of the program is executed; queuing one fragment of the program for compilation when the number of times the one fragment of the program has been executed matches the threshold; compiling the one fragment of the program; creating a plurality of dispatch tables; creating an interface hash table for at least one of the plurality of dispatch tables, the interface hash table having a pointer as an index for one of the group consisting of a specific location in the corresponding dispatch table and one interface Method of the program; and when the program executes an instruction requiring one of the interface Methods, looking up the one of the interface Methods using the interface hash table.
- 31. A method as claimed in claim 30, further comprising adjusting the threshold after it is established.
- 32. A method as claimed in claim 30, further comprising monitoring memory available to the compiler.
- 33. A method as claimed in claim 30, further comprising deleting code from memory to meet the requirements of the compiler.
- 33. A method as claimed in claim 30, further comprising running the compiler on a thread that is separate from the thread of the interpreter.
- 34. A method as claimed in claim 30, further comprising recording a transfer of control into one fragment of code and a transfer out of the one fragment of code.
- 35. A method as claimed in claim 30, further comprising searching cache for preexisting compiled versions of fragments of code.
- 36. A method as claimed in claim 30, wherein the computer code includes at least one interface Method, and at least one of the fragments of code includes less than the entire at least one Method.
- 37. A method as claimed in claim 30, further comprising performing an exception check.
- 38. A method as claimed in claim 37, further comprising performing a code optimization.
- 39. A method as claimed in claim 37, further comprising interpreting exception code when an exception occurs.
- 40. A method as claimed in claim 37, further comprising establishing a link to a bailout device.
- 41. A method as claimed in claim 40, further comprising passing control to an interpreter.
- 42. A method as claimed in claim 37, further comprising updating condition states.
- 43. A method as claimed in claim 42, further comprising interpreting exception code after updating the condition states.
Priority Claims (1)
Number |
Date |
Country |
Kind |
GB9825102.8 |
Nov 1998 |
GB |
|
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This is a continuation of International Application PCT/GB99/00788, filed on Mar. 16, 1999, which claims priority to U.K. Patent Application GB9825102.8, filed on Nov. 16, 1998, now abandoned.
Continuations (1)
|
Number |
Date |
Country |
Parent |
PCT/GB99/00788 |
Mar 1999 |
US |
Child |
09859133 |
May 2001 |
US |