JPS61264441A - Compiling system - Google Patents

Compiling system

Info

Publication number
JPS61264441A
JPS61264441A JP10598385A JP10598385A JPS61264441A JP S61264441 A JPS61264441 A JP S61264441A JP 10598385 A JP10598385 A JP 10598385A JP 10598385 A JP10598385 A JP 10598385A JP S61264441 A JPS61264441 A JP S61264441A
Authority
JP
Japan
Prior art keywords
program
subroutine
source program
function
source
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
JP10598385A
Other languages
Japanese (ja)
Inventor
Jun Sawamoto
沢本 潤
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP10598385A priority Critical patent/JPS61264441A/en
Publication of JPS61264441A publication Critical patent/JPS61264441A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To reduce the overhead phenomenon produced when a main program is processed by the direct in-line development of a logic part of a related subroutine program to the subroutine call area of the corresponding main program. CONSTITUTION:The #1 source program 24 serving as a main program and its related subroutine program 25 are stored in an external storage device 22. While an object program 26 of the machine word that performed the direct in-line development of the logic part of the program 25 to a prescribed area of the program 24 is stored in the device 22. Then the device 22 storing programs 24 and 25 and the device 22 storing the program 26 are connected to a compiler 21 respectively. While the device 22 storing a load module 27 and the device 22 storing the program 26 are connected to a linkage editor 23. In such a way, both the pre-processing and the after-processing can be omitted with a subroutine program.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明ij、=rンパイル処理方式に関するものであ
シ、特に、高位言語によるソースプログラムであって所
定のサブルーチン(関数)コール機能を備えたものを機
械語によるオブジェクトプログラムに変換するためのコ
ンパイル処理方式に関するものである。
[Detailed Description of the Invention] [Field of Industrial Application] This invention relates to a pile processing method, and is particularly concerned with a source program written in a high-level language and equipped with a predetermined subroutine (function) call function. It relates to a compilation processing method for converting something into an object program written in machine language.

〔従来の技術〕[Conventional technology]

第q図は、従来のコンパイル処理方式を説明するための
概略図である。この第グ図において、(/1はコンパイ
ラ、(コ)は外部記憶装置、(3)はリンケージエディ
タである。そして、前記外部記憶装置−)に保持される
ものは、 fA、fBンースプログラム(+’l 、 
(71、これらに対応する機械語の/A、 /Bオブジ
ェクトプログラム(A) 、 (’71 、および、前
記オブジェクトプログラムを編集して作成されるロード
モジュール+fflである。
FIG. q is a schematic diagram for explaining a conventional compilation processing method. In this diagram, (/1 is the compiler, (c) is the external storage device, and (3) is the linkage editor. And what is held in the external storage device -) are the fA, fB base programs. (+'l,
(71, /A, /B object programs (A), ('71) in machine language corresponding to these, and a load module +ffl created by editing the object program.

第5図は、上記従来方式によるロードモジュール+ff
lの概略図である。この第5図において、(?)は生プ
ログラム、 (10)はサブルーチン(関数)プログラ
ムであって前記生プログラム(り)によってコールされ
るもの、(//)は主プログラム(デ)K設けられてい
るサブルーチン(関数)コール文、(/コ)。
Figure 5 shows the load module +ff according to the above conventional method.
FIG. In this Figure 5, (?) is a raw program, (10) is a subroutine (function) program that is called by the raw program (ri), and (//) is a main program (de)K provided. subroutine (function) call statement, (/ko).

(/3)、(ハ・は、いずれも、?ブルーチン(関数)
プログラム(/Q)内の論理処理部であ夛、その中で、
(/2)はレジスタセーブ、パラメータ取シ込み等のた
めの前処理部、(/、7)はサブルーチン(関数)プロ
グラム(/Q)の本来的な処理のためのロジック部、(
ハ0はレジスタリストア、パラメータ戻し等のための後
処理部である。
(/3), (Ha, are both ?Broutine (function)
In the logic processing section of the program (/Q),
(/2) is a preprocessing section for saving registers, importing parameters, etc., (/, 7) is a logic section for the original processing of a subroutine (function) program (/Q), (
C0 is a post-processing unit for restoring registers, returning parameters, etc.

次に、上記された従来方式の動作について説明する。外
部記憶装置(2)に格納されている一A、IBソースプ
ログラム体1 s (t)は、コンパイラ(1)におい
て所定のコンパイル処理がなされ、夫々に独立して対応
する機械語のlA、lBオブジェクトプロfラム(41
、(り)が生成される。こ\で、IAンースプログラム
(りはいわゆる主プログラムであシ、これに対し、/B
ソースプログラム(!]はある所定のサブルーチン(関
数)プログラムであるものとする。
Next, the operation of the above conventional method will be explained. The 1A, IB source program body 1s (t) stored in the external storage device (2) is subjected to a predetermined compilation process by the compiler (1), and is independently compiled into corresponding machine language 1A, 1B. Object program f program (41
, (ri) are generated. Here, the IA base program (RI is the so-called main program, whereas /B
It is assumed that the source program (!) is a certain predetermined subroutine (function) program.

そして、このようにして生成された機械語のlA。Then, the machine language lA generated in this way.

IBオブジェクトプログラム(A) 、 (り)はリン
ケージエディタ(3)によって所定の編集がなされ、第
5図に示されているような構成のロードモジュール(1
)が生成される。この第3図において、主プログラム(
デ)内のサブルーチン(関数)コール(//)によシサ
ブルーチン(関数)プログラム(10)へのブランチが
なされる。そして、その前処理部(/コ)において、主
プログラム(テ)から送らhる所要のノくラメータの取
シ込みやある所定のレジスタセーブ等の前処理がなされ
1次いで、ロジック部(/3)において、このサブルー
チン(関数)プログラム(10)としての本来的な論理
機能に基づく処理操作がなされる。そして、後処理部(
lq)において、前記論理機能に基づく処理操作の結果
として送り返す関数筐のセラトラしたシ、前記セーブし
たレジスタのりストアをしたシする後処理の操作がなさ
れる。この後処理操作の後で、主プログラム(テ)のサ
ブルーチン(関数)コール(/l)に戻シ、前記主プロ
グラム(デ)による操作が続行されることになる。
The IB object programs (A) and (RI) are edited in a specified manner by a linkage editor (3), and a load module (1) having the configuration shown in FIG.
) is generated. In this Figure 3, the main program (
A branch is made to the subroutine (function) program (10) by the subroutine (function) call (//) in (d). Then, in the preprocessing section (/), preprocessing such as importing the required parameters sent from the main program (TE) and saving certain registers is performed. Next, the logic section (/3) ), processing operations are performed based on the inherent logical functions of this subroutine (function) program (10). Then, the post-processing section (
In lq), post-processing operations are performed to reset the function box to be sent back as a result of the processing operation based on the logical function, and to store the saved register. After this post-processing operation, a return is made to the subroutine (function) call (/l) of the main program (TE), and the operation by the main program (DE) is continued.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上記された従来のコンパイル処理方式によれば、サブル
ーチン(関数)プログラムに対してブランチ操作をする
ようにされていることから、使用メモリサイズの効率が
よくなるという利点はあるけれど吃、サブルーチン(関
数)コールをする主プログラム側では諸種のパラメータ
設定管する必要があること、および、サブルーチン(関
数)プログラム側では本来的な論理機能に基づく処理操
作に加えて、その前処理ならびに後処理の操作をする必
要があることのために、主プログラムの実行処理のとき
のオーバヘッドが多くなフ、その実行性能の向上が阻害
されるという問題点があった。
According to the conventional compilation processing method described above, branch operations are performed on subroutine (function) programs, which has the advantage of improving the efficiency of the memory size used. The main program that makes the call must manage various parameter settings, and the subroutine (function) program must perform pre-processing and post-processing operations in addition to processing operations based on the original logical functions. Because of this necessity, there is a problem in that there is a lot of overhead when executing the main program, which impedes improvement in its execution performance.

この発明は上記された問題点を解決するためになされた
ものであって、関連するサブルーチン(関数)プログラ
ムの本来的なロジック部を、対応スル主プログラムのサ
ブルーチン(関数)コールの個所に直接的にインライン
展開をすることが選択的に可能にされたコンパイル処理
方式を提供することをその目的とするものである。
This invention was made in order to solve the above-mentioned problems, and the original logic part of the related subroutine (function) program is directly placed at the subroutine (function) call point of the corresponding main program. The purpose of this is to provide a compilation processing method that selectively enables inline expansion of files.

〔間辿点を解決するための手段〕[Means for resolving intervening points]

この発明に係るコンパイル処理方式は、サブルーチン(
関数)コール機能を備えた高位言語によるソースプログ
ラムを対応する機械語によるオブジェクトプログラムに
変換するためのものであって、主プログラムとしてのソ
ースプログラム内でサブルーチン(関数)プログラムと
してのソースプログラムをインライン展開させて所望の
オブジェクトプログラムを生成させるために、前記主プ
ログラムとしてのソースプログラムの中で所定の指示を
与えておくようにされたものである。
The compilation processing method according to the present invention includes a subroutine (
This is for converting a source program in a high-level language with a function) call function into a corresponding object program in machine language, and inline expansion of the source program as a subroutine (function) program within the source program as the main program. In order to generate a desired object program, a predetermined instruction is given in the source program as the main program.

〔作 用〕[For production]

この発明によれば、所定の指示を与えられているサブル
ーチン(関数)プログラムとしてのソースプログラムだ
けが、主プログラムとしてのソースプログランの中で選
択的にインライン展開される。
According to this invention, only a source program as a subroutine (function) program to which a predetermined instruction has been given is selectively developed inline within a source program as a main program.

〔実施例〕〔Example〕

以下、この発明の実施例方式を第7図ないし第3図につ
いて説明する。先ず、第1図は、この発明の実施例方式
を説明するための概略図である、この第1図において、
(期はこの実施例で使用されるコンパイラ、(ココ)は
外部記憶装置、(コ3)はリンケージエディタである。
Hereinafter, an embodiment of the present invention will be explained with reference to FIGS. 7 to 3. First, FIG. 1 is a schematic diagram for explaining an embodiment of the present invention.
(3) is the compiler used in this example, (here) is the external storage device, and (3) is the linkage editor.

そして、前記外部記憶装置(コ2)に保持されるものは
、i/、lコソースプログラム(コa)、(2!r)、
ソのコンパイル処理の結果としての機械語のオブジェク
トプログラム(21,)なラヒにロードモジュール(コ
ク)である。こ\で、l/ソースプログラム(コグ)は
主プログラムであシ、12ソースプログラム(コ3)は
これに関連する所定のサブルーチン(関数)プログラム
である。また1機械語のオブジェクトプログラム(26
)は、前記−ユソースプログラム(コ、8″)がl/ソ
ースプログラム(tlI)の所定個所にインライン展開
されているものである。第2図は、これら−/、−一ノ
ースプログラム(2弘)、(ユりの例示図であシ、tた
。!、7図は、オブジェクトプログラム(コロ)のソー
スプログラム形式による例示図である。そして、この第
3図には、l/ソースプログラム(2弘)の所定個所に
Iコンースプログラム(コ5)の本来的なロジック部が
インライン展開されたものが例示されている。
What is held in the external storage device (co 2) is i/, l co source program (co a), (2! r),
This is a machine language object program (21,) as a result of the compilation process of the software, and a load module (Koku). Here, the l/source program (cog) is the main program, and the 12 source program (co3) is a predetermined subroutine (function) program related to this. Also, 1 machine language object program (26
) is the -U source program (ko, 8'') expanded inline at a predetermined location in the l/source program (tlI). Figure 2 shows these -/, -1 north programs (2 Figure 7 is an example diagram of an object program (Koro) in source program format. An example is shown in which the original logic part of the I-conce program (5) is expanded inline at a predetermined location in (2).

いま、l/ソースプログラム(2弘)から、サブルーチ
ン(関数)プログラムとしてFUNC(x、y)で表わ
されているfコソースプログラム(25)に対するコー
ルがされているものとする。前記l/ソースプログラム
(コtl)には本@ FUNCなる指示が与えられてお
シ、これによって、前記t2ンースプログラム(2r)
の本来的なロジック部は、前記l/ソースプログラム(
2弘)の中でインライン展開されるようなコンパイル処
理が施される。また、上記された本8 FUNCなる指
示が与えられていないときには、従来と同様なブランチ
命令の作成がなされる。上記のようにインライン展開を
指示された12ンースプログラム(コ3)は外部記憶装
置(22)から検索されて、l/ソースプログラム(お
00所定個所でマージされる。すなわち。
It is now assumed that a call is being made from the l/source program (2hiro) to the fcosource program (25), which is represented by FUNC(x,y) as a subroutine (function) program. The t2 source program (2r) is given the instruction Book@FUNC to the t2 source program (2r).
The original logic part of the above l/source program (
Compilation processing is performed such that inline expansion is performed in 2hiro). Further, when the above-mentioned FUNC instruction is not given, a branch instruction is created in the same way as in the conventional case. The 12th source program (3) instructed to be expanded inline as described above is retrieved from the external storage device (22) and merged at a predetermined location with the l/source program (00).

−/ソースプログラム(2q)内のa = FUNC(
b、c)なるステップはlコソースプログラム(コりで
展開されているサブルーチン(関数)プログラム内の本
来的なロジック部で置換される。このとき、前記サブル
ーチン(関数)プログラム内の変数(X。
−/a in source program (2q) = FUNC(
Steps b and c) are replaced with the original logic part of the subroutine (function) program developed in the l co-source program. At this time, the variables (X .

y)はある所定の定数(b p c )で置換される。y) is replaced by a certain predetermined constant (bpc).

さらに、ある定数(dのように、l/ソースプログラム
(オ弓およびt2ンースプログラム(23)の双方で相
互に別異の意味をもって使用されている場合には、それ
らの間での衝突や混乱が発生することを避けるために、
Iコンースプログラム(コク)内での前記定数(dlは
d■FUNCのような特有な表現に変更され、また、こ
のI、2ソースプログラム(2よ)内のF U N C
= x + yなるステップは所定の定数によるB =
 t) + cなる表現によるものに変更される。この
ようにして、この発明の実施例によれば、サブルーチン
(関数)プログラムの本来的なロジック部を、これを必
要とする主プログラム内でインライン展開することによ
シ、当該すプルーチy(Xfi)プログラムについての
所定の前処理や後処理の操作が不要となシ、オーツくヘ
ッドがそれぞけ少なくなる。
Furthermore, if a certain constant (such as d) is used with different meanings in both the source program and the t2 source program (23), conflicts between them may occur. To avoid confusion,
The constant (dl) in the I concourse program (Koku) is changed to a unique expression such as d■FUNC, and the F U N C in this I,2 source program (2yo)
= x + y step is determined by a predetermined constant B =
t) + c. In this way, according to the embodiment of the present invention, the original logic part of a subroutine (function) program is expanded inline within the main program that requires it, and the ) Predetermined pre-processing and post-processing operations for programs are not required, and the number of automatic heads is reduced.

〔発明の効果〕〔Effect of the invention〕

以上説明されたように、この発明によれば、所定の指示
を与えておくことによって、主プログラムとしてのソー
スプログラムの中で所望のサブルーチン(関数)プログ
ラムとしてのソースプログラムを選択的にインライン展
開できるようにされておシ、また。前記サブルーチン(
関数)プログラムの中の本来的なロジック部だけが前記
インライン展開の対象とされていることから、オーツく
ヘッドが少なくなると共に、メモリの使用効率およびそ
の実行効率の両面で最も好都合なプログラム生成がなさ
れるという効果がある。
As described above, according to the present invention, by giving a predetermined instruction, a source program as a desired subroutine (function) program can be selectively expanded inline in a source program as a main program. That's what happened, again. The subroutine (
Since only the original logic part of the function (function) program is subject to the inline expansion, the number of heads automatically decreases, and the most convenient program generation is possible in terms of both memory usage efficiency and execution efficiency. It has the effect of being done.

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

第7図は、この発明の実施例方式を説明するための概略
図、第2図は、上記実施例におけるソースプログラムの
例示図、第3図は、上記実施例で生成されたオブジェク
トプログラムのソースプログラム形式による例示図、第
7図は、この種の従来例方式を説明するための概略図、
第3図は、上記従来例方式によるロードモジュールの概
略図である。 (,2/)はコンパイラ、(ココ)は外部記憶装置。 (23)はリンケージエディタ、(2グ)、(ユj)は
1/、−一ソースプログラム、(コロ)はオブジェクト
フログラム、(27)はロードモジュール。 なお、各図中、同一符号は同−又は相当部分を示す。
FIG. 7 is a schematic diagram for explaining an embodiment system of the present invention, FIG. 2 is an illustrative diagram of a source program in the above embodiment, and FIG. 3 is a source program of an object program generated in the above embodiment. An illustrative diagram in a program format, FIG. 7 is a schematic diagram for explaining this type of conventional example system,
FIG. 3 is a schematic diagram of a load module according to the conventional method described above. (,2/) is the compiler, and (here) is the external storage device. (23) is a linkage editor, (2g), (yuj) are 1/, -1 source program, (coro) is an object program, and (27) is a load module. In each figure, the same reference numerals indicate the same or corresponding parts.

Claims (2)

【特許請求の範囲】[Claims] (1)サブルーチンコール機能を備えた高位言語による
ソースプログラムを対応する機械語によるオブジェクト
プログラムに変換するためのコンパイル処理方式であつ
て、主プログラムとしてのソースプログラム内でサブル
ーチンプログラムとしてのソースプログラムをインライ
ン展開させて所望のオブジェクトプログラムを生成させ
るために、前記主プログラムとしてのソースプログラム
内で所定の指示を与えておくことにより前記インライン
展開が選択的に可能にされたことを特徴とするコンパイ
ル処理方式。
(1) A compilation processing method for converting a source program in a high-level language with a subroutine call function into a corresponding object program in machine language, in which the source program as a subroutine program is inlined within the source program as the main program. A compiling processing method characterized in that the inline expansion is selectively enabled by giving a predetermined instruction in the source program as the main program in order to generate a desired object program by expansion. .
(2)前記サブルーチンプログラムとしてのソースプロ
グラムの中の本来的なロジック部のみが前記インライン
展開の対象にされることを特徴とする特許請求の範囲第
1項記載のコンパイル処理方式。
(2) The compile processing method according to claim 1, wherein only the original logic section in the source program as the subroutine program is subjected to the inline expansion.
JP10598385A 1985-05-20 1985-05-20 Compiling system Pending JPS61264441A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10598385A JPS61264441A (en) 1985-05-20 1985-05-20 Compiling system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10598385A JPS61264441A (en) 1985-05-20 1985-05-20 Compiling system

Publications (1)

Publication Number Publication Date
JPS61264441A true JPS61264441A (en) 1986-11-22

Family

ID=14421976

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10598385A Pending JPS61264441A (en) 1985-05-20 1985-05-20 Compiling system

Country Status (1)

Country Link
JP (1) JPS61264441A (en)

Similar Documents

Publication Publication Date Title
US6292940B1 (en) Program complete system and its compile method for efficiently compiling a source program including an indirect call for a procedure
JP3802058B2 (en) System, method and compiler preprocessor for conditionally compiling software compilation units
US5581769A (en) Multipurpose program object linkage protocol for upward compatibility among different compilers
US20010039653A1 (en) Program conversion method, program conversion apparatus, storage medium for storing program conversion program and program conversion program
US5404531A (en) Method and apparatus for compiler processing on program related to data transfer and calculation, and method of managing memory
KR0125605B1 (en) Method and device for verifying operation of machine language program
JP2008305337A (en) Program converter, program conversion method, program, storage medium, debugging device, debugging method and program development system
JPH01277934A (en) Switching system for parameter list reference method
JPS61264441A (en) Compiling system
JPH0683597A (en) Object oriented program development device and object oriented program development method
JPS6022373B2 (en) Program conversion mechanism for programmable control equipment
KR20060092728A (en) Method for elevating compile speed through reduction of file searching time in pre-process
CN112579088A (en) Heterogeneous hybrid programming-oriented one-stop program compiling method
JPH02207325A (en) Automatic source program generating system
JPH09274570A (en) Compile method and compiler system
JPH09152974A (en) Basic software loading method
KR100293932B1 (en) A technology for post image processig of compiled s/w code
JPH0126091B2 (en)
Pilavakis et al. C Language Program Execution
JPH05120025A (en) Inline development method for source program
JPH0358232A (en) Preprocessor calling system
JPS62137641A (en) High-grade language compiler
JPH0553827A (en) Dynamic link optimizing system
JPH0675757A (en) Link system for virtual space resident program
JPH07192034A (en) Interpreter type simulation method