Compiler Method Address Table Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional compiling methods generate redundant method address storage tables for different classes, leading to increased object code size, and fail to efficiently control redundancy across both same and different classes.
Innovation Solution
A compiling method that optimizes method address storage tables by analyzing intermediate code to detect and delete redundant tables, generating a common method address storage table usable by multiple classes, and updating pointers to reduce code size.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a method address storage table is generated for each class in the object code, then the dynamic method activation feature is realized, but the object code size is enlarged
Solution Approach 1:
The patent merges multiple method address storage tables into a single shared table when different classes can use the same table. The compiler analyzes class inheritance relationships and determines whether classes can share a common method address storage table, thereby reducing redundancy while maintaining the ability to dynamically activate methods across different classes.
Solution Approach 2:
The patent creates a universal method address storage table that serves multiple classes simultaneously. By determining whether classes can share a common table based on their inheritance relationships and method activation requirements, the system achieves multi-functionality that reduces the total number of tables needed while preserving dynamic method activation for all classes.
2Ease of manufacture
If the method address storage table is generated using conventional comparison of class name and input file name, then redundant generation for same classes is controlled, but redundant generation for different classes cannot be controlled
Solution Approach 1:
The patent extends the redundancy control mechanism from a single dimension (input file name comparison) to multiple dimensions by incorporating class inheritance relationships. The compiler now analyzes both the input file name and the class hierarchy structure to determine table sharing eligibility, adding a new dimensional aspect to the redundancy control process.
Solution Approach 2:
The patent introduces an intermediary analysis process that examines class inheritance relationships between different classes. This intermediary step determines whether classes can share a common method address storage table, serving as a mediator between the class definitions and the final table generation decision, thereby enabling redundancy control across different classes.
Data Source
AI summary
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.


