System and method for dynamically invoking object methods from an application designed for static method invocation
First Claim
1. A computer implemented system to generate static method stubs for dynamic dispatch of one or more dynamically invoked method procedures, comprising:
- (a) storage means for storing the one or more dynamically invoked method procedures;
(b) compiler means for generating a static redispatch stub for each of the one or more dynamically invoked method procedures, each of said redispatch stubs having an offset value; and
(c) dispatch function means for processing a static redispatch stub invocation having one or more invocation parameters, said dispatch function means including;
selecting means for selecting one of the dynamically invoked method procedures based on said one or more invocation parameters; and
transferring means for transferring control to the one of the dynamically invoked method procedures associated with the static redispatch stub.
1 Assignment
0 Petitions
Accused Products
Abstract
A method, system and program for allowing an application designed to use static method calls to manipulate objects whose methods are only available through dynamic calls without modifying the binary image of the application. A SOM compiler generates class definitions and generates a redispatch stub for each method defined in a class. A redispatch stub is a short sequence of instructions with an identical calling sequence as its corresponding method. This gives the class'"'"' dispatch enough information to determine the correct method procedure in a dynamic manner. The dispatch function employs the redispatch stub to call the appropriate method procedure and return any return value to the calling application via the redispatch stub. Redispatch stubs allows a class with a definition that can vary at runtime to be used by an application that was designed for statically defined classes.
207 Citations
11 Claims
-
1. A computer implemented system to generate static method stubs for dynamic dispatch of one or more dynamically invoked method procedures, comprising:
-
(a) storage means for storing the one or more dynamically invoked method procedures; (b) compiler means for generating a static redispatch stub for each of the one or more dynamically invoked method procedures, each of said redispatch stubs having an offset value; and (c) dispatch function means for processing a static redispatch stub invocation having one or more invocation parameters, said dispatch function means including; selecting means for selecting one of the dynamically invoked method procedures based on said one or more invocation parameters; and transferring means for transferring control to the one of the dynamically invoked method procedures associated with the static redispatch stub. - View Dependent Claims (2, 3, 4)
-
-
5. A computer implemented method for dynamically dispatching of one or more dynamically invoked methods from an application designed for static method invocation, comprising the steps of:
-
(a) generating a statically invoked redispatch stub for one or more dynamically invoked methods; and (b) storing each of the redispatch stubs in a storage means at a location having an offset value; (c) receiving a request to invoke one of said one or more dynamically invoked methods, said request including one or more invocation parameters; (d) determining the offset value for the redispatch stub for said one of said one or more dynamically invoked methods; (e) invoking the redispatch stub at the determined offset value; and (f) dynamically invoking the dynamically invoked method based upon said one or more invocation parameters. - View Dependent Claims (6, 7, 8)
-
-
9. A computer implemented process for dynamically invoking object method procedures from an application designed for static method invocation, the process comprising the steps of:
-
receiving an object definition listing a plurality of dynamically invoked method procedures; generating a statically invoked redispatch method for each of said plurality of dynamically invoked method procedures; storing said redispatch methods at identifiable locations in a storage device; receiving a message to invoke one of said plurality of dynamically invoked method procedures, said message including one or more invocation parameters for selecting which one of said dynamically invoked method procedures to invoke; and causing said redispatch method to dynamically invoke said one of said plurality of dynamically invoked method procedures. - View Dependent Claims (10, 11)
-
Specification