JPH09330232A - Dynamic storage allocation method - Google Patents
Dynamic storage allocation methodInfo
- Publication number
- JPH09330232A JPH09330232A JP8168634A JP16863496A JPH09330232A JP H09330232 A JPH09330232 A JP H09330232A JP 8168634 A JP8168634 A JP 8168634A JP 16863496 A JP16863496 A JP 16863496A JP H09330232 A JPH09330232 A JP H09330232A
- Authority
- JP
- Japan
- Prior art keywords
- storage area
- live range
- dynamic storage
- information
- program
- 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
Links
- 238000000034 method Methods 0.000 title claims description 17
- 238000012545 processing Methods 0.000 claims description 24
- 230000006870 function Effects 0.000 claims description 15
- 238000001514 detection method Methods 0.000 abstract description 10
- 238000010586 diagram Methods 0.000 description 19
- 238000007796 conventional method Methods 0.000 description 3
- 230000033001 locomotion Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 238000012790 confirmation Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
Landscapes
- Devices For Executing Special Programs (AREA)
- Memory System (AREA)
Abstract
(57)【要約】
【課題】動的な記憶域の確保・解放の為の記憶域管理ラ
イブラリの呼出しを削減させることによりライブラリ呼
出し及び動的記憶域管理機構によるオーバヘッドを減少
させる。
【解決手段】確保する記憶域のサイズがプログラム翻訳
時に判明する動的な記憶域の確保要求を検出し確保要求
に対し返却された記憶域を識別するポインタ値に関する
データフローとプログラムの制御フローを解析し確保さ
れた記憶域の生存区間を検出する生存区間検出手段と検
出された複数の動的記憶域の生存区間の重複を検査する
生存区間重複検査手段と生存区間重複検査手段により判
明した生存区間の重複状況を考慮して同一の記憶域を共
有可能な一つ以上の動的記憶域をグループ化する手段と
同一グループに属する動的記憶域の確保・解放の要求を
無効としグループの先頭で確保された記憶域を共有して
利用するようプログラムを変更する手段を備える。
(57) Abstract: The overhead of a library call and a dynamic storage management mechanism is reduced by reducing calls of a storage management library for dynamically securing and releasing a storage area. A data flow regarding a pointer value for identifying a storage area returned in response to a dynamic storage area reservation request in which the size of the reserved storage area is known at the time of program translation and a control flow of the program. The live range detection means for detecting the live range of the analyzed and secured storage area, and the live range duplication checking means for checking the duplication of the live ranges of the plurality of detected dynamic storage areas and the live range found by the live range duplication checking means Considering the duplication status of existing sections, a means for grouping one or more dynamic storage areas that can share the same storage area, and invalidating the request to secure / release dynamic storage areas belonging to the same group Means are provided for changing the program so that the storage area secured at the beginning is shared and used.
Description
【0001】[0001]
【発明の属する技術分野】本発明は、情報処理装置の言
語処理系に関し、特に言語処理系の動的記憶域割り付け
方式に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a language processing system of an information processing apparatus, and more particularly to a dynamic storage area allocation system of the language processing system.
【0002】[0002]
【従来の技術】この種の従来技術として、例えば特開昭
63−226750号公報には、動的な記憶域の割り付
けに際して、指定したメモリ容量の割当てが受けられな
い時に、割当て可能な最大のメモリ容量を2分探索法を
用いて求め、再割当てを受けて、大容量のメモリを確保
することによって処理の迅速化を図るようにした動的メ
モリ確保方式が提案されている。2. Description of the Related Art As a conventional technique of this kind, for example, Japanese Patent Laid-Open No. 63-226750 discloses a maximum allocation that can be made when a specified memory capacity cannot be allocated when allocating a dynamic storage area. A dynamic memory reservation method has been proposed in which the memory capacity is obtained by using the binary search method, and is re-allocated to secure a large capacity memory to speed up the processing.
【0003】そして、上記公報以外の従来技術において
も、動的記憶域の割り付けの処理効率を改善する方式と
して、プログラムからの記憶域割り付け要求に対する処
理方式を改善するアプローチのみにとどまっているとい
うのが実状である。Also, in the prior arts other than the above publication, the only method for improving the processing efficiency of dynamic storage area allocation is to improve the processing method for storage area allocation requests from programs. Is the actual situation.
【0004】[0004]
【発明が解決しようとする課題】すなわち、従来の動的
記憶域の割り付け方式においては、記憶域の確保・解放
の処理方式の改善により、動的記憶域の割り付けの高速
化を図っているが、動的記憶域を多用するプログラムに
おいては、十分な処理の高速化が実現されない場合が少
なくない。この理由を以下に説明する。That is, in the conventional dynamic storage area allocation method, the speed of dynamic storage area allocation is increased by improving the processing method for securing and releasing the storage area. However, in a program that uses a large amount of dynamic storage, it is often the case that sufficient processing speed is not realized. The reason for this will be described below.
【0005】プログラムから動的な記憶域の割り付け機
能を有するプログラミング言語においては、利用者プロ
グラム(ユーザプログラム)中に記述された動的な記憶
域の確保・解放の指定の記述を、言語処理系が提供する
記憶域管理用のライブラリ関数呼出しに置き換えて実現
している。In a programming language having a function of dynamically allocating a storage area from a program, a description of designation of dynamic storage area reservation / release described in a user program (user program) is applied to a language processing system. It is realized by replacing it with the library function call for storage area management provided by.
【0006】また、当該の記憶域管理用のライブラリ関
数においては、ランダムな記憶域の確保・解放要求に対
応するため、および記憶域の有効活用のために、一般に
複雑な記憶域管理機構を採用している。In addition, in the storage area management library function, a complicated storage area management mechanism is generally adopted in order to respond to a random storage area reservation / release request and to effectively utilize the storage area. are doing.
【0007】従来技術においては、このライブラリ関数
内で実行される複雑な記憶域管理機構の改善することに
より、記憶域の確保・解放の高速化を図ろうとしたもの
であるが、プログラム中に記述された動的記憶域の確保
・解放の要求毎にライブラリ関数の呼出しは依然として
行われるため、ライブラリ関数呼出しによるオーバヘッ
ドの改善には至っていない。In the conventional technique, the complicated storage area management mechanism executed in this library function is improved to speed up the securing and releasing of the storage area. However, it is described in the program. Since the library function is still called for each request to secure and release the allocated dynamic storage area, the overhead due to the library function call has not been improved.
【0008】特に動的記憶域が多用されるプログラムで
は、ライブラリ関数の呼出しが多数発生し、従来技術に
よる高速化のみでは十分な効果が得られない場合が少な
くない。Particularly in a program in which the dynamic storage area is frequently used, a large number of library function calls occur, and there are many cases in which a sufficient effect cannot be obtained only by speeding up by the conventional technique.
【0009】従って、本発明は、上記事情に鑑みてなさ
れたものであって、その目的は、動的な記憶域の確保・
解放のための記憶域管理ライブラリの呼び出しを削減す
ることによってライブラリ呼び出し及び動的記憶管理機
構によるオーバヘッドを低減し、高速化を達成するよう
にした動的記憶割付方式を提供することにある。Therefore, the present invention has been made in view of the above circumstances, and its purpose is to secure a dynamic storage area.
An object of the present invention is to provide a dynamic memory allocation method that reduces the overhead of the library call and the dynamic memory management mechanism by reducing the calls to the storage area management library for release, and achieves high speed.
【0010】[0010]
【課題を解決するための手段】前記目的を達成するた
め、本発明の動的記憶域割り付け方式は、ソース・プロ
グラムを解析し該プログラム中で発行される動的な記憶
域の確保・解放要求に関するデータフロー情報、及び該
プログラムの制御フロー情報に基づき、複数の動的な記
憶域間での生存区間の重複状況を検出し、共有可能な複
数の記憶域を検出して共有させることにより、動的な記
憶域の確保・解放のための記憶域管理用のライブラリ呼
出しを削減するように前記ソース・プログラムを自動修
正する手段を備えたことを特徴とする。In order to achieve the above-mentioned object, a dynamic storage area allocation method of the present invention analyzes a source program and requests a dynamic storage area allocation / release request issued in the program. Based on the data flow information about the program and the control flow information of the program, by detecting the overlapping state of the live range between a plurality of dynamic storage areas, by detecting and sharing a plurality of sharable storage areas, It is characterized by further comprising means for automatically modifying the source program so as to reduce library calls for storage area management for dynamically reserving and releasing storage areas.
【0011】本発明は、利用者がプログラム中に任意に
記述した動的な記憶域の確保・解放の要求を静的に解析
可能な範囲で、異なる動的な記憶域に対して、共有可能
な複数の記憶域を検出して共有させることにより、動的
な記憶域の確保・解放のための記憶域管理用のライブラ
リ呼出しを削減し、記憶域管理用ライブラリによるオー
バヘッドを減少させるようにしたものである。According to the present invention, it is possible to share different dynamic storage areas within a range in which a user can arbitrarily analyze a request to secure / release a dynamic storage area described in a program. By detecting and sharing multiple different storage areas, the number of library calls for storage area management to dynamically secure and release storage areas is reduced, and the overhead of the storage area management library is reduced. It is a thing.
【0012】すなわち、本発明に係る動的記憶域割付方
式は、プログラムの実行中に動的に記憶域を確保・解放
する機能を有するプログラミング言語に対する言語処理
系において、確保する記憶域のサイズがプログラムの翻
訳時に判明する動的な記憶域の確保要求を検出し、当該
の確保要求に対して返却された記憶域を識別するポイン
タ値に関するデータフローとプログラムの制御フローを
解析して当該のポインタ値が識別する記憶域に対する確
保要求から最も離れた位置の解放要求を検出することに
よって確保された記憶域の生存区間を検出する生存区間
検出手段と、生存区間検出手段によって検出された複数
の動的記憶域の生存区間の重複を検査する生存区間重複
検査手段と、生存区間重複検査手段によって判明した生
存区間の重複状況を考慮して同一の記憶域を共有可能な
一つ以上の動的記憶域をグループ化するグループ化手段
と、一つのグループ中の動的記憶域の内で最も大きいサ
イズの記憶域を当該のグループ中でその生存区間が最も
早く開始される動的記憶域の生存区間の先頭で確保し当
該のグループ中でその生存区間が最も遅く終了する動的
記憶域の生存区間の最後で解放し同一グループに属する
動的記憶域の確保・解放の要求を無効としてグループの
先頭で確保された記憶域を共有して利用するようにプロ
グラムを変更するプログラム変更手段を有することを特
徴とする。That is, according to the dynamic storage area allocation method of the present invention, in a language processing system for a programming language having a function of dynamically securing and releasing a storage area during execution of a program, the size of the secured storage area is Detects a dynamic storage allocation request found when the program is translated, analyzes the data flow related to the pointer value that identifies the storage area returned for the allocation request, and the program control flow to analyze the pointer. A live range detecting means for detecting a live range of the secured storage area by detecting a release request at the farthest position from the reserve request for the storage area identified by the value, and a plurality of motions detected by the live range detecting means. Range duplication checking means for checking the duplication of live ranges in dynamic storage areas, and the duplication status of live ranges found by the live range duplication checking means Grouping means for grouping one or more dynamic storage areas that can share the same storage area in consideration of each other, and the storage area having the largest size among the dynamic storage areas in one group. The live group is secured at the beginning of the live range of the dynamic storage area that starts earliest, and is released at the end of the live area of the dynamic memory area where the live area ends the latest in the same group. It is characterized by having program changing means for changing the program so that the request for securing / releasing the dynamic storage area belonging to is invalidated and the storage area secured at the head of the group is shared.
【0013】[0013]
【発明の実施の形態】本発明の実施形態について図面を
参照して以下に詳細に説明する。図1は、本発明の実施
の形態の構成をブロック図にて示したものである。BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described below in detail with reference to the drawings. FIG. 1 is a block diagram showing a configuration of an embodiment of the present invention.
【0014】図1を参照すると、本発明の実施の形態
は、言語処理系1、生存区間検出手段2、生存区間重複
検出手段3、グループ化手段4、プログラム変更手段
5、ソースプログラム6、データフロー情報7、制御フ
ロー情報8、生存区間情報9、生存区間重複状況情報1
0、及びグループ情報11を備えて構成される。以下各
要素を説明する。Referring to FIG. 1, in the embodiment of the present invention, a language processing system 1, a live range detecting means 2, a live range duplicate detecting means 3, a grouping means 4, a program changing means 5, a source program 6, and data. Flow information 7, control flow information 8, live range information 9, live range overlap status information 1
0 and group information 11 are provided. Each element will be described below.
【0015】図2は、本発明の実施の形態におけるデー
タフロー情報7の構成の一例を示す図である。FIG. 2 is a diagram showing an example of the structure of the data flow information 7 in the embodiment of the present invention.
【0016】図2を参照すると、データフロー情報7
は、データフローテーブルならびにアリアステーブルに
よって構成される。データフローテーブルは、各エント
リが、データ、データに値が設定される位置、当該の値
を保持している範囲が終了する位置、及びアリアステー
ブルへのチェイン(ポインタ)と、を備えて構成され
る、データフロー情報の集合である。また、アリアステ
ーブルは、データフローテーブルの各エントリに対応し
て作成され、対応するデータフローテーブルのエントリ
に格納されているデータフロー情報によって識別される
データが保持する値の写しを保持するアリアステーブル
の設定位置、終了位置によって構成されるアリアス情報
の集合である。Referring to FIG. 2, data flow information 7
Is composed of a data flow table and an alias table. The data flow table is configured such that each entry includes data, a position where a value is set in the data, a position where the range holding the value ends, and a chain (pointer) to the alias table. It is a set of data flow information. Further, the alias table is created for each entry of the data flow table, and holds the copy of the value held by the data identified by the data flow information stored in the corresponding entry of the data flow table. Is a set of the alias information constituted by the set position and the end position of.
【0017】上記したデータフロー情報7は、言語処理
系1によって事前に作成されているものとする。It is assumed that the above-mentioned data flow information 7 is created in advance by the language processing system 1.
【0018】図3は、本発明の実施の形態における、制
御フロー情報8の構成の一例を示す図である。図3を参
照すると、制御フロー情報8は、基本ブロックに関する
情報を保持する1又は複数の基本ブロック情報によって
構成され、各基本ブロックは基本ブロック間の制御フロ
ーに従ってチェインによって結ばれている。FIG. 3 is a diagram showing an example of the structure of the control flow information 8 in the embodiment of the present invention. Referring to FIG. 3, the control flow information 8 is composed of one or a plurality of basic block information holding information on basic blocks, and each basic block is connected by a chain according to a control flow between the basic blocks.
【0019】基本ブロック情報は、基本ブロックの開始
位置、終了位置、当該の基本ブロックから制御が移行す
る1つ以上の他の基本ブロックに対する基本ブロック情
報へのチェインによって構成される。制御フロー情報8
は、言語処理系1によって事前に作成されているものと
する。The basic block information comprises a basic block start position, an end position, and a chain of basic block information for one or more other basic blocks to which control is transferred from the basic block. Control flow information 8
Is preliminarily created by the language processing system 1.
【0020】図4は、本発明の実施の形態における生存
区間情報9の構成の一例を示す図である。図4を参照す
ると、生存区間情報9は、生存区間テーブルと、解放情
報テーブルと、から構成される。生存区間テーブルは、
ソースプログラム6中で確保される動的な記憶域に関す
る情報の集合であり、各エントリ(#1〜#n)は、動
的な記憶域が生存する区間の区間開始情報、区間終了情
報、動的な記憶域を識別するポインタ値を保持するデー
タ、動的な記憶域のサイズ、当該の動的な記憶域に対応
する解放情報テーブルへのチェインと、を備えて構成さ
れる。そして、図示のように、区間開始情報は、区間の
開始位置と開始位置が含まれる基本ブロック番号を保持
し、区間終了情報は、区間の終了位置と終了位置が含ま
れる基本ブロック番号を保持する。また、解放情報テー
ブル1〜nは、対応する動的な記憶域の解放情報の集合
であり、解放情報は、動的な記憶域の解放位置と解放位
置が含まれる基本ブロック番号を保持する。FIG. 4 is a diagram showing an example of the configuration of the live range information 9 in the embodiment of the present invention. Referring to FIG. 4, the live range information 9 includes a live range table and a release information table. The live range table is
The entry (# 1 to #n) is a set of information related to the dynamic storage area secured in the source program 6, and each entry (# 1 to #n) includes section start information, section end information, and motion Data holding a pointer value for identifying a specific storage area, a size of the dynamic storage area, and a chain to a release information table corresponding to the dynamic storage area. Then, as shown in the figure, the section start information holds the start position of the section and the basic block number including the start position, and the section end information holds the basic block number including the end position and the end position of the section. . Further, the release information tables 1 to n are a set of release information of corresponding dynamic storage areas, and the release information holds a release position of the dynamic storage area and a basic block number including the release position.
【0021】図5は、本発明の実施の形態における、生
存区間重複状況情報10の構成の一例を示す図である。
図5を参照すると、生存区間重複状況情報10は、動的
な記憶域と他の動的な記憶域との生存区間の重複情報を
表す2次元のビット配列からなり、各次元の要素数は共
に生存区間情報9の生存区間テーブルのエントリ数と同
一とされる(行及び列方向に#1〜#n)。生存区間重
複状況情報10の各ビットは、該当する動的な記憶域同
士の生存区間が重複する場合には「1」が設定され、そ
れ以外の場合は「0」が設定される。FIG. 5 is a diagram showing an example of the configuration of the live range overlap status information 10 in the embodiment of the present invention.
Referring to FIG. 5, the live range overlap status information 10 is a two-dimensional bit array representing live range overlap information between a dynamic storage area and another dynamic storage area, and the number of elements in each dimension is Both are the same as the number of entries in the live range table of the live range information 9 (# 1 to #n in the row and column directions). Each bit of the live range overlap status information 10 is set to "1" when the live ranges of the corresponding dynamic storage areas overlap, and is set to "0" otherwise.
【0022】図6は、本発明の実施の形態におけるグル
ープ情報11の構成の一例を示す図である。図6を参照
すると、グループ情報11は、グループ化された動的な
記憶域に対するグループ開始位置、グループ終了位置、
生成データ、サイズによって構成されるエントリの集合
である。FIG. 6 is a diagram showing an example of the configuration of the group information 11 in the embodiment of the present invention. Referring to FIG. 6, group information 11 includes a group start position, a group end position, and a group end position for grouped dynamic storage areas.
It is a set of entries composed of generated data and size.
【0023】次に、本発明の実施形態の動作について図
1を参照して説明する。Next, the operation of the embodiment of the present invention will be described with reference to FIG.
【0024】言語処理系1は、ソースプログラム6を入
力して、データフロー情報7、制御フロー情報8を生成
する。The language processing system 1 inputs the source program 6 and generates data flow information 7 and control flow information 8.
【0025】次に、言語処理系1は、生存区間検出手段
2、生存区間重複検出手段3、グループ化手段4、プロ
グラム変更手段5を順次起動して、ソースプログラム6
中の動的な記憶域の確保・解放のための記憶域管理用ラ
イブラリ関数の呼出しが削減されるようにソースプログ
ラム6を変更する。Next, the language processing system 1 sequentially activates the live range detecting means 2, the live range overlapping detecting means 3, the grouping means 4, and the program changing means 5, and the source program 6
The source program 6 is modified so that calls to the storage area management library functions for dynamically securing and releasing the internal storage area are reduced.
【0026】生存区間検出手段2は、ソースプログラム
6、データフロー情報7、制御フロー情報8を入力し
て、ソースプログラム6中の確保する記憶域のサイズが
静的に判明する動的な記憶域の確保要求によって確保さ
れる動的な記憶域が、確保された位置から最も離れた位
置で解放されるまでの区間(生存区間)を下記の手順で
検出する。The live range detecting means 2 inputs the source program 6, the data flow information 7, and the control flow information 8 to dynamically determine the size of the storage area to be secured in the source program 6, which is a dynamic storage area. The dynamic storage area secured by the securing request of (1) is detected by the following procedure until the area (live zone) from the secured position to the farthest position is released.
【0027】(1)ソースプログラム6を調査し、確保
する記憶域のサイズが静的に判明する動的な記憶域の確
保要求の位置、サイズ、および、その確保要求によって
確保された動的な記憶域を識別するポインタ値を保持す
るデータを検出し、生存区間情報9の生存区間テーブル
の区間開始情報の位置フィールド、生存区間テーブルの
サイズフィールド、生存区間テーブルのデータフィール
ドに格納する。(1) The source program 6 is investigated, and the size of the storage area to be secured is known statically. The position and size of the dynamic storage area securing request, and the dynamic storage area secured by the securing request. Data holding a pointer value for identifying the storage area is detected and stored in the position field of the section start information of the live section table of the live section information 9, the size field of the live section table, and the data field of the live section table.
【0028】この処理によって、生存区間情報9には、
ソースプログラム6中の確保する記憶域のサイズが静的
に判明する全ての動的な記憶域に対する確保要求の位
置、サイズ、ならびに確保された動的な記憶域を識別す
るポインタ値を保持するデータに関する情報が格納され
る。By this processing, the live range information 9 contains
Data holding the position and size of the allocation request for all the dynamic storage areas in which the size of the reserved storage area in the source program 6 is statically known, and the pointer value for identifying the secured dynamic storage area Stores information about.
【0029】(2)次に、ソースプログラム6を調査
し、各動的な記憶域を識別するポインタ値を保持するデ
ータおよびそのアリアスデータが、当該動的な記憶域を
識別するポインタ値を保持している範囲内の、当該動的
な記憶域の解放要求の位置を全て検出して、生存区間情
報9中に、当該動的な記憶域に対応する解放情報テーブ
ル(図4参照)を作成し、その各エントリの解放情報の
位置フィールドに検出した解放要求の位置を格納する。(2) Next, the source program 6 is examined, and the data holding the pointer value identifying each dynamic storage area and its alias data hold the pointer value identifying the dynamic storage area. Detects all the positions of the release request of the dynamic storage area within the range being operated, and creates the release information table (see FIG. 4) corresponding to the dynamic storage area in the live range information 9. Then, the position of the detected release request is stored in the position field of the release information of each entry.
【0030】この処理において、各動的な記憶域を識別
するポインタ値を保持するデータと、そのアリアスデー
タがその値を保持している範囲を取得するために生存区
間情報9の生存区間テーブルの各エントリのデータフィ
ールドに対応するデータフロー情報7のデータフローテ
ーブルのデータフロー情報の設定位置フィールド・終了
位置フィールド、および対応するアリアステーブルの各
アリアス情報の設定位置フィールド・終了位置フィール
ドが参照される。In this process, in order to acquire the data holding the pointer value for identifying each dynamic storage area and the range in which the alias data holds the value, the live range table 9 of the live range information 9 is acquired. The set position field / end position field of the data flow information of the data flow table of the data flow information 7 corresponding to the data field of each entry, and the set position field / end position field of each alias information of the corresponding alias table are referred to. .
【0031】(3)続いて、制御フロー情報8の各基本
ブロック情報の開始位置フィールド・終了位置フィール
ドを参照して、生存区間情報9の生存区間テーブルの区
間開始情報の位置フィールド、解放情報テーブルの解放
情報の位置フィールドに格納されている位置に対応する
基本ブロック番号を決定し、生存区間情報9の生存区間
テーブルにおける、区間開始情報のブロックフィール
ド、解放情報テーブルの解放情報のブロックフィールド
に、基本ブロック番号を設定する。(3) Next, referring to the start position field and end position field of each basic block information of the control flow information 8, the position field of the section start information of the live range table of the live range information 9 and the release information table Of the release information, the basic block number corresponding to the position stored in the position field of the release information is determined, and in the live range table of the live range information 9, in the block field of the section start information and the block field of the release information of the release information table, Set the basic block number.
【0032】(4)最後に、生存区間情報9の解放情報
テーブル、制御フロー情報8を参照して、各々の動的な
記憶域に対するいかなる解放要求経由で処理が移行して
も、必ず通過する確保要求から最も離れた基本ブロック
を決定する。この基本ブロックの先頭の位置と基本ブロ
ック番号を、生存区間情報9の生存区間テーブルの区間
終了情報の位置フィールド・ブロックフィールドに格納
する。解放要求が1つの場合には、その解放の位置が生
存区間の終わりとなる。(4) Finally, with reference to the release information table of the live range information 9 and the control flow information 8, even if the processing shifts through any release request for each dynamic storage area, it always passes. Determine the basic block farthest from the reservation request. The start position and basic block number of this basic block are stored in the position field / block field of the section end information of the live range table of the live range information 9. When there is one release request, the release position is the end of the live range.
【0033】いかなる解放要求経由で処理が移行して
も、必ず通過する基本ブロックが存在しない場合には、
当該動的な記憶域は、この処理の対象外とし、既に生存
区間情報9に格納された情報を削除する。If there is no basic block that always passes, no matter what the release request is, the processing will move.
The dynamic storage area is excluded from this processing, and the information already stored in the live range information 9 is deleted.
【0034】生存区間重複検出手段3は、生存区間検出
手段2によって生成された、生存区間情報9中の各動的
な記憶域に対する、区間開始情報及び区間終了情報、を
参照して、各動的な記憶域と、生存区間が重複する動的
な記憶域を検出し、生存区間重複状況情報10(図5参
照)を設定する。The live range duplication detection means 3 refers to the section start information and the section end information for each dynamic storage area in the live range information 9 generated by the live range detection means 2 to refer to each motion. Dynamic storage area and a dynamic storage area whose live range overlaps are detected, and live range overlap status information 10 (see FIG. 5) is set.
【0035】グループ化手段4は、生存区間重複検出手
段3によって作成された生存区間重複状況情報10を参
照して、生存区間が重複しない動的な記憶域群をグルー
プ化して、グループ情報11(図6参照)を生成する。The grouping means 4 refers to the live range overlap status information 10 created by the live range overlap detection means 3 to group the dynamic storage areas whose live ranges do not overlap, and to group the group information 11 ( 6) is generated.
【0036】グループ情報11のグループ開始位置は、
生存区間情報9の生存区間テーブル中の、グループ化さ
れた動的な記憶域群の内の最も早く出現するものに対応
するエントリの区間開始情報の位置フィールドの値が設
定される。また、グループ情報11のグループ終了位置
は、生存区間情報9の生存区間テーブル中の、グループ
化された動的な記憶域群の内の最も最後に出現するもの
に対応するエントリの区間終了情報の位置フィールドの
値が設定される。グループ情報11のサイズは、生存区
間情報9の生存区間テーブル中の、グループ化された動
的な記憶域群の内の最もサイズが大きいものに対応する
エントリのサイズフィールドの値が設定される。The group start position of the group information 11 is
In the live range table of the live range information 9, the value of the position field of the section start information of the entry corresponding to the earliest one of the grouped dynamic storage areas is set. The group end position of the group information 11 is the section end information of the entry corresponding to the last appearing one of the grouped dynamic storage areas in the live range table of the live range information 9. The value of the position field is set. As the size of the group information 11, the value of the size field of the entry corresponding to the largest size of the grouped dynamic storage areas in the live range table of the live range information 9 is set.
【0037】プログラム変更手段5は、グループ化手段
4によって作成されたグループ情報11の各エントリを
参照してソースプログラム6を下記の手順で変更する。The program changing unit 5 refers to each entry of the group information 11 created by the grouping unit 4 and changes the source program 6 in the following procedure.
【0038】(1)グループ情報11のグループ開始位
置に、グループ情報11のサイズフィールドの値による
動的な記憶域の確保要求を追加する。(1) A request for securing a dynamic storage area is added to the group start position of the group information 11 according to the value of the size field of the group information 11.
【0039】(2)当該動的な記憶域の確保要求によっ
て確保された動的な記憶域を識別するポインタ値を保持
するためのポインタデータを生成し、当該生成データに
確保された動的な記憶域を識別するポインタ値が格納さ
れるようにする。また、生成データ名をグループ情報1
1の生成データフィールド(図6参照)に設定する。(2) The pointer data for holding the pointer value for identifying the dynamic storage area secured by the request for securing the dynamic storage area is generated, and the dynamic data secured in the generated data is generated. Allows storage of pointer values that identify storage areas. In addition, the generated data name is group information 1
1 in the generated data field (see FIG. 6).
【0040】(3)当該グループに属する全ての動的な
記憶域に対する確保要求を、当該の確要求によって確保
された動的な記憶域を識別するポインタ値を保持するポ
インタデータに、上記した生成データが保持する値を代
入する処理に変更する。(3) Generation of the reservation request for all the dynamic storage areas belonging to the relevant group into the pointer data holding the pointer value for identifying the dynamic storage area reserved by the relevant confirmation request. Change to the process of substituting the value held by the data.
【0041】(4)当該グループに属する全ての動的な
記憶域に対する全ての解放要求を削除する。(4) Delete all release requests for all dynamic storage areas belonging to the group.
【0042】(5)グループ情報11のグループ終了位
置に、当該動的な記憶域の解放要求を追加する。解放さ
れる動的な記憶域を識別するポインタ値は、グループ情
報11の生成データフィールドに設定されている生成デ
ータに保持されている。(5) A request for releasing the dynamic storage area is added to the group end position of the group information 11. The pointer value for identifying the released dynamic storage area is held in the generated data set in the generated data field of the group information 11.
【0043】以上により、本発明の実施の形態による動
的記憶域の割り付け方式の処理が完了し、ソースプログ
ラム6中の動的な記憶域の確保・解放のための記憶域管
理用ライブラリ関数の呼出しが削減されたソースプログ
ラム6が生成される。As described above, the processing of the dynamic storage area allocation method according to the embodiment of the present invention is completed, and the storage area management library function for securing / releasing the dynamic storage area in the source program 6 is completed. A source program 6 with reduced calls is generated.
【0044】[0044]
【実施例】次に、上記した本発明の実施の形態をより具
体的に説明すべく、本発明の実施例について図面を参照
して詳細に説明する。本発明の実施例の構成は、前記実
施の形態と同様な構成とされ、図1を参照とすると、言
語処理系1、生存区間検出手段2、生存区間重複検出手
段3、グループ化手段4、プログラム変更手段5、ソー
スプログラム6、データフロー情報7、制御フロー情報
8、生存区間情報9、生存区間重複状況情報10、グル
ープ情報11から構成される。EXAMPLES Examples of the present invention will now be described in detail with reference to the drawings in order to more specifically describe the above-described embodiments of the present invention. The configuration of the embodiment of the present invention is the same as that of the above-mentioned embodiment, and referring to FIG. 1, the language processing system 1, the live range detection means 2, the live range duplicate detection means 3, the grouping means 4, The program changing unit 5, the source program 6, the data flow information 7, the control flow information 8, the live range information 9, the live range overlap status information 10, and the group information 11.
【0045】図7は、本実施例におけるソースプログラ
ム6の一例を示す図である。図7に示すように、ソース
プログラム6はPL/I言語によって記述されている。
ソースプログラム中の各行の位置はソースプログラムの
左側に示してある。また、PL/I言語における動的な
記憶域の確保要求は、「ALLOCATE文」、解放要
求は「FREE文」によって記述される。これら「AL
LOCATE文」、「FREE文」による動的な記憶域
の確保・解放は、言語処理系によって生成された目的プ
ログラムにおいては、動的な記憶域の確保・解放のため
の記憶域管理ライブラリ関数によって実現されている
(リンク手段によってリンクされ実行モジュールが生成
される)。ちなみに、図7に示すソースプログラム6に
おいて、位置11では「ALLOCATE文」によりサ
イズ128(次元128の文字型配列)の記憶域の確保
要求#1が発行され(P1はポインタ型の変数)、位置
36で「FREE文」により確保要求#1の解放要求が
なされている。FIG. 7 is a diagram showing an example of the source program 6 in this embodiment. As shown in FIG. 7, the source program 6 is written in PL / I language.
The position of each line in the source program is shown on the left side of the source program. Also, a request to secure a dynamic storage area in the PL / I language is described by "ALLOCATE statement", and a release request is described by "FREE statement". These "AL
In the target program generated by the language processor, the dynamic storage area allocation / release by the "LOCATE statement" or "FREE statement" is performed by the storage area management library function for dynamic storage area allocation / release. It is realized (linking means links to generate an execution module). By the way, in the source program 6 shown in FIG. 7, at position 11, a request for securing a storage area of size 128 (character type array of dimension 128) # 1 is issued by the "ALLOCATE statement" (P1 is a pointer type variable), and the position In 36, the release request of the reservation request # 1 is made by the "FREE statement".
【0046】図8は、本実施例におけるデータフロー情
報7の一具体例(図7に示すプログラムの記憶域確保・
解放に対応)を示す図である。図8を参照して、各フィ
ールドの意味は、前記実施の形態で参照した図2と同一
とされている。例えばデータフロー情報の第1エントリ
の各フィールドの、P1、11、36はそれぞれデー
タ、設定位置、終了位置を示している。FIG. 8 shows a specific example of the data flow information 7 in this embodiment (a storage area for the program shown in FIG.
(Corresponding to release) FIG. Referring to FIG. 8, the meaning of each field is the same as that of FIG. 2 referred to in the above-mentioned embodiment. For example, P1, 11, and 36 in each field of the first entry of the data flow information indicate data, set position, and end position, respectively.
【0047】図9は、本実施例における制御フロー情報
8の一具体例を示す図である。各フィールドの意味は前
記実施の形態で参照した図3と同様とされており、その
説明は省略する。FIG. 9 is a diagram showing a specific example of the control flow information 8 in this embodiment. The meaning of each field is the same as that in FIG. 3 referred to in the above embodiment, and the description thereof is omitted.
【0048】図10は、本実施例における生存区間情報
9の一具体例を示す図である。各フィールドの意味は前
記実施の形態で参照した図4と同様とされており、その
説明は省略する。FIG. 10 is a diagram showing a specific example of the live range information 9 in this embodiment. The meaning of each field is the same as that in FIG. 4 referred to in the above embodiment, and the description thereof is omitted.
【0049】図11は、本実施例における生存区間重複
状況情報10の具体例である。各ボットフラグの意味は
前記実施の形態で参照した図2と同様とされている。例
えば動的記憶域#1は動的記憶域#2、#3と生存区間
が重複している。FIG. 11 is a concrete example of the live range overlap status information 10 in this embodiment. The meaning of each bot flag is the same as in FIG. 2 referred to in the above embodiment. For example, the dynamic storage area # 1 has the same live range as the dynamic storage areas # 2 and # 3.
【0050】図12は、本実施例におけるグループ情報
11の具体例である。各フィールドの意味は前記実施の
形態で参照した図6と同様とされており、その説明は省
略する。FIG. 12 is a concrete example of the group information 11 in this embodiment. The meaning of each field is the same as that in FIG. 6 referred to in the above embodiment, and the description thereof is omitted.
【0051】図13は、本実施例における動的記憶域割
り付け方式によって変更されたソースプログラム6の具
体例である。ソースプログラム中の各行の位置はソース
プログラムの左側に示してある。FIG. 13 shows a specific example of the source program 6 modified by the dynamic storage area allocation method in this embodiment. The position of each line in the source program is shown on the left side of the source program.
【0052】図7に示した元ソースプログラムに対して
追加又は変更された行の位置は、n−mの形式で、図7
の同じ行と区別して示してある。図7のソースプログラ
ムにおいて、図13に存在しない行は、削除された行で
ある。The position of the line added or changed to the original source program shown in FIG.
Are distinguished from the same line. In the source program of FIG. 7, lines that do not exist in FIG. 13 are deleted lines.
【0053】言語処理系1は、ソースプログラム6(図
7参照)を解析して、データフロー情報7(図8参
照)、制御フロー情報8(図9参照)を生成する。The language processing system 1 analyzes the source program 6 (see FIG. 7) and generates data flow information 7 (see FIG. 8) and control flow information 8 (see FIG. 9).
【0054】本実施例のデータフロー情報7は、データ
P1、P2、P3、P4、P5に関して、ソースプログ
ラム6(図7参照)上の動的な記憶域を識別するポイン
タ値が設定された位置、ポインタ値が解放要求によって
無効となることによって、当該データに保持されている
値の寿命が終了する位置が、データフローテーブルに設
定される(図8参照)。The data flow information 7 of this embodiment is a position where a pointer value for identifying a dynamic storage area on the source program 6 (see FIG. 7) is set for the data P1, P2, P3, P4 and P5. As the pointer value becomes invalid due to the release request, the position where the life of the value held in the data ends is set in the data flow table (see FIG. 8).
【0055】更に、データフローテーブルの各エントリ
に対応するデータが保持する値の写しを保持するアリア
スデータに関して、ソースプログラム6(図7参照)上
の当該の値が設定された位置、ポインタ値が解放要求に
よって無効となることによって当該データに保持されて
いる値の寿命が終了する位置がアリアステーブルに設定
される。Further, with respect to the alias data which holds a copy of the value held by the data corresponding to each entry of the data flow table, the position where the corresponding value is set in the source program 6 (see FIG. 7) and the pointer value are The position where the life of the value held in the data ends due to invalidation by the release request is set in the alias table.
【0056】本実施例では、アリアステーブルは、図7
の位置45においてデータP3が保持するポインタ値を
代入されているデータP6(P6=P3)に関するもの
のみである。In this embodiment, the alias table is shown in FIG.
It is only for the data P6 (P6 = P3) in which the pointer value held by the data P3 is assigned at the position 45.
【0057】本実施例の制御フロー情報8は、図9を参
照すると、基本ブロック情報#1、#2、#3、#4、
#5、#6、#7、#8、#9によって構成され、各基
本ブロック情報は、ソースプログラム6上の開始位置、
終了位置、当該制御ブロックから制御が移行される他の
基本ブロックへのチェインを保持している。As for the control flow information 8 of this embodiment, referring to FIG. 9, basic block information # 1, # 2, # 3, # 4,
The basic block information is composed of # 5, # 6, # 7, # 8, and # 9.
It holds an end position and a chain from the control block to another basic block to which control is transferred.
【0058】言語処理系1は、続いて、生存区間検出手
段2、生存区間重複検出手段3、グループ手段4、プロ
グラム変更手段5を順次起動して、ソースプログラム6
(図7参照)中の動的な記憶域の確保・解放のための記
憶域管理用ライブラリ関数の呼出しが削減されるように
変更されたソースプログラム6(図13参照)を生成す
る。Next, the language processing system 1 sequentially activates the live range detection means 2, the live range duplication detection means 3, the group means 4, and the program change means 5, and the source program 6
(See FIG. 7) The source program 6 (see FIG. 13) is generated so that the number of calls to the storage area management library function for dynamically securing / releasing the storage area is reduced.
【0059】生存区間検出手段2は、ソースプログラム
6(図7参照)を調査して、「ALLOCATE文」の
出現位置(11、15、19、25、37)と、各「A
LLOCATE文」で確保された動的な記憶域のサイズ
(128、256、300、256、100)、確保さ
れた動的な記憶域を識別するポインタ値を保持するデー
タ(P1、P2、P4、P5、P3)を生存区間情報9
(図10参照)の生存区間テーブルの区間開始情報の位
置フィールド、サイズフィールド、データフィールドに
設定する。The live range detecting means 2 examines the source program 6 (see FIG. 7) and finds the appearance position (11, 15, 19, 25, 37) of "ALLOCATE statement" and each "A.
The size (128, 256, 300, 256, 100) of the dynamic storage area secured by the "LLOCATE statement", and the data (P1, P2, P4, which holds the pointer value for identifying the secured dynamic storage area). P5, P3) as live range information 9
It is set in the position field, size field, and data field of the section start information of the live range table (see FIG. 10).
【0060】次に、生存区間情報9(図10参照)の生
存区間テーブルのエントリ#1、#2、#3、#4、#
5のそれぞれに対して、ソースプログラム6(図7参
照)を調査して、各エントリに対応する動的な記憶域に
対する「FREE文」の出現位置(36、18、22、
28、34、41、48)を検出し、生存区間情報9
(図10参照)の生存区間テーブルの対応するエントリ
配下の解放情報テーブルの解放情報の位置フィールドに
設定する。Next, entries # 1, # 2, # 3, # 4, # of the live range table of the live range information 9 (see FIG. 10).
5, the source program 6 (see FIG. 7) is examined, and the appearance position (36, 18, 22, of the “FREE statement”) with respect to the dynamic storage area corresponding to each entry is examined.
28, 34, 41, 48) is detected, and live range information 9
It is set in the position field of the release information of the release information table under the corresponding entry of the live range table (see FIG. 10).
【0061】「FREE文」の検出に際しては、データ
フロー情報7(図8参照)を参照して、データP1、P
2、P4、P5、P3、及びP3の転写データP6に該
当する動的な記憶域を識別するポインタ値が保持されて
いる範囲を調査する。When detecting the "FREE sentence", the data P1 and P are referred to by referring to the data flow information 7 (see FIG. 8).
The range in which the pointer value for identifying the dynamic storage area corresponding to the transfer data P6 of 2, P4, P5, P3, and P3 is held is investigated.
【0062】続いて、制御フロー情報8(図9参照)を
参照して、生存区間情報9(図10参照)中の生存区間
テーブルの区間開始情報の位置フィールドに設定されて
いる位置(11、15、19、25、37)が属する基
本ブロック番号(#1、#2、#2、#3、#6)を決
定し、同じ区間開始情報のブロックフィールドに設定す
る。また、生存区間情報9(図10参照)中の解放情報
テーブルの解放情報の位置フィールドに設定されている
位置(36、18、22、28、34、41、48)が
属する基本ブロック番号(#6、#2、#2、#4、#
5、#7、#8)を同じ解放情報のブロックフィールド
に設定する。Subsequently, referring to the control flow information 8 (see FIG. 9), the position (11, 11) set in the position field of the section start information of the live range table in the live range information 9 (see FIG. 10). The basic block numbers (# 1, # 2, # 2, # 3, # 6) to which 15, 19, 25, 37) belong are determined and set in the block field of the same section start information. Also, the basic block number (# to which the position (36, 18, 22, 28, 34, 41, 48) set in the position field of the release information of the release information table in the live range information 9 (see FIG. 10) belongs. 6, # 2, # 2, # 4, #
5, # 7, # 8) are set in the block field of the same release information.
【0063】基本ブロック番号の決定は、制御フロー情
報8(図9参照)中の各基本ブロック情報の開始位置フ
ィールドと終了位置フィールドに保持されている値の間
に属するか否かで行われる。The basic block number is determined by whether or not it belongs between the values held in the start position field and the end position field of each basic block information in the control flow information 8 (see FIG. 9).
【0064】最後に、各動的な記憶域の生存区間の区間
終了位置と属する基本ブロックを決定するために、生存
区間情報9(図10参照)中の生存区間テーブルの各エ
ントリに対応する解放情報テーブルのいかなる解放要求
を経由しても、必ず通過する基本ブロックを、制御フロ
ー情報8(図9参照)を参照して決定する。Finally, in order to determine the section end position of the live range of each dynamic storage area and the basic block to which it belongs, the release corresponding to each entry of the live range table in the live range information 9 (see FIG. 10). The basic block that always passes through any release request of the information table is determined by referring to the control flow information 8 (see FIG. 9).
【0065】本実施例では、生存区間情報9(図10参
照)の生存区間テーブルのエントリ#1、#2、#3に
各々に対応する解放要求は、それぞれ1つであるため、
これらの生存区間の区間終了情報は、対応する解放情報
テーブルの解放情報の位置フィールド、ブロックフィー
ルドと同じとなる。In this embodiment, there is one release request corresponding to each of the entries # 1, # 2, and # 3 in the live range table of the live range information 9 (see FIG. 10).
The section end information of these live sections is the same as the position field and block field of the release information of the corresponding release information table.
【0066】図10を参照して、エントリ#4に対応す
る解放要求は、位置28(基本ブロック#4)、位置3
4(基本ブロック#5)の2つ存在するが、位置28が
属する基本ブロック#4(開始位置27、終了位置3
0)は、当該基本ブロックを通過した後に他の基本ブロ
ックへ制御が移行しないため、位置28、34のいずれ
を経由しても、必ず通過する基本ブロックは存在しない
ため、エントリ#4を対象外とするために、生存区間テ
ーブルから、エントリ#4を削除する。また、エントリ
#4に対応する解放情報テーブル4も削除する。With reference to FIG. 10, the release request corresponding to entry # 4 is at position 28 (basic block # 4), position 3
4 (basic block # 5) exist, but basic block # 4 (start position 27, end position 3) to which position 28 belongs
In 0), since the control does not transfer to another basic block after passing through the basic block, there is no basic block that always passes through either of the positions 28 and 34, so the entry # 4 is excluded. Therefore, entry # 4 is deleted from the live range table. Also, the release information table 4 corresponding to the entry # 4 is deleted.
【0067】エントリ#5に対応する解放要求は、位置
41、48の2つ存在し、いずれを経由しても必ず通過
する基本ブロックは基本ブロック#9であるので、その
生存区間の終了位置情報のブロックフィールドには#
9、位置フィールドには基本ブロックの先頭位置50が
設定される。There are two release requests corresponding to the entry # 5, that is, the positions 41 and 48, and the basic block that always passes through any of them is the basic block # 9. In the block field of #
9, the start position 50 of the basic block is set in the position field.
【0068】生存区間重複検査手段3は、生存区間情報
9(図10参照)の生存区間テーブルの各エントリを参
照して、各エントリに対応する動的な記憶域の生存区間
の重複状況を調査して生存区間重複状況情報10(図1
1参照)を生成する。図7に示したソースプログラムに
おいては、エントリ#1に対応する動的な記憶域の生存
区間とエントリ#2、#3に対応する動的な記憶域の生
存区間が重複することとなる。The live range duplication checking means 3 refers to each entry in the live range table of the live range information 9 (see FIG. 10) to check the overlapping state of the live ranges in the dynamic storage area corresponding to each entry. Then, the live range overlap status information 10 (Fig. 1
1) is generated. In the source program shown in FIG. 7, the live range of the dynamic storage area corresponding to entry # 1 and the live range of the dynamic storage areas corresponding to entries # 2 and # 3 overlap.
【0069】グループ化手段4は、生存区間重複状況情
報10(図11参照)を参照して、生存区間が重複しな
い動的な記憶域群をグループ化し、グループ情報11
(図12参照)を生成する。The grouping means 4 refers to the live range duplication status information 10 (see FIG. 11) to group the dynamic storage areas in which the live ranges do not overlap, and the group information 11
(See FIG. 12) is generated.
【0070】生存区間情報9(図10参照)の生存区間
テーブルのエントリ#1とエントリ#5、エントリ#2
とエントリ#3の2つのグループにグループ化するか、
エントリ#2、エントリ#3、エントリ#5を1つのグ
ループにグループ化することが可能であるが、本実施例
では、それぞれの動的な記憶域のサイズの相違を考慮し
て、前者の2つのグループにグループ化する。Entry # 1, entry # 5, and entry # 2 of the live range table of the live range information 9 (see FIG. 10)
Grouped into two groups, and entry # 3, or
It is possible to group the entry # 2, the entry # 3, and the entry # 5 into one group, but in the present embodiment, the former 2 is taken into consideration in consideration of the difference in the size of each dynamic storage area. Group into one group.
【0071】その結果、図12に示すように、グループ
情報11には、グループ#1(開始位置:11、終了位
置:50、サイズ:128)とグループ#2(開始位
置:15、終了位置:22、サイズ:300)の2つの
情報が生成される。As a result, as shown in FIG. 12, the group information 11 includes group # 1 (start position: 11, end position: 50, size: 128) and group # 2 (start position: 15, end position: 22, size: 300) is generated.
【0072】プログラム変更手段5は、グループ化情報
11(図12参照)を参照し、図7に示したソースプロ
グラム6中の動的な記憶域の確保・解放要求をグループ
の開始位置、終了位置のみで行うように変更し、図13
に示すようなソースプログラムを生成する。The program changing means 5 refers to the grouping information 11 (see FIG. 12) and issues a dynamic storage area reservation / release request in the source program 6 shown in FIG. 7 to the start position and end position of the group. Change to do only in Figure 13
Generate a source program as shown in.
【0073】グループ#1には生存区間情報9(図10
参照)の生存区間テーブルのエントリ#1とエントリ#
5に対応する動的な記憶域が属するので、エントリ#1
に対応する動的な記憶域に対する「ALLOCATE
文」が出現する元ソースプログラム6の位置11は、変
更後のソースプログラムにおいては、図13に示すよう
に、位置11−1、11−2、11−3のように変更さ
れる。追加された11−1の「DCL #P1# PT
R」でポインタを定義し、11−2で「ALLOCAT
E A SET(#P1#)」とポインタをもとの位置
11から変更し、追加された11−3で「P1=#P1
#」と確保された記憶域のポインタ値をP1に代入して
いる。The live range information 9 (see FIG. 10) is assigned to the group # 1.
Entry # 1 and entry # of the live range table
Since the dynamic storage area corresponding to 5 belongs, entry # 1
"ALLOCATE for dynamic storage corresponding to
Position 11 of the original source program 6 in which the "sentence" appears is changed to positions 11-1, 11-2, 11-3 in the changed source program, as shown in FIG. Added 11-1 “DCL # P1 # PT
The pointer is defined by "R", and "ALLOCAT is defined by 11-2.
EA SET (# P1 #) "and the pointer is changed from the original position 11 and" P1 = # P1 "is added to the added 11-3.
The pointer value of the secured storage area "#" is assigned to P1.
【0074】当該動的な記憶域に対する「FREE文」
が出現するソースプログラム6(図7参照)の位置36
は、変更後のソースプログラムにおいては、図13に示
すように、削除されている。"FREE statement" for the dynamic storage area
Position 36 of the source program 6 (see FIG. 7) where
Is deleted in the changed source program as shown in FIG.
【0075】また、エントリ#5に対応する動的な記憶
域に対する「ALLOCATE文」が出現する元ソース
プログラム6の位置37は、変更後のソースプログラム
においては、図13に示す位置37のように変更されて
いる。The position 37 of the original source program 6 in which the "ALLOCATE statement" appears in the dynamic storage area corresponding to the entry # 5 is the same as position 37 shown in FIG. 13 in the changed source program. has been edited.
【0076】そして、当該動的な記憶域に対する「FR
EE文」が出現する元ソースプログラム6の位置41、
48は、変更後のソースプログラムでは削除され、グル
ープ#1の終了位置である元ソースプログラム6の位置
50は、変更後のソースプログラムにおいては、図13
の位置50−1、50のように変更される。Then, "FR" for the dynamic storage area
Position 41 of the original source program 6 where the "EE sentence" appears,
48 is deleted in the changed source program, and the position 50 of the original source program 6 which is the end position of the group # 1 is changed to the position shown in FIG.
The positions 50-1 and 50 are changed.
【0077】グループ#2についてもグループ#1と同
様にして、生存区間情報9(図10参照)の生存区間テ
ーブルのエントリ#2、エントリ#3に対応する動的な
記憶域に対する「ALLOCATE文」、「FREE
文」が出現する元ソースプログラム6の該当位置が、変
更後のソースプログラムにおいては、図13に示すよう
に変更される。Similarly to the group # 1, for the group # 2, the "ALLOCATE statement" for the dynamic storage areas corresponding to the entries # 2 and # 3 of the live range table of the live range information 9 (see FIG. 10). , "FREE
The corresponding position of the original source program 6 in which the "sentence" appears is changed as shown in FIG. 13 in the changed source program.
【0078】以上により、本発明の実施例による動的記
憶域の割り付け方式の処理が完了し、ソースプログラム
6中の動的な記憶域に対する5つの「ALLOCATE
文」、7つの「FREE文」が、変更後のソースプログ
ラムにおいては、図13に示すように、「ALLOCA
TE文」が3つ、「FREE文」が4つに削減されてい
る。As described above, the processing of the dynamic storage area allocation method according to the embodiment of the present invention is completed, and five "ALLOCATE" for the dynamic storage area in the source program 6 are completed.
Statement ”and seven“ FREE statements ”in the changed source program, as shown in FIG.
The number of "TE sentences" is reduced to 3, and the number of "FREE sentences" is reduced to 4.
【0079】なお、上記実施例ではPL/I言語による
動的記憶域の確保・解放のプログラム例を説明したが、
本発明のPL/I言語に限定されるものでなく、他のプ
ログラミング言語による動的記憶域の確保・解放要求に
対しても適用可能である。In the above embodiment, an example of a program for securing / releasing a dynamic storage area in PL / I language has been described.
The present invention is not limited to the PL / I language of the present invention, and can be applied to a request to secure / release a dynamic storage area by another programming language.
【0080】[0080]
【発明の効果】以上説明したように、本発明によれば、
プログラム中の動的な記憶域の確保・解放に関する処理
のオーバヘッドの減少するという効果を奏する。As described above, according to the present invention,
This has the effect of reducing the processing overhead associated with securing and releasing a dynamic storage area in a program.
【0081】この理由は、本発明においては、プログラ
ム中の動的な記憶域の確保・解放の要求を静的に解析可
能な範囲で解析して、生存区間が重複しない複数の動的
な記憶域を検出し、複数の動的な記憶域の共有化を図る
ことによって、動的な記憶域の確保・解放のための記憶
域管理用ライブラリ関数の呼出しを削減したことによ
り、少なくとも削減された記憶域管理用ライブラリ関数
分だけオーバヘッドが低減されるためである。The reason for this is that, in the present invention, a request for securing and releasing a dynamic storage area in a program is analyzed within a statically analyzable range, and a plurality of dynamic storage areas whose live ranges are not overlapped are analyzed. By reducing the number of calls to the library function for storage management to secure and release the dynamic storage area by detecting the storage area and sharing multiple dynamic storage areas, at least it was reduced. This is because the overhead is reduced by the storage management library function.
【図1】本発明の実施の形態を示す構成を示す図であ
る。FIG. 1 is a diagram showing a configuration showing an embodiment of the present invention.
【図2】本発明の実施の形態におけるデータフロー情報
7の構成を示す図である。FIG. 2 is a diagram showing a configuration of data flow information 7 according to the embodiment of the present invention.
【図3】本発明の実施の形態における制御フロー情報8
の構成を示す図である。FIG. 3 is control flow information 8 according to the embodiment of the present invention.
It is a figure which shows the structure of.
【図4】本発明の実施の形態における生存区間情報9の
構成を示す図である。FIG. 4 is a diagram showing a configuration of live range information 9 according to the embodiment of the present invention.
【図5】本発明の実施の形態における生存区間重複状況
情報10の構成を示す図である。FIG. 5 is a diagram showing a configuration of live range overlap status information 10 in the embodiment of the present invention.
【図6】本発明の実施の形態におけるグループ情報11
の構成を示す図である。FIG. 6 is a group information 11 according to the embodiment of this invention.
It is a figure which shows the structure of.
【図7】本発明の実施例におけるソースプログラム6の
具体例を示す図である。FIG. 7 is a diagram showing a specific example of a source program 6 in the embodiment of the present invention.
【図8】本発明の実施例におけるデータフロー情報7の
具体例を示す図である。FIG. 8 is a diagram showing a specific example of data flow information 7 according to the embodiment of the present invention.
【図9】本発明の実施例における制御フロー情報8の具
体例を示す図である。FIG. 9 is a diagram showing a specific example of control flow information 8 in the embodiment of the present invention.
【図10】本発明の実施例における生存区間情報9の具
体例を示す図である。FIG. 10 is a diagram showing a specific example of live range information 9 according to the embodiment of the present invention.
【図11】本発明の実施例における生存区間重複状況情
報10の具体例を示す図である。FIG. 11 is a diagram showing a specific example of live range overlap status information 10 in the embodiment of the present invention.
【図12】本発明の実施例におけるグループ情報11の
具体例を示す図である。FIG. 12 is a diagram showing a specific example of group information 11 in the embodiment of the present invention.
【図13】本発明の実施例におけるソースプログラム6
の変更後の具体例を示す図である。FIG. 13 is a source program 6 according to the embodiment of the present invention.
It is a figure which shows the specific example after the change of.
1 言語処理系 2 生存区間検出手段 3 生存区間重複検出手段 4 グループ化手段 5 プログラム変更手段 6 ソースプログラム 7 データフロー情報 8 制御フロー情報 9 生存区間情報 10 生存区間重複状況情報 11 グループ情報 1 language processing system 2 live range detection means 3 live range duplicate detection means 4 grouping means 5 program changing means 6 source program 7 data flow information 8 control flow information 9 live range information 10 live range overlap status information 11 group information
Claims (2)
中で発行される動的な記憶域の確保・解放要求に関する
データフロー情報、及び該プログラムの制御フロー情報
に基づき、複数の動的な記憶域間での生存区間の重複状
況を検出し、共有可能な複数の記憶域を検出して共有さ
せることにより、動的な記憶域の確保・解放のための記
憶域管理用のライブラリ呼出しを削減するように前記ソ
ース・プログラムを自動修正する手段を備えたことを特
徴とする、動的記憶域割り付け方式。1. A plurality of dynamic storage areas based on data flow information relating to a dynamic storage area securing / releasing request issued in the program by analyzing a source program and control flow information of the program. By detecting the duplication status of live ranges between multiple storage areas and detecting and sharing multiple storage areas that can be shared, the number of library calls for storage area management to dynamically secure and release storage areas is reduced. A dynamic storage area allocation method comprising means for automatically modifying the source program as described above.
・解放する機能を有するプログラミング言語に対する言
語処理系において、 確保する記憶域のサイズがプログラムの翻訳時に判明す
る、動的な記憶域の確保要求を検出し、前記確保要求に
対して返却された記憶域を識別するポインタ値に関する
データフローと、プログラムの制御フローと、を解析し
て、前記ポインタ値が識別する記憶域に対する確保要求
から最も離れた位置の解放要求を検出し、これにより確
保された記憶域の生存区間を検出する生存区間検出手段
と、 前記生存区間検出手段によって検出された複数の動的記
憶域の生存区間の重複を検査する生存区間重複検査手段
と、 前記生存区間重複検査手段によって判明した生存区間の
重複状況を考慮して、同一の記憶域を共有可能な1又は
複数の動的記憶域にグループ化するグループ化手段と、 一つのグループ中の動的記憶域のうち、最も大きいサイ
ズの記憶域を該グループ中で、その生存区間が最も早く
開始される動的記憶域の生存区間の先頭で確保し、該グ
ループ中でその生存区間が最も遅く終了する動的記憶域
の生存区間の最後で解放し、同一グループに属する動的
記憶域の確保・解放の要求を無効として、グループの先
頭で確保された記憶域を共有して利用するように、プロ
グラムを変更するプログラム変更手段と、 を備えたことを特徴とする動的記憶域割り付け方式。2. In a language processing system for a programming language having a function of dynamically reserving / releasing a storage area during execution of a program, the size of the reserving storage area is determined dynamically when the program is translated. Securement request for the storage area identified by the pointer value by analyzing the data flow relating to the pointer value identifying the storage area returned in response to the securement request and the control flow of the program. A release request at the position farthest from the live range detecting means for detecting the live range of the storage area secured thereby, and the live range of the plurality of dynamic storage areas detected by the live range detecting means. The same storage area is shared in consideration of the live range duplication checking means for checking duplication and the duplication status of the live ranges found by the live range duplication checking means. Grouping means for grouping into one or a plurality of active dynamic storage areas, and the storage area having the largest size among the dynamic storage areas in one group, and the live range thereof starts earliest. Secured at the beginning of the live range of the dynamic storage area that is allocated, and released at the end of the live range of the dynamic storage area where the live range ends the latest in the group, and secure the dynamic storage area that belongs to the same group -A dynamic storage area allocation method characterized by including program changing means for changing a program so that a storage area secured at the head of a group is shared and used by invalidating a release request.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP8168634A JPH09330232A (en) | 1996-06-07 | 1996-06-07 | Dynamic storage allocation method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP8168634A JPH09330232A (en) | 1996-06-07 | 1996-06-07 | Dynamic storage allocation method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH09330232A true JPH09330232A (en) | 1997-12-22 |
Family
ID=15871687
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP8168634A Pending JPH09330232A (en) | 1996-06-07 | 1996-06-07 | Dynamic storage allocation method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH09330232A (en) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6647547B1 (en) | 1999-05-18 | 2003-11-11 | Matsushita Electric Industrial Co., Ltd. | Program conversion apparatus for eliminating unnecessary indications of dynamic memory allocation from a source program and generating an executable program |
| JP2005071331A (en) * | 2003-08-26 | 2005-03-17 | Microsoft Corp | Data flow analysis for transactional process |
| US8028017B2 (en) * | 2009-04-16 | 2011-09-27 | International Business Machines Corporation | Virtual controllers with a large data center |
| JP2023004763A (en) * | 2021-06-28 | 2023-01-17 | 富士電機株式会社 | Program conversion device, program conversion method, and program |
-
1996
- 1996-06-07 JP JP8168634A patent/JPH09330232A/en active Pending
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6647547B1 (en) | 1999-05-18 | 2003-11-11 | Matsushita Electric Industrial Co., Ltd. | Program conversion apparatus for eliminating unnecessary indications of dynamic memory allocation from a source program and generating an executable program |
| JP2005071331A (en) * | 2003-08-26 | 2005-03-17 | Microsoft Corp | Data flow analysis for transactional process |
| US8196122B2 (en) | 2003-08-26 | 2012-06-05 | Microsoft Corporation | Data flow analysis of transactional processes |
| US8028017B2 (en) * | 2009-04-16 | 2011-09-27 | International Business Machines Corporation | Virtual controllers with a large data center |
| JP2023004763A (en) * | 2021-06-28 | 2023-01-17 | 富士電機株式会社 | Program conversion device, program conversion method, and program |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5642501A (en) | Computer method and apparatus for asynchronous ordered operations | |
| US4991088A (en) | Method for optimizing utilization of a cache memory | |
| EP0549140A2 (en) | Record updating method | |
| JPH1115726A (en) | Computer control method, apparatus, system, and computer program product | |
| JPH05204656A (en) | Method for holding data inherent in thread | |
| US6129458A (en) | Cache optimization method | |
| JP3611295B2 (en) | Computer system, memory management method, and storage medium | |
| US5634120A (en) | Computer system supporting utilization of utility functions applicable to concurrently executing jobs by monitoring job excution characteristics and determining eligible job combinations for utility function | |
| JPH09330232A (en) | Dynamic storage allocation method | |
| JPH04219844A (en) | High-speed medium preferential release type exclusive system | |
| Kersten et al. | Application of an optimistic concurrency control method | |
| CN117519945A (en) | A database resource scheduling method, device and system | |
| KR20020070270A (en) | A method for garbage collection of unused methods | |
| JPS63200257A (en) | Program loading system for computer | |
| JP2787107B2 (en) | Buffer control system and device | |
| CN121029432B (en) | Fusion operator execution method, electronic device, storage medium and program product | |
| JP2000132406A (en) | Object memory optimization method | |
| JPH0444140A (en) | Virtual memory control method | |
| JP3693311B2 (en) | Distributed processing system | |
| JPH0877068A (en) | Multiprocessor system and memory allocation optimization method | |
| JP3511935B2 (en) | File writing method in multi-thread program | |
| JP4131579B2 (en) | Data management system and data management method | |
| JP3293821B2 (en) | Dynamic link system | |
| JP3006527B2 (en) | Client / server type database system | |
| CN115437929A (en) | Android activity management service synchronous load reduction method based on escape analysis |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20000201 |