Hash table dispatch mechanism for interface methods
First Claim
1. A method of reducing the dispatch times of a virtual dispatch during the execution of an object-oriented language program in a system having a host machine and a virtual machine, the program having interface Methods and functions including individual functions and associated functions associated with the interface Methods, the method comprising:
- providing hierarchical relationships between functions represented by super class and sub class definitions of the functions, wherein super class functions have super class attributes, and sub class functions have inherited sub class attributes inherited from a corresponding super class function and non inherited class attributes not inherited from a super class function;
creating a plurality of dispatch tables including interface Methods and individual functions having both inherited attributes and non inherited attributes;
creating an interface hash table for a dispatch table, the interface hash table having a pointer as an index for a selected one of an interface Method or an individual function and recovery and search routines for recovering from a hash table collision and searching a list of functions;
the dispatch table receiving and re-routing the call to the interface hash table during a call of a virtual dispatch requiring an interface Method or requiring an individual function;
determining whether a collision has occurred in the hash table in response to the call and selectively executing the recovery routine or the fallback routine in response to the collision determination;
the interface hash table selecting one of the interface Methods or one of the individual functions to provide a selected routine; and
executing the selected routine in accordance with both the inherited attributes and the non inherited attributes.
9 Assignments
0 Petitions
Accused Products
Abstract
A hash table dispatch mechanism for interface Methods. The mechanism reduces dispatch times during the execution of an object-oriented language program. An interface hash table having a pointer as an index for either a specific location in a corresponding dispatch table or an interface Method of the program is created for a dispatch table. The interface hash table has an address and a plurality of slots having a hash value related to an interface Method. The mechanism includes a recovery Method for resolving conflicts when two or more slots in the interface hash table contain clashing values.
81 Citations
38 Claims
-
1. A method of reducing the dispatch times of a virtual dispatch during the execution of an object-oriented language program in a system having a host machine and a virtual machine, the program having interface Methods and functions including individual functions and associated functions associated with the interface Methods, the method comprising:
-
providing hierarchical relationships between functions represented by super class and sub class definitions of the functions, wherein super class functions have super class attributes, and sub class functions have inherited sub class attributes inherited from a corresponding super class function and non inherited class attributes not inherited from a super class function;
creating a plurality of dispatch tables including interface Methods and individual functions having both inherited attributes and non inherited attributes;
creating an interface hash table for a dispatch table, the interface hash table having a pointer as an index for a selected one of an interface Method or an individual function and recovery and search routines for recovering from a hash table collision and searching a list of functions;
the dispatch table receiving and re-routing the call to the interface hash table during a call of a virtual dispatch requiring an interface Method or requiring an individual function;
determining whether a collision has occurred in the hash table in response to the call and selectively executing the recovery routine or the fallback routine in response to the collision determination;
the interface hash table selecting one of the interface Methods or one of the individual functions to provide a selected routine; and
executing the selected routine in accordance with both the inherited attributes and the non inherited attributes. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)
-
-
21. A method of reducing the dispatch times of a virtual dispatch during the execution of an object-oriented language program in a system having a host machine and a virtual machine, the program having interface Methods and functions including individual functions and associated functions associated with the interface Methods, the method comprising:
-
providing hierarchical relationships between functions represented by super class and sub class definitions of the functions, wherein super class functions have super class attributes, and sub class functions have inherited sub class attributes inherited from a corresponding super class function and non inherited class attributes not inherited from a super class function;
creating a plurality of dispatch tables including interface Methods and individual functions having both inherited attributes and non inherited attributes;
creating an interface hash table for a dispatch table, the interface hash table having a pointer as an index for a selected one of an interface Method or an individual function and recovery and search routines for recovering from a hash table collision and searching a list of functions, an address and a plurality of slots, each slot having a hash value related to one interface Method or one individual friction;
the dispatch table receiving and re-routing the call to the interface hash table during a call of a virtual dispatch requiring an interface Method or requiring an individual function;
determining whether a collision has occurred in the hash table in response to the call and selectively executing the recovery routine or the fallback routine in response to the collision determination;
loading the address of the interface hash table in a memory location;
retrieving a slot number for a particular interface Method or individual function using its respective hash value;
loading a unique identifier for a destination interface Method and individual function into a register; and
performing a virtual invocation using its respective hash value in accordance with the inherited and non inherited attributes. - View Dependent Claims (22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38)
-
Specification