Accurate method for inlining virtual calls
First Claim
Patent Images
1. A computer system configured by machine-readable instructions to:
- A) read electrical signals representing a source-code calling procedure that calls a polymorphic method on a variable object;
B) compile the source-code calling procedure into an object-code calling procedure by;
i) placing inlined object code for at least one form of the polymorphic method into the object-code procedure; and
ii) guarding the inlined object code for each such form of the polymorphic method with guard code that directs a machine executing it to;
a) perform a comparison of the address of the one form of the polymorphic method with the called-on object'"'"'s virtual-function-table entry for that method; and
b) skip the inlined object code if the comparison is negative; and
C) store the object-code calling procedure in a machine-readable storage medium.
1 Assignment
0 Petitions
Accused Products
Abstract
A computer system (10) is configured as a compiler to translate source code (FIG. 4) into object code (FIG. 6). The source code calls a polymorphic method on a receiver object. The compiler inlines the polymorphic method and guards the inlining with guard code that causes the executing microprocessor to skip the inlining in favor of a virtual method call when it determines that the inlined code is not appropriate for the receiver object. To make that determination, the guard code compares the address of the method version that has been inlined with the receiver object'"'"'s pointer to its version of the polymorphic method.
50 Citations
24 Claims
-
1. A computer system configured by machine-readable instructions to:
-
A) read electrical signals representing a source-code calling procedure that calls a polymorphic method on a variable object; B) compile the source-code calling procedure into an object-code calling procedure by; i) placing inlined object code for at least one form of the polymorphic method into the object-code procedure; and ii) guarding the inlined object code for each such form of the polymorphic method with guard code that directs a machine executing it to; a) perform a comparison of the address of the one form of the polymorphic method with the called-on object'"'"'s virtual-function-table entry for that method; and b) skip the inlined object code if the comparison is negative; and C) store the object-code calling procedure in a machine-readable storage medium. - View Dependent Claims (2, 3, 4)
-
-
5. A computer system comprising:
-
A) means for reading electrical signals representing a source-code calling procedure that calls a polymorphic method on a variable object; B) means for compiling the source-code calling procedure into an object-code calling procedure by; i) placing inlined object code for at least one form of the polymorphic method into the object-code procedure; and ii) guarding the inlined object code for each such form of the polymorphic method with guard code that directs a machine executing it to; a) perform a comparison of the address of the one form of the polymorphic method with the called-on object'"'"'s virtual-function-table entry for that method; and b) skip the inlined object code if the comparison is negative; and C) means for storing the object-code calling procedure in a machine-readable storage medium. - View Dependent Claims (6, 7, 8)
-
-
9. A method of generating object code comprising the steps of:
-
A) reading electrical signals representing a source-code calling procedure that calls a polymorphic method on a variable object; B) compiling the source-code calling procedure into an object-code calling procedure by; i) placing inlined object code for at least one form of the polymorphic method into the object-code procedure; and ii) guarding the inlined object code for each such form of the polymorphic method with guard code that directs a machine executing it to; a) perform a comparison of the address of the one form of the polymorphic method with the called-on object'"'"'s virtual-function-table entry for that method; and b) skip the inlined object code if the comparison is negative; and C) storing the object-code calling procedure in a machine-readable storage medium. - View Dependent Claims (10, 11, 12)
-
-
13. A computer data signal embodied in a carrier wave and representing a sequence of instructions that, when executed by a computer system, configures the computer system to:
-
A) read electrical signals representing a source-code calling procedure that calls a polymorphic method on a variable object; B) compile the source-code calling procedure into an object-code calling procedure by; i) placing inlined object code for at least one form of the polymorphic method into the object-code procedure; and ii) guarding the inlined object code for each such form of the polymorphic method with guard code that directs a machine executing it to; a) perform a comparison of the address of the one form of the polymorphic method with the called-on object'"'"'s virtual-function-table entry for that method; and b) skip the inlined object code if the comparison is negative; and C) store the object-code calling procedure in a machine-readable storage medium. - View Dependent Claims (14, 15, 16)
-
-
17. A storage medium containing instructions readable by a computer system to configure the computer system to:
-
A) read electrical signals representing a source-code calling procedure that calls a polymorphic method on a variable object; B) compile the source-code calling procedure into an object-code calling procedure by; i) placing inlined object code for at least one form of the polymorphic method into the object-code procedure; and ii) guarding the inlined object code for each such form of the polymorphic method with guard code that directs a machine executing it to; a) perform a comparison of the address of the one form of the polymorphic method with the called-on object'"'"'s virtual-function-table entry for that method; and b) skip the inlined object code if the comparison is negative; and C) store the object-code calling procedure in a machine-readable storage medium. - View Dependent Claims (18, 19, 20)
-
-
21. For compiling into an object-code calling procedure a source-code calling procedure that calls a polymorphic method on a variable object, a computer system configured by machine-readable instructions to:
-
A) place inlined object code for at least one form of the polymorphic method into the object-code calling procedure; and B) guard the inlined object code for each such form of the polymorphic method with guard code that directs a machine executing it to; i) perform a comparison of the address of the one form of the polymorphic method with the called-on object'"'"'s virtual-function-table entry for that method; and ii) skip the inlined object code if the comparison is negative. - View Dependent Claims (22, 23, 24)
-
Specification