Optimizing compiling of object oriented source code
AssigneePanasonic Corporation
InventorShinobu Asao
Life of this patent
Estimating the term…
Abstract
A method address storage table information, a class information and a function reference information are extracted from an intermediate code and analyzed. When any method determined in execution is not overridden in one of classes by the other class, method address storage tables of the respective classes are deleted and a method address storage table that can be commonly used in the both classes is generated. Then, method address storage table pointers of the both classes are renewed to a leading address value of the generated method address storage table that can be commonly used in the both classes. As described, the method address storage tables redundantly generated in the different classes are deleted so that an object code size can be reduced.
Claims25
A compiling method for converting a source program described in an object-oriented language into an object code comprising:
- an intermediate code generating step for generating an intermediate code from the source program;
- an analyzing-target information extracting step for extracting a method address storage table information, a class information and a function reference information from the intermediate code, wherein the method address storage table information includes at least a method address storage table, a method address storage table pointer for pointing to the method address storage table and a method index number corresponding to the method address storage table, the class information includes at least a base class name, a derived class name, a name of a new method determined in execution and an overridden method, and the function reference information is an information showing whether or not each method is referenced in the program;
- a method address storage table optimizing step for optimizing the intermediate code by executing a process of analyzing the extracted analyzing-target information and deleting the method address storage table of each class when it is detected from the analysis that none of the methods determined in the execution is overridden in one of the classes by the other class, a process of generating the method address storage table commonly usable in the both classes and a process of renewing the method address storage table pointer of the both classes to a leading address value of the generated method address storage table commonly usable in the both classes;
- wherein the method address storage table information, the class information and the function reference information are extracted within a limited analyzing range when an analyzing-range limiting information including at least one of a file name, a function name and the class name is supplied to a compiler for executing the compiling method in the analyzing-target information extracting step;
- and
- an object code converting step for converting the optimized intermediate code into the object code.
A computer-executable compiling program stored on a computer-readable recording medium for converting a source program described in an object-oriented language into an object code comprising:
- an intermediate code generating feature for generating an intermediate code from the source program;
- an analyzing-target information extracting feature for extracting a method address storage table information, a class information and a function reference information from the intermediate code, wherein the method address storage table information includes at least a method address storage table, a method address storage table pointer for pointing to the method address storage table and a method index number corresponding to the method address storage table, the class information includes at least a base class name, a derived class name, a name of a new method determined in execution and an overridden method, and the function reference information is an information showing whether or not each method is referenced in the program;
- a method address storage table optimizing feature for optimizing the intermediate code by executing a process of analyzing the extracted analyzing-target information and deleting the method address storage table of each class when it is detected from the analysis that none of the methods determined in the execution is overridden in one of the classes by the other class, a process of generating the method address storage table commonly usable in the both classes and a process of renewing the method address storage table pointer of the both classes to a leading address value of the generated method address storage table commonly usable in the both classes;
- wherein the method address storage table information, the class information and the function reference information are extracted within a limited analyzing range when an analyzing-range limiting information including at least one of a file name, a function name and a class name is supplied to a compiler for executing the present compiling method in the analyzing-target information extracting feature;
- and
- an object code converting feature for converting the optimized intermediate code into the object code.
A compiling device for converting a source program described in an object-oriented language into an object code comprising:
- a processor to execute the following units;
- an intermediate code generating unit for generating an intermediate code from the source program;
- an analyzing-target information extracting unit for extracting a method address storage table information, a class information and a function reference information from the intermediate code, wherein the method address storage table information includes at least a method address storage table, a method address storage table pointer for pointing to the method address storage table and a method index number corresponding to the method address storage table, the class information includes at least a base class name, a derived class name, a name of a new method determined in execution and an overridden method, and the function reference information is an information showing whether or not each method is referenced in the program;
- a method address storage table optimizing unit for optimizing the intermediate code by executing a process of analyzing the extracted analyzing-target information and deleting the method address storage table of each class when it is detected from the analysis that none of the methods determined in the execution is overridden in one of the classes by the other class, a process of generating the method address storage table commonly usable in the both classes and a process of renewing the method address storage table pointer of the both classes to a leading address value of the generated method address storage table commonly usable in the both classes;
- wherein the method address storage table information, the class information and the function reference information are extracted within a limited analyzing range when an analyzing-range limiting information including at least one of a file name, a function name and a class name is supplied to a compiler for executing the present compiling method in the analyzing-target information extracting unit;
- and
- an object code converting unit for converting the optimized intermediate code into the object code.
Dependencies are inferred from the claim text.