Data processing: software development – installation – and managem – Software program development tool – Translation of code
Reexamination Certificate
1999-02-12
2001-08-28
Chaki, Kakali (Department: 2762)
Data processing: software development, installation, and managem
Software program development tool
Translation of code
Reexamination Certificate
active
06282707
ABSTRACT:
BACKGROUND OF THE INVENTION
1. Field of the Invention
The present invention relates generally to a program transformation method, a program transformation system and a storage medium storing a program transformation program. More particularly, the invention relates to a program transformation method and a program transformation system for transforming (compiling) a source program described by a programming language into an object program described by a language (machine language, assembly language and so forth) executable by a computer, a central processing unit (CPU) and the like.
2. Description of the Related Art
FIG. 15
 is a block diagram showing an example of a construction of the conventional program transformation system disclosed in Japanese Unexamined Patent Publication No. Heisei 1-118931.
The program transformation system illustrated in 
FIG. 15
 is constructed with a first program storage portion 
151
, a compiler 
152
, a second program storage portion 
153
, a third program storage portion 
154
, an input data storage portion 
155
, a program executing portion 
156
, a fourth program storage portion 
157
 and a parsing result storage portion 
158
.
At first, the compiler 
152
 reads out a source program described by a programming language, such as C language and so forth from the first program storage portion 
152
, temporarily generates an object program described by a machine language, an assembly language and so forth, and stores the temporarily generated object program in the second program storage portion 
153
.
Here, the temporarily generated object program is the program generated by transforming the source program into codes of machine language, assembly language or so forth in a sequential order of description. While the temporarily generated object program is executable by the computer, the central processing unit (CPU) and so forth, since the source program is simply transformed into the codes in a sequential order of that in the source program, it inherently has redundant portions to make the size (code size) of the overall object program large as held in the temporarily generated form. Therefore, a large storage capacity is required in a primary storage device which is adapted to store the temporarily generated object program. Furthermore, an execution period of the object program becomes long to lower efficiency.
Therefore, it becomes necessary to generate an efficient and optimal object program. The object program simply transformed into the codes from the source program in a sequential order described in the source program in the process set forth above, will be hereinafter referred to as “temporary object program” distinguishing from an optimized final object program.
There are various method for optimizing the object program. Here, arrangement optimization of instruction codes in a procedure. The procedure means a group of processes, such as arithmetic operation, to be executed by the computer or CPU and is often called as function or sub-routine. Throughout the disclosure and claims, the group of processes will be generally referred to as “procedure”.
In a program, it can become necessary to call other procedure (hereinafter referred to as “callee” side procedure) in execution of some procedure (hereinafter referred to as “caller” side procedure) at a certain portion of the program. Therefore, when the source program is transformed into the object program and the resultant object program is stored in the primary storage device, if an instruction code of the caller side procedure and an instruction code of the caller side procedure closely related to the former are physically arranged close with each other, a procedure call instruction can be changed from that for long jump to that for short jump.
By this, the code size of the overall object program can be reduced. In conjunction therewith, an execution speed upon executing the object program in the computer or the CPU can be higher. Arranging of the instruction codes having high possibility to be sequentially executed in time at physically close positions on the object program is called as arrangement optimization of the instruction codes of the procedures.
Next, the program executing portion 
156
 reads out a procedure call frequency parsing program from the fourth program storage portion 
157
 and executes the same. Namely, the program executing portion 
156
 reads out the temporary object program from the second program storage portion 
153
. In conjunction therewith, an input data stored in the input data storage portion 
155
 input by an operator is read out by the program executing portion 
156
. Then, the program executing portion 
156
 simulates execution of the temporary object program and, in conjunction therewith, integrates number of times of occurrence of call of other procedures in a certain procedure in the temporary object program. A result of integration is stored in the parsing result storage portion 
158
 as a procedure reference frequency parsing result.
By this, the compiler 
152
 reads out the procedure reference frequency parsing result from the parsing result storage portion 
158
 to calculates closeness of reference relationship between arbitrary two procedures. On the basis of a resultant closeness, arrangement optimization of the instruction code is performed to generate the final objective program to store in the third program storage portion 
154
.
On the other hand, 
FIG. 16
 is a block diagram showing an example of a construction of the conventional program transformation system disclosed in Japanese Unexamined Patent Publication No. Heisei 9-34725.
The program transformation system illustrated in 
FIG. 16
 is constructed with a source program storage portion 
161
, a compiler 
162
 and an object program storage portion 
163
, in general.
The compiler 
162
 is generally constructed with a parsing portion 
164
, a procedure call occurrence counting portion 
165
, a code generating portion 
166
, a procedure call count data storage portion 
167
, a special space arranged procedure determining portion 
168
, an object program outputting portion 
169
. Here, a special space means a special region of a finite code size set in a part of a program space.
The parsing portion 
164
 reads out the source program to be parsed from the source program storage portion 
161
 and parses a syntax forming the source program. The procedure call count portion 
165
 counts number of times of call of respective procedure per procedure recognized by the parsing portion 
164
 upon parsing the syntax.
The code generating portion 
166
 performs code generation twice. Namely, at first code generation, the code generating portion 
166
 generates a normal code if the syntax is not the procedure call instruction, and generates an instruction code using normal call instruction if the syntax is the procedure call instruction, on the basis of the result of parsing of the parsing portion 
164
. On the other hand, the code generating portion 
166
 scans the results of code generation in the first time from the leading end in the second code generation. Then, if the code is the procedure call instruction and, a result of inquiring to the special space arranged procedure determining portion 
168
 shows that the procedure is a special space arranged procedure determined to be arranged within the special space, a normal call instruction code having large byte count is replaced with a dedicated call instruction code having smaller byte count.
The procedure call count data storage portion 
167
 stores a call count counted by the procedure call occurrence counting portion 
165
 per procedure and a code size of the code generated in the first code generation. The special space arranged procedure determining portion 
168
 selects and determines a procedure to be arranged within the special space with providing preference for the procedure having greater call count so that a sum of the code sizes of the procedures to be arranged within the special space falls within a code size of the special space on the ba
Chaki Kakali
NEC Corporation
Scully Scott Murphy & Presser
LandOfFree
Program transformation method and program transformation system does not yet have a rating. At this time, there are no reviews or comments for this patent.
If you have personal experience with Program transformation method and program transformation system, we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Program transformation method and program transformation system will most certainly appreciate the feedback.
Profile ID: LFUS-PAI-O-2435287