JPH04323730A - Optimizaltion processing system - Google Patents

Optimizaltion processing system

Info

Publication number
JPH04323730A
JPH04323730A JP11908891A JP11908891A JPH04323730A JP H04323730 A JPH04323730 A JP H04323730A JP 11908891 A JP11908891 A JP 11908891A JP 11908891 A JP11908891 A JP 11908891A JP H04323730 A JPH04323730 A JP H04323730A
Authority
JP
Japan
Prior art keywords
intermediate language
subprogram
definition point
position information
language
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP11908891A
Other languages
Japanese (ja)
Inventor
Hiroshi Oyama
大山 博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP11908891A priority Critical patent/JPH04323730A/en
Publication of JPH04323730A publication Critical patent/JPH04323730A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To efficiently perform the inline expansion in the compiling work and to generate an optimized object code. CONSTITUTION:A syntax analysis means 10, a subprogram definition point position information holding means 1 where position information of an intermediate language is held, an intermediate language output means 12 which stores position information of the intermediate language in the subprogram definition point position information holding means 11, a subprogram definition point collating means 14, an intermediate language input means 13 which transfers the intermediate language to the subprogram definition point collating means 14, an argument correspondence means 15, an optimization processing means 16, and a code generating means 17 which generates an object program from the object code are provided. Thus, the complier processing speed is increased to contribute to the improvement of the program development efficiency, and the size of the object program is reduced to increase the program execution speed.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明はコンパイラの最適化処理
方式に関し、特に副プログラムのインライン展開のやり
方を改良した最適化処理方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an optimization processing method for a compiler, and more particularly to an optimization processing method that improves the method of inline expansion of subprograms.

【0002】0002

【従来の技術】最近、最適化技術の進歩とともに、関数
または手続きなどの副プログラムをそのつど呼び出さず
に、目的コードの中に副プログラム実体として展開する
インライン化技術が開発されている。
2. Description of the Related Art Recently, along with advances in optimization technology, inlining technology has been developed in which subprograms such as functions or procedures are expanded as subprogram entities in target code without calling them each time.

【0003】以下、従来のこの種のコンパイラの最適化
処理方式を図8を参照して説明する。構文解析手段3は
ソースプログラム1を解析して中間言語4を生成し、次
に、コード生成手段6が中間言語4に基づいて、一旦、
第一目的コード5を生成する。その後、インライン展開
手段7が第一目的コード5を読み込んで、副プログラム
の処理に対応する命令の集合をもって、副プログラムを
呼び出す命令を置換して目的プログラム8を生成するよ
うになっている。
Hereinafter, a conventional optimization processing method of this type of compiler will be explained with reference to FIG. The syntax analysis means 3 analyzes the source program 1 to generate an intermediate language 4, and then the code generation means 6 generates an intermediate language 4 based on the intermediate language 4.
First purpose code 5 is generated. Thereafter, the inline expansion means 7 reads the first object code 5 and generates the object program 8 by replacing the instruction that calls the subprogram with a set of instructions corresponding to the processing of the subprogram.

【0004】0004

【発明が解決しようとする課題】しかし、上述した従来
の最適化処理方式では、構文解析によって得られた中間
言語4と目的プログラム8との間に第一目的コード5が
介在するため、構文解析手段3とコード生成手段6とに
よる中間言語4の入出力処理と、コード生成手段6とイ
ンライン展開手段7とによる第一目的コード5の入出力
処理のためにオーバーヘッドが大きくなり、コンパイラ
の処理速度を低下させるという課題があった。また、イ
ンライン展開された後の目的コードが最適化されないた
めに、冗長な目的コードが生成されるという課題もあっ
た。
[Problems to be Solved by the Invention] However, in the conventional optimization processing method described above, since the first object code 5 is interposed between the intermediate language 4 obtained by syntax analysis and the object program 8, The overhead is large due to the input/output processing of the intermediate language 4 by the means 3 and the code generation means 6, and the input/output processing of the first object code 5 by the code generation means 6 and the inline expansion means 7, which reduces the processing speed of the compiler. The problem was to reduce the Furthermore, since the object code after inline expansion is not optimized, there is also the problem that redundant object code is generated.

【0005】本発明はこのような従来の問題に鑑みてな
されたものであり、一旦中間的な目的コードを生成する
ことなく、直接、中間言語をもとに関数の呼び出しをイ
ンライン展開するとともに、最適化処理をすることがで
きる最適化処理方式を提供することを目的とする。
The present invention has been made in view of such conventional problems, and it is possible to directly expand function calls inline based on an intermediate language without generating intermediate object code, and to The purpose of this invention is to provide an optimization processing method that can perform optimization processing.

【0006】[0006]

【課題を解決するための手段】上記の目的を達成するた
めに、本発明においては、ソースプログラムから目的プ
ログラムを生成するコンパイラにおいて、ソースプログ
ラムの構文を解析して記述言語や機種に依存しない中間
言語に翻訳する構文解析手段と、副プログラムの定義点
に対応する中間言語の位置情報を保持する副プログラム
定義点位置情報保持手段と、前記構文解析手段によって
生成された中間言語を中間ファイルに出力し、出力され
る中間言語が副プログラムの定義点に対応する場合は、
中間言語の位置情報を前記副プログラム定義点位置情報
保持手段に格納する中間言語出力手段と、中間ファイル
から読み込んだ中間言語が副プログラムの呼び出しに対
応する中間言語の場合は、読み込んだ中間言語を出力す
る中間言語入力手段と、この中間言語入力手段から受け
取った中間言語を前記副プログラム定義点位置情報保持
手段が保持している情報と照合し、呼び出す副プログラ
ムの定義点の位置情報および中間言語を出力する副プロ
グラム定義点照合手段と、この副プログラム定義点照合
手段から受け取った位置情報に基づいて得た副プログラ
ムの定義点に対応する中間言語を読み込み、その中に示
されている仮引数、および前記副プログラム定義点照合
手段から受け取った中間言語の中に示される実引数との
対応付けを行った中間言語を出力する引数対応付け手段
と、目的プログラムの大きさを節約し、かつ、実行速度
を高めるように中間言語を変形する最適化処理手段と、
この最適化処理手段によって変形された中間言語に基づ
いて目的コードから目的プログラムを生成するコード生
成手段とを有している。
[Means for Solving the Problems] In order to achieve the above object, in the present invention, a compiler that generates an object program from a source program analyzes the syntax of the source program to create an intermediate language that does not depend on the writing language or the machine type. A syntax analysis means for translating into a language, a subprogram definition point position information holding means for holding position information of an intermediate language corresponding to a definition point of a subprogram, and outputting the intermediate language generated by the syntax analysis means to an intermediate file. and if the output intermediate language corresponds to the definition point of the subprogram, then
intermediate language output means for storing the position information of the intermediate language in the subprogram definition point position information holding means; and if the intermediate language read from the intermediate file is an intermediate language corresponding to the call of the subprogram, The intermediate language input means to output and the intermediate language received from this intermediate language input means are compared with the information held by the subprogram definition point position information holding means, and the position information and intermediate language of the definition point of the subprogram to be called are determined. The intermediate language corresponding to the subprogram definition point obtained based on the position information received from this subprogram definition point matching means is read, and the formal argument shown therein is read. , and argument mapping means for outputting an intermediate language that is mapped with the actual argument indicated in the intermediate language received from the subprogram definition point matching means, and which saves the size of the target program, and an optimization processing means that transforms the intermediate language to increase execution speed;
and code generation means for generating a target program from the target code based on the intermediate language transformed by the optimization processing means.

【0007】[0007]

【作用】本発明はこのように構成されているので、一旦
中間的な目的コードを生成することなく、直接、中間言
語をもとに関数の呼び出しをインライン展開するととも
に、最適化処理をすることができる。
[Operation] Since the present invention is configured as described above, it is possible to directly expand function calls inline based on the intermediate language and perform optimization processing without first generating intermediate target code. Can be done.

【0008】[0008]

【実施例】以下本発明の実施例を図面によって説明する
。図1は本発明の一実施例における構成を示すブロック
図である。同図において、1はソースプログラム、2は
本発明の最適化処理方式を取り入れたコンパイラ、10
はソースプログラム1の構文を解析して記述言語や機種
に依存しない中間言語に翻訳する構文解析手段、11は
副プログラムの定義点に対応する中間言語の位置情報を
保持する副プログラム定義点位置情報保持手段、12は
構文解析手段10によって生成された中間言語を中間フ
ァイル18に出力する中間言語出力手段であって、副プ
ログラムの定義点に対応する中間言語を出力するときは
、中間言語の位置情報を副プログラム定義点位置情報保
持手段11に格納する。13は中間ファイル18から読
み込んだ中間言語が副プログラムの呼び出しに対応する
中間言語の場合、読み込んだ中間言語を副プログラム定
義点照合手段14に渡す中間言語入力手段、14は副プ
ログラム定義点位置情報保持手段11が保持している情
報と照合し、中間言語入力手段13から受け取った中間
言語が副プログラムの定義点に対応する中間言語の場合
は、呼び出す副プログラムの定義点の位置情報および中
間言語を引数対応付け手段15に渡す副プログラム定義
点照合手段、15は副プログラム定義点照合手段14か
ら受け取った位置情報に基づいて得た副プログラムの定
義点に対応する中間言語に示されている仮引数、および
副プログラム定義点照合手段14から受け取った中間言
語の中に示される実引数との対応付けを行い、最適化処
理手段16に中間言語を出力する引数対応付け手段、1
6は目的プログラム19の大きさを節約し、かつ、実行
速度を高めるように中間言語を変形する最適化処理手段
である。17は最適化処理手段16によって変形された
中間言語に基づいて目的コードから目的プログラム19
を生成するコード生成手段である。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Examples of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention. In the figure, 1 is a source program, 2 is a compiler incorporating the optimization processing method of the present invention, and 10 is a compiler incorporating the optimization processing method of the present invention.
11 is a syntactic analysis means that analyzes the syntax of the source program 1 and translates it into an intermediate language independent of the description language and machine type; 11 is subprogram definition point position information that holds position information of the intermediate language corresponding to the definition points of the subprogram; The holding means 12 is an intermediate language output means for outputting the intermediate language generated by the syntax analysis means 10 to the intermediate file 18, and when outputting the intermediate language corresponding to the definition point of the subprogram, the position of the intermediate language is The information is stored in the subprogram definition point position information holding means 11. 13 is an intermediate language input means for passing the read intermediate language to the subprogram definition point matching means 14 when the intermediate language read from the intermediate file 18 is an intermediate language corresponding to a subprogram call; 14 is subprogram definition point position information When the intermediate language received from the intermediate language input means 13 is the intermediate language corresponding to the definition point of the subprogram, the position information of the definition point of the subprogram to be called and the intermediate language are compared with the information held by the holding means 11. The subprogram definition point matching means 15 passes the subprogram definition point matching means 15 to the argument matching means 15, and the subprogram definition point matching means 15 passes the provisional information indicated in the intermediate language corresponding to the definition point of the subprogram obtained based on the position information received from the subprogram definition point matching means 14. Argument association means 1 for associating arguments with actual arguments indicated in the intermediate language received from the subprogram definition point collation means 14 and outputting the intermediate language to the optimization processing means 16;
6 is an optimization processing means that transforms the intermediate language so as to save the size of the target program 19 and increase the execution speed. 17 converts the object program 19 from the object code based on the intermediate language transformed by the optimization processing means 16.
This is a code generation means that generates.

【0009】次に、上記実施例の動作について詳細に説
明する。構文解析手段10がソースプログラム1の構文
を解析して記述言語や機種に依存しない中間言語に翻訳
し、中間言語出力手段12へ渡す。中間言語出力手段1
2は構文解析手段10から受け取った中間言語を中間フ
ァイル18に出力する。ただし、ソースプログラム1内
で定義されている副プログラムの定義点に対応する中間
言語を出力する場合は、中間ファイル18内におけるこ
の中間言語の位置情報を計算して、オフセットとして副
プログラム定義点位置情報保持手段11に格納する。副
プログラム定義点位置情報保持手段11は、中間言語出
力手段12から受け取った位置情報を副プログラム名と
一緒に保持する。中間言語入力手段13は中間ファイル
18から読み込んだ中間言語が副プログラムの呼び出し
に対応する中間言語でない場合は、読み込んだ中間言語
をそのまま最適化処理手段16に渡し、副プログラムの
呼び出しに対応する中間言語である場合は、読み込んだ
中間言語を副プログラム定義点照合手段14に渡す。次
に、副プログラム定義点照合手段14は副プログラム定
義点位置情報保持手段11が保持している副プログラム
名と位置情報とを照合し、中間言語入力手段13から受
け取った中間言語がソースプログラム1内で定義されて
いる副プログラムの定義点に対応する中間言語の場合は
、呼び出す副プログラムの定義点の位置情報および中間
言語を引数対応付け手段15に渡し、副プログラムの呼
び出しに対応する中間言語でない場合は、その中間言語
を最適化処理手段16に渡す。引数対応付け手段15は
副プログラム定義点照合手段14から受け取った位置情
報に基づいて中間ファイル18を探索し、副プログラム
の定義点に対応する中間言語を読み込み、その中に示さ
れている仮引数および副プログラム定義点照合手段14
から受け取った中間言語の中に示される実引数との対応
付けを行い、副プログラムの実体に対応する仮引数を実
引数に変換しながら最適化処理手段16に中間言語を出
力する。次に、最適化処理手段16は目的プログラム1
9の大きさを節約し、かつ、実行速度を高めるように中
間言語を変形する最適化処理を実施し、コード生成手段
17が最適化処理手段16によって変形された中間言語
に基づいて目的コードから目的プログラム19を生成す
る。
Next, the operation of the above embodiment will be explained in detail. A syntax analysis means 10 analyzes the syntax of the source program 1, translates it into an intermediate language independent of the writing language and model, and passes it to the intermediate language output means 12. Intermediate language output means 1
2 outputs the intermediate language received from the parsing means 10 to an intermediate file 18. However, when outputting an intermediate language corresponding to the definition point of the subprogram defined in the source program 1, the position information of this intermediate language in the intermediate file 18 is calculated and used as an offset to the subprogram definition point position. The information is stored in the information holding means 11. The subprogram definition point position information holding means 11 holds the position information received from the intermediate language output means 12 together with the subprogram name. If the intermediate language read from the intermediate file 18 is not the intermediate language corresponding to the subprogram call, the intermediate language input means 13 passes the read intermediate language as is to the optimization processing means 16, and outputs the intermediate language corresponding to the subprogram call. If it is a language, the read intermediate language is passed to the subprogram definition point matching means 14. Next, the sub-program definition point matching means 14 matches the sub-program name and position information held by the sub-program definition point position information holding means 11, and the intermediate language received from the intermediate language input means 13 is the source program 1. In the case of the intermediate language corresponding to the definition point of the subprogram defined in the subprogram, the intermediate language and the position information of the definition point of the subprogram to be called are passed to the argument mapping means 15, and the intermediate language corresponding to the subprogram call is passed to the argument mapping means 15. If not, the intermediate language is passed to the optimization processing means 16. The argument matching means 15 searches the intermediate file 18 based on the position information received from the subprogram definition point matching means 14, reads the intermediate language corresponding to the definition point of the subprogram, and stores the formal argument shown therein. and subprogram definition point verification means 14
The intermediate language is outputted to the optimization processing means 16 while converting the formal arguments corresponding to the entity of the subprogram into actual arguments. Next, the optimization processing means 16
9, the code generation means 17 executes an optimization process to transform the intermediate language so as to save the size of the code and increase the execution speed, and the code generation means 17 generates the target code from the target code based on the intermediate language transformed by the optimization processing means 16. A target program 19 is generated.

【0010】次に、図2乃至図7のプログラム例を参照
して、上記実施例の動作について具体的に説明する。図
2はFORTRAN言語で記述されたソースプログラム
の一部を示すリストである。副プログラムFUNCおよ
びCALCがサブルーチンとして定義され、副プログラ
ムFUNCが副プログラムCALCを呼ぶ入れ子構造に
なっている。
Next, the operation of the above embodiment will be specifically explained with reference to program examples shown in FIGS. 2 to 7. FIG. 2 is a list showing part of a source program written in the FORTRAN language. Subprograms FUNC and CALC are defined as subroutines, and have a nested structure in which subprogram FUNC calls subprogram CALC.

【0011】図3は図2に示したソースプログラム中の
副プログラムFUNCおよびCALCを、構文解析手段
10によって構文解析して得られた中間言語の一部を示
している。ここで、(1) は副プログラムFUNCの
定義点に対応する中間言語、(2)は副プログラムの呼
び出しの前後に出現する共通部分式の候補になる中間言
語、(3) は副プログラムCALCの呼び出しに対応
する中間言語、(4) は(2) と同様に共通部分式
の候補になる中間言語、(5) は副プログラムFUN
Cの定義の終了を示す中間言語、(6) は副プログラ
ムCALCの定義点に対応する中間言語、(7) は(
2) と同様に共通部分式の候補になる中間言語、(8
) は副プログラムCALCの定義の終了を示す中間言
語である。
FIG. 3 shows part of the intermediate language obtained by parsing the subprograms FUNC and CALC in the source program shown in FIG. 2 by the parsing means 10. Here, (1) is the intermediate language corresponding to the definition point of the subprogram FUNC, (2) is the intermediate language that is a candidate for the common subexpression that appears before and after the call of the subprogram, and (3) is the intermediate language of the subprogram CALC. The intermediate language corresponding to the call, (4) is the intermediate language that is a candidate for the common subexpression like (2), and (5) is the subprogram FUN.
The intermediate language that indicates the end of the definition of C, (6) is the intermediate language that corresponds to the definition point of the subprogram CALC, and (7) is (
2) Similarly, the intermediate language that is a candidate for the common subexpression, (8
) is an intermediate language that indicates the end of the definition of subprogram CALC.

【0012】図4はこれらの中間言語(1) から(8
) を含む中間言語群を中間言語出力手段12によって
出力した中間ファイル18の一例を示すリストである。 Pは副プログラムFUNCの定義点に対応する中間言語
(1)のファイルの先頭からのオフセット位置を、Qは
副プログラムCALCの定義点に対応する中間言語(6
) のファイルの先頭からのオフセット位置を示す。
FIG. 4 shows these intermediate languages (1) to (8
) is a list showing an example of an intermediate file 18 outputted by the intermediate language output means 12. P is the offset position from the beginning of the intermediate language (1) file that corresponds to the definition point of subprogram FUNC, and Q is the offset position from the beginning of the intermediate language (6) file that corresponds to the definition point of subprogram CALC.
) indicates the offset position from the beginning of the file.

【0013】中間言語入力手段13は上述のようにして
作成された中間ファイル18から読み込んだ中間言語を
、順次最適化処理手段16へ出力する。副プログラムの
呼び出しに対応する中間言語(3) を読み込むと、副
プログラムを呼び出すために副プログラム定義点照合手
段14に中間言語(3) を渡す。
The intermediate language input means 13 sequentially outputs the intermediate language read from the intermediate file 18 created as described above to the optimization processing means 16. When the intermediate language (3) corresponding to the subprogram call is read, the intermediate language (3) is passed to the subprogram definition point checking means 14 in order to call the subprogram.

【0014】副プログラム定義点照合手段14はこの中
間言語(3) と副プログラム定義点位置情報保持手段
11に格納されている位置情報とを照合する。この位置
情報を与えるテーブルは、例えば図5に示すように、副
プログラム名21、副プログラム属性22、引数個数2
3、引数名24、中間ファイル内オフセット25などか
ら構成されている。副プログラムCALCを呼び出す中
間言語(3) とテーブルを照合し、副プログラムCA
LCを定義している中間言語(6) の中間ファイル内
オフセット25から位置Qを得て、中間言語(3) と
ともに引数対応付け手段15に渡す。
The sub-program definition point matching means 14 matches this intermediate language (3) with the position information stored in the sub-program definition point position information holding means 11. For example, as shown in FIG.
3, an argument name 24, an offset within the intermediate file 25, etc. Check the table with the intermediate language (3) that calls the subprogram CALC, and execute the subprogram CALC.
The position Q is obtained from the offset 25 in the intermediate file of the intermediate language (6) that defines the LC, and is passed to the argument matching means 15 together with the intermediate language (3).

【0015】引数対応付け手段15は中間ファイル18
の先頭からオフセットQの位置にある中間言語(6) 
を読み込み、中間言語(3) に示される実引数と中間
言語(6) に示される仮引数の対応付けを行い、副プ
ログラムCALCの定義を終了する中間言語(8) が
出現するまで中間ファイル18より中間言語を順次読み
込んで、仮引数を実引数に変換しながら最適化処理手段
16に渡す。中間言語(8) を最適化処理手段16に
渡し終えると、中間言語入力手段13に制御が戻され、
中間言語(3)の後に続く中間言語が中間ファイル18
から読み込まれて以下同様に処理され、図6に示すイン
ライン展開された中間言語が得られる。同図の中間言語
(9) 、(10)、および(11)はそれぞれ中間言
語(2) 、(7) および(4) をインライン展開
したものである。
The argument mapping means 15 is an intermediate file 18
intermediate language (6) at offset Q from the beginning of
The intermediate file 18 is read in, matches the actual arguments shown in the intermediate language (3) with the formal arguments shown in the intermediate language (6), and continues until the intermediate language (8) that completes the definition of the subprogram CALC appears. The intermediate language is sequentially read and the formal arguments are converted into actual arguments and passed to the optimization processing means 16. After passing the intermediate language (8) to the optimization processing means 16, control is returned to the intermediate language input means 13,
The intermediate language that follows intermediate language (3) is intermediate file 18
The intermediate language is read from and processed in the same manner as shown in FIG. 6 to obtain the inline-expanded intermediate language shown in FIG. Intermediate languages (9), (10), and (11) in the figure are inline expansions of intermediate languages (2), (7), and (4), respectively.

【0016】最適化処理手段16は中間言語(2) 、
(4) および(7) の共通部分式を認識して不要な
中間言語を削除し、図7に示すような最適化された中間
言語を生成する。
The optimization processing means 16 is an intermediate language (2),
The common subexpressions of (4) and (7) are recognized, unnecessary intermediate language is deleted, and an optimized intermediate language as shown in FIG. 7 is generated.

【0017】コード生成手段17はこのインライン展開
後最適化された中間言語に基づいて目的コードを生成し
、目的プログラム19に出力する。
The code generation means 17 generates a target code based on the optimized intermediate language after inline expansion, and outputs it to the target program 19.

【0018】したがって、以上のような実施例の構成に
よれは、コンパイル時の関数のインライン展開と最適化
処理を効率的に実行することができる。
Therefore, with the configuration of the embodiment as described above, it is possible to efficiently perform inline expansion of functions and optimization processing at the time of compilation.

【0019】[0019]

【発明の効果】以上説明したように、本発明によれば、
コンパイラの処理速度を向上させてプログラムの開発効
率を高めることに寄与すると同時に、目的プログラムの
大きさを縮小してプログラムの実行速度を向上させるこ
とができるという効果がある。
[Effects of the Invention] As explained above, according to the present invention,
This has the effect of improving the processing speed of the compiler and contributing to increasing the efficiency of program development, and at the same time reducing the size of the target program and improving the execution speed of the program.

【図面の簡単な説明】[Brief explanation of the drawing]

【図1】本発明の一実施例における構成を示すブロック
FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention.

【図2】ソースプログラムの一部を示すリスト[Figure 2] List showing part of the source program

【図3】
中間言語の一部を示すリスト
[Figure 3]
List showing some of the intermediate languages

【図4】中間言語の一部を示すリスト[Figure 4] List showing some intermediate languages

【図5】副プログラム定義点位置情報の格納状態を示す
説明図
[Fig. 5] Explanatory diagram showing the storage state of subprogram definition point position information

【図6】インライン展開した中間言語の一部を示すリス
[Figure 6] List showing part of the intermediate language expanded inline

【図7】最適化処理をした中間言語の一部を示すリスト
[Figure 7] List showing part of the intermediate language that has undergone optimization processing

【図8】従来のコンパイラの構成図[Figure 8] Configuration diagram of a conventional compiler

【符号の説明】[Explanation of symbols]

1    ソースプログラム 2    コンパイラ 10    構文解析手段 11    副プログラム定義点位置情報保持手段12
    中間言語出力手段 13    中間言語入力手段 14    副プログラム定義点照合手段15    
引数対応付け手段 16    最適化処理手段 17    コード生成手段 18    中間ファイル 19    目的プログラム
1 Source program 2 Compiler 10 Syntax analysis means 11 Subprogram definition point position information holding means 12
Intermediate language output means 13 Intermediate language input means 14 Subprogram definition point comparison means 15
Argument association means 16 Optimization processing means 17 Code generation means 18 Intermediate file 19 Target program

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】  ソースプログラムから目的プログラム
を生成するコンパイラにおいて、ソースプログラムの構
文を解析して記述言語や機種に依存しない中間言語に翻
訳する構文解析手段と、副プログラムの定義点に対応す
る中間言語の位置情報を保持する副プログラム定義点位
置情報保持手段と、前記構文解析手段によって生成され
た中間言語を中間ファイルに出力し、出力される中間言
語が副プログラムの定義点に対応する場合は、中間言語
の位置情報を前記副プログラム定義点位置情報保持手段
に格納する中間言語出力手段と、中間ファイルから読み
込んだ中間言語が副プログラムの呼び出しに対応する中
間言語の場合は、読み込んだ中間言語を出力する中間言
語入力手段と、この中間言語入力手段から受け取った中
間言語を前記副プログラム定義点位置情報保持手段が保
持している情報と照合し、呼び出す副プログラムの定義
点の位置情報および中間言語を出力する副プログラム定
義点照合手段と、この副プログラム定義点照合手段から
受け取った位置情報に基づいて得た副プログラムの定義
点に対応する中間言語を読み込み、その中に示されてい
る仮引数、および前記副プログラム定義点照合手段から
受け取った中間言語の中に示される実引数との対応付け
を行った中間言語を出力する引数対応付け手段と、目的
プログラムの大きさを節約し、かつ、実行速度を高める
ように中間言語を変形する最適化処理手段と、この最適
化処理手段によって変形された中間言語に基づいて目的
コードから目的プログラムを生成するコード生成手段と
を含むことを特徴とする最適化処理方式。
Claim 1: A compiler that generates a target program from a source program, comprising: a syntax analysis means for analyzing the syntax of the source program and translating it into an intermediate language that is independent of the description language and machine type, and an intermediate language corresponding to the definition points of the subprogram. outputting the intermediate language generated by the subprogram definition point position information holding means for holding language position information and the syntax analysis means to an intermediate file, and when the output intermediate language corresponds to the definition point of the subprogram; , an intermediate language output means for storing the position information of the intermediate language in the subprogram definition point position information holding means; and, if the intermediate language read from the intermediate file is an intermediate language corresponding to the call of the subprogram, the read intermediate language; An intermediate language input means that outputs the intermediate language, and the intermediate language received from the intermediate language input means is checked against the information held by the subprogram definition point position information holding means, and the intermediate language and the position information of the definition point of the subprogram to be called are compared with the information held by the subprogram definition point position information holding means. A subprogram definition point matching means that outputs the language reads the intermediate language corresponding to the definition point of the subprogram obtained based on the position information received from this subprogram definition point matching means, and reads the temporary language shown therein. Argument mapping means for outputting an intermediate language that is mapped with arguments and actual arguments indicated in the intermediate language received from the subprogram definition point matching means; , comprising an optimization processing means for transforming an intermediate language so as to increase execution speed, and a code generation means for generating a target program from a target code based on the intermediate language transformed by the optimization processing means. Optimization processing method.
JP11908891A 1991-04-24 1991-04-24 Optimizaltion processing system Pending JPH04323730A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11908891A JPH04323730A (en) 1991-04-24 1991-04-24 Optimizaltion processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11908891A JPH04323730A (en) 1991-04-24 1991-04-24 Optimizaltion processing system

Publications (1)

Publication Number Publication Date
JPH04323730A true JPH04323730A (en) 1992-11-12

Family

ID=14752598

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11908891A Pending JPH04323730A (en) 1991-04-24 1991-04-24 Optimizaltion processing system

Country Status (1)

Country Link
JP (1) JPH04323730A (en)

Similar Documents

Publication Publication Date Title
JP2811990B2 (en) Program processing device and program processing method
US5606697A (en) Compiler system for language processing program
JP2602205B2 (en) Database access control method
US7823139B2 (en) Method and system for translating programming languages
JPH04247536A (en) Computer software compile system assisting discrimination of data type at time of execution of object
US20230367569A1 (en) Method of generating a representation of a program logic, decompilation apparatus, recompilation system and computer program products
JPH04323730A (en) Optimizaltion processing system
Hannan et al. Higher-order arity raising
JPH07121379A (en) Plural languages mixing compiler
JP2977642B2 (en) FORTRAN compilation processor
KR0169909B1 (en) Method for designing assembly code generator for target processor
JP3226172B2 (en) Inline expansion system
JPH0414144A (en) Compiling processing method
JP3018783B2 (en) Compilation method
CN117992183A (en) Event response method, system, electronic equipment and storage medium
JPH0561687A (en) Processing system for compiler
JP2585790B2 (en) Compile processing method for multiple code systems
JPH0373025A (en) Source program shaping compile system
JP2001034482A (en) Compile device, program optimizing device, compile processing method and recording medium
JPH04343140A (en) Parallelized processing system
JPS6074039A (en) Recognition processing system of compiler language
JPH05313909A (en) Compiler system containing intermediate code line evolving function
JPH0126091B2 (en)
JPH01128136A (en) Compiling process system
JPH0259823A (en) Compiling process system