JPS6362053A - Garbage collection processing system - Google Patents
Garbage collection processing systemInfo
- Publication number
- JPS6362053A JPS6362053A JP20752186A JP20752186A JPS6362053A JP S6362053 A JPS6362053 A JP S6362053A JP 20752186 A JP20752186 A JP 20752186A JP 20752186 A JP20752186 A JP 20752186A JP S6362053 A JPS6362053 A JP S6362053A
- Authority
- JP
- Japan
- Prior art keywords
- address
- garbage collection
- area
- destination address
- destination
- 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
Landscapes
- Devices For Executing Special Programs (AREA)
Abstract
Description
【発明の詳細な説明】
〔概要〕
動的な領域管理を行い、適宜、ガーベジコレクションを
実行するデータ処理システムにおいて。DETAILED DESCRIPTION OF THE INVENTION [Summary] In a data processing system that performs dynamic area management and performs garbage collection as appropriate.
ガーベジコレクションが起動されたときに、必要な場所
のアドレスを先頭アドレスからの変位(オフセット)に
−時的に書き換えることによって。When garbage collection is activated, by temporarily rewriting the address of the required location to a displacement (offset) from the starting address.
復帰先アドレスの変更に対処できるようにし、命令コー
ドも移動可能として、命令コード領域とデータ領域との
分割を不要としている。It is possible to deal with changes in the return destination address, and the instruction code is also movable, eliminating the need for division into an instruction code area and a data area.
本発明は2例えばLISP処理装置のような動的な領域
管理を行うシステムに係り、特に命令コードが格納され
ている領域についても、ガーベジコレクションの対象と
なるようにしたガーベジコレクション処理方式に関する
ものである。The present invention relates to a system that performs dynamic area management, such as a LISP processing device, and particularly relates to a garbage collection processing method in which an area where instruction codes are stored is also subject to garbage collection. be.
動的な領域管理を行うシステムでは、処理において必要
となった領域をダイナミックに切り出して使用するが、
不要になった領域について回収するために、ガーベジコ
レクションを行う必要がある。このようなシステムでは
、ユーザにできるだけ負担を与えないで、領域の有効利
用を可能とすることが望まれている。In a system that performs dynamic area management, the area required for processing is dynamically extracted and used.
Garbage collection must be performed to reclaim areas that are no longer needed. In such a system, it is desirable to be able to utilize the area effectively while placing as little burden on the user as possible.
第4図は従来方式の例を示す。第4図において。 FIG. 4 shows an example of the conventional method. In Fig. 4.
40は命令コード領域、41はデータ領域を表す。40 represents an instruction code area, and 41 represents a data area.
リスト処理機能を有するLISPシステム等では、はと
んどのデータについて、数値か1文字列か、シンボルか
、配列かというような区別なしに。In LISP systems and the like that have list processing functions, most data is treated without distinction, such as whether it is a numerical value, a string of characters, a symbol, or an array.
同一のデータ領域を使用しているため、ユーザに対し、
実行するプログラム毎に領域の分割比率を指定させると
いった負担をかけない。Since the same data area is used,
There is no need to specify the area division ratio for each program to be executed.
しかし、コンパイルされた命令コードについては、領域
を分割し、命令コードだけを格納する命令コード領域4
0をユーザに予め指定させている。However, for the compiled instruction code, the area is divided into an instruction code area 4 that stores only the instruction code.
0 is specified by the user in advance.
即ち、ユーザは、予め命令コード領域4oのサイズまた
は比率を指定し、固定化(F I X)させておく必要
がある。That is, the user needs to specify the size or ratio of the instruction code area 4o in advance and fix it (FIX).
その理由は、データ領域41については、第4図に示す
ように、ガーベジコレクションの対象となるが、命令コ
ード領域4oについては9通常のガーベジコレクション
の対象とすることができないためである。The reason for this is that while the data area 41 is subject to garbage collection as shown in FIG. 4, the instruction code area 4o cannot be subject to normal garbage collection.
命令コード領域40を、一般のデータ領域41のように
、ガーベジコレクションの対象とすると。Assume that the instruction code area 40 is subjected to garbage collection like the general data area 41.
命令コードの格納位置が移動することになる。しかし、
ガーベジコレクションでは、移動単位の先頭以外のアド
レスは更新できないため、命令コード中から別間数を呼
び出したときに、ガーベジコレクションが起動されると
、正しく復帰できないこととなる。関数を呼び出す場合
、その復帰先アドレスは、一連の命令コードの途中とな
るからである。The storage location of the instruction code will be moved. but,
Garbage collection cannot update addresses other than the beginning of a movement unit, so if garbage collection is activated when a separate number is called from the instruction code, it will not be possible to return correctly. This is because when a function is called, its return address is in the middle of a series of instruction codes.
なお、格納位置の移動を行わない特殊なガーベジコレク
ションもある。格納位置の移動を行わない方式では、空
き領域がなくなったとき、使用中領域に印をつけるだけ
にとどめ、2回目からは。Note that there is also a special type of garbage collection that does not move the storage location. In a method that does not move the storage location, when there is no more free space, the system only marks the area that is in use, and from the second time onwards.
印のない領域部分のみを使用する。必要な大きさの領域
が取れない場合には、別の無印領域をさがす。しかし、
この方式では、しばしば領域の細分化(フラグメンテー
ション)が生じて、全体量としては足りているのに、必
要な領域が取れないという現象が起きる。Use only the unmarked areas. If an area of the required size cannot be obtained, another unmarked area is searched. but,
In this method, fragmentation of the area often occurs, resulting in a phenomenon in which the required area cannot be obtained even though the total amount is sufficient.
従って、一般的なガーベジコレクションでは。Therefore, in general garbage collection.
命令コード用領域を固定化し、データ用の領域について
、格納位置の移動を行う処理方式が採用されている。A processing method is adopted in which the instruction code area is fixed and the storage location of the data area is moved.
従来方式によれば、命令コード用の領域と、データ用の
領域とを分割する必要があるため、領域の分割損が生じ
るという問題がある。また2分割比率について、事前に
見積もって、指定する必要があるので、ユーザに負担を
かけるという問題がある。その見積りに誤りがある場合
、領域あぶれが生じたり、領域に無駄が生じたりするこ
とがある。According to the conventional method, since it is necessary to divide an area for instruction codes and an area for data, there is a problem in that area division loss occurs. Furthermore, since it is necessary to estimate and specify the 2-split ratio in advance, there is a problem of placing a burden on the user. If there is an error in the estimate, the area may be overflowed or the area may be wasted.
本発明は上記問題点の、解決を図り、命令コード領域と
データ領域とを区別する必要がない領域管理手段を提供
することを目的としている。An object of the present invention is to solve the above-mentioned problems and to provide an area management means that does not require distinguishing between an instruction code area and a data area.
第1図は本発明の原理ブロック図を示す。 FIG. 1 shows a block diagram of the principle of the present invention.
第1図において、10はコンパイルされた命令コード列
からなる関数呼び出し部、11は関数呼び出し部10か
ら呼び出される関数部、12はスタック領域等のアドレ
ス保存部、13は関数呼び出し部10の先頭アドレスを
記憶する先頭アドレス記憶部、14は関数部11から関
数呼び出し部10への復帰先アドレスを記憶する復帰先
アドレス記憶部、15はガーベジコレクションの処理を
実行するガーベジコレクション部、16は復帰先アドレ
ス記憶部14の内容をオフセントに更新するオフセット
設定部、17は先頭アドレス記憶部13の内容を更新す
る移動先アドレス設定部、18はオフセットを正しい復
帰先アドレスに修正する復帰先アドレス修正部を表す。In FIG. 1, reference numeral 10 indicates a function call section consisting of a compiled instruction code string, 11 indicates a function section called from the function call section 10, 12 indicates an address storage section such as a stack area, and 13 indicates the start address of the function call section 10. 14 is a return address storage section that stores the return address from the function section 11 to the function call section 10. 15 is a garbage collection section that executes garbage collection processing. 16 is a return address. An offset setting unit updates the contents of the storage unit 14 to an offset; 17 represents a destination address setting unit that updates the contents of the start address storage unit 13; and 18 represents a return address correction unit that corrects the offset to the correct return address. .
なお、再帰呼び出し等の場合には、関数呼び出し部10
と関数部11とが同じものであることがある。Note that in the case of recursive calling, etc., the function calling unit 10
and the function section 11 may be the same.
本発明の場合、関数呼び出し部10が、関数部11を呼
び出すとき、呼び出し元である関数呼び出し部10の先
頭アドレスAを、先頭アドレス記憶部13に保存し、ま
た復帰先アドレスRを復帰先アドレス記憶部14に保存
する。呼び出された関数部11の実行中に、ガーベジコ
レクションが起きなければ、そのまま復帰先アドレス記
憶部14が記憶するアドレスRに復帰する。In the case of the present invention, when the function calling section 10 calls the function section 11, it stores the start address A of the function calling section 10, which is the calling source, in the start address storage section 13, and also stores the return destination address R as the return destination address. It is saved in the storage unit 14. If garbage collection does not occur during the execution of the called function section 11, the function returns directly to the address R stored in the return destination address storage section 14.
関数部11の実行中に2例えば図示2点でガーベジコレ
クションが起きると、ガーベジコレクション部15のオ
フセット設定部16は、復帰先アドレスRを保存してい
る場所をすべてたどり、そのアドレスを、先頭アドレス
Aからの変位(R−A)に更新する。When garbage collection occurs at two points, for example, two points shown in the figure, during the execution of the function section 11, the offset setting section 16 of the garbage collection section 15 traces all the locations where the return destination address R is stored, and converts that address into the starting address. Update to the displacement from A (RA).
次に1通常のガーベジコレクションが行われる。Next, 1 normal garbage collection is performed.
このガーベジコレクションで、関数呼び出し部10全体
が、先頭アドレスA1の位置に移動したとする。移動先
アドレス設定部17は、復帰先アドレス記憶部14の内
容を、新しい移動先のアドレスA1に更新する。Assume that the entire function calling section 10 is moved to the position of the start address A1 by this garbage collection. The destination address setting unit 17 updates the contents of the return destination address storage unit 14 to the new destination address A1.
復帰先アドレス修正部18は、アドレス保存部12にお
ける復帰先アドレス記憶部14を再びたどり、変位(R
−A)に移動先アドレスAIを加えることにより、復帰
先アドレス記憶部14の内容を、新しい復帰先アドレス
R1に更新する。The return destination address correction unit 18 traces the return destination address storage unit 14 in the address storage unit 12 again and calculates the displacement (R
By adding the destination address AI to -A), the contents of the destination address storage section 14 are updated to the new destination address R1.
ガーベジコレクション終了後、関数部11の2点から実
行が再開され、関数部11による処理が終了すると、新
しい関数呼び出し部10の復帰先アドレスR1に復帰す
ることとなる。After the garbage collection is completed, execution is restarted from two points in the function unit 11, and when the processing by the function unit 11 is completed, the return destination address R1 of the new function call unit 10 is returned.
なお、先頭アドレス記憶部13の内容は、復帰先アドレ
スの変位を算出するために用いるだけではなく、ペース
レジスタへの設定に用いるなど。Note that the contents of the start address storage section 13 are used not only for calculating the displacement of the return destination address, but also for setting in the pace register.
他の目的に使用することも可能である。It is also possible to use it for other purposes.
オフセット設定部16によって、復帰先アドレスRは、
−時的に先頭アドレスAからの変位に置き換えられる。The offset setting unit 16 sets the return destination address R as follows.
- Temporarily replaced by a displacement from the top address A.
この変位(R−A)は、関数呼び出し部10が、何処に
移動しても、変わることはない。従って、先頭アドレス
Aがガーベジコレクションによって変わった場合に、新
しい先頭アドレスA1と、変位(R−A)とから、新し
い復帰先アドレス(R1=R−A+A I)を求めるこ
とができる。こうすることにより、ガーベジコレクショ
ン部15は、移動単位の先頭以外のアドレスについても
、更新することができ、正しい復帰先を保証できるので
、関数呼び出し部10についても2通常のデータと同様
に移動することができるようになる。即ち、命令コード
の領域についても。This displacement (RA) does not change no matter where the function calling unit 10 moves. Therefore, when the start address A changes due to garbage collection, a new return destination address (R1=RA+A I) can be obtained from the new start address A1 and the displacement (RA). By doing this, the garbage collection unit 15 can update addresses other than the beginning of the movement unit and can guarantee the correct return destination, so the function call unit 10 can also be moved in the same way as normal data. Be able to do things. That is, regarding the instruction code area as well.
ガーベジコレクションの対象にすることができる。Can be subject to garbage collection.
第2図は本発明の一実施例、第3図は第2図図示実施例
におけるスタックの使用例を示す。FIG. 2 shows an embodiment of the present invention, and FIG. 3 shows an example of the use of the stack in the embodiment illustrated in FIG.
図中、20はCPUおよびメモリ等からなる処理装置、
21はオペレーティング・システム等のシステム制御部
、22はLISPインクプリタを含むLISP制御部、
23はガーベジコレクション起動部、24はコンパイラ
起動部、25はスタック領域、26はガーベジコレクシ
ョンの対象となるヒープ(HEAP)領域、27はユー
ザ作成コンパイルドコード、28は各種データ、29は
コンパイラ、30はユーザDASD、31はシステムD
ASDを表す。In the figure, 20 is a processing device consisting of a CPU, memory, etc.;
21 is a system control unit such as an operating system; 22 is a LISP control unit including a LISP inscriber;
23 is a garbage collection starting section, 24 is a compiler starting section, 25 is a stack area, 26 is a heap (HEAP) area that is subject to garbage collection, 27 is a user-created compiled code, 28 is various data, 29 is a compiler, 30 is user DASD, 31 is system D
Represents ASD.
例えば9本発明は、第2図に示すようなLTSPシステ
ムに適用される。ガーベジコレクションを必要とする動
的な領域管理を行う他のシステムに対しても、同様に適
用することができる。For example, the present invention is applied to an LTSP system as shown in FIG. The present invention can be similarly applied to other systems that perform dynamic area management that requires garbage collection.
ヒープ領域26における空き領域が不足してくると、ガ
ーベジコレクション起動部23は、ガーベジコレクショ
ン部15を起動する。ガーベジコレクション部15は、
第1図に示すオフセット設定部16.移動先アドレス設
定部17.復帰先アドレス修正部18を有している。ま
た、第1図に示すアドレス保存部12として、スタック
領域25が用いられる。When the free space in the heap area 26 becomes insufficient, the garbage collection activation unit 23 activates the garbage collection unit 15. The garbage collection unit 15
Offset setting section 16 shown in FIG. Destination address setting section 17. It has a return destination address correction section 18. Further, a stack area 25 is used as the address storage section 12 shown in FIG.
関数呼び出しによって、呼び出し元の先頭アドレスと、
復帰先アドレスとをスタックする場合。By calling a function, the start address of the caller and
When stacking with the return destination address.
例えば第3図(イ)図示のように、先頭アドレスと復帰
先アドレスとに、それぞれ1バイト分のフラグF1と、
フラグF2とを付加し、これらのフラグによって、スタ
ック内容を識別できるようにする。即ち1例えば第1図
に示すオフセット設定部16が、復帰先アドレス記憶部
14をスタック領域25から探し出す場合、フラグF2
をチェックする。なお、スタック領域25の範囲は9図
示省略したスタックポインタから定められる。For example, as shown in FIG. 3(a), a 1-byte flag F1 is set at the start address and the return destination address, respectively.
A flag F2 is added so that the contents of the stack can be identified by these flags. For example, when the offset setting unit 16 shown in FIG. 1 searches the stack area 25 for the return destination address storage unit 14, the flag F2 is
Check. Note that the range of the stack area 25 is determined from a stack pointer (not shown).
例えば、スタックの1エントリが、4バイトであり、先
頭アドレスおよび復帰先アドレスの保存にも、それぞれ
4バイトの領域が必要となるような場合には、第3図(
ロ)図示のように、フラグFl、フラグF2等を、他の
スタック単位としてまとめて、アドレスとは別に記憶し
てもよい。For example, if one entry in the stack is 4 bytes, and 4 bytes each are required to save the start address and return destination address, then
b) As shown in the figure, the flag Fl, the flag F2, etc. may be stored together as another stack unit and stored separately from the address.
以上説明したように9本発明によれば、命令コード用に
領域を分割する必要がなくなるので、ユーザは、事前に
見積りをするという負担から解放される。領域ごとに用
途が限定されないので、異種プログラムの実行や、デバ
ッグ・ランを繰り返した場合でも、領域あぶれの危険が
少ない。また。As described above, according to the present invention, there is no need to divide the area for instruction codes, so the user is freed from the burden of making an estimate in advance. Since the usage of each area is not limited, there is little risk of area overflow even when different programs are executed or debug runs are repeated. Also.
命令コード領域も区別なく1通常のガーベジコレクショ
ンがなされるので、領域の有効利用が可能となる。Since the instruction code area is also subjected to normal garbage collection without distinction, the area can be used effectively.
第1図は本発明の原理ブロック図、第2図は本発明の一
実施例、第3図は第2図図示実施例におけるスタックの
使用例、第4図は従来方式の例を示す。
図中、10は関数呼び出し部、11は関数部。
12はアドレス保存部、13は先頭アドレス記憶部、1
4は復帰先アドレス記憶部、15はガーベジコレクショ
ン部、16はオフセット設定部、17は移動先アドレス
設定部、18は復帰先アドレス修正部を表す。FIG. 1 is a block diagram of the principle of the present invention, FIG. 2 is an embodiment of the present invention, FIG. 3 is an example of the use of the stack in the embodiment shown in FIG. 2, and FIG. 4 is an example of a conventional system. In the figure, 10 is a function calling section, and 11 is a function section. 12 is an address storage section, 13 is a start address storage section, 1
Reference numeral 4 represents a return destination address storage section, 15 a garbage collection section, 16 an offset setting section, 17 a movement destination address setting section, and 18 a return destination address modification section.
Claims (1)
ーベジコレクションを実行するデータ処理システムにお
いて、 他の処理単位の呼び出し時に、呼び出し元の先頭アドレ
ス(A)と、復帰先アドレス(R)とを保存するアドレ
ス保存手段(12)と、 ガーベジコレクションが起きたときに、ガーベジコレク
ションの対象となる命令コード領域について、上記呼び
出し元の先頭アドレス(A)から上記復帰先アドレス(
R)までの変位(R−A)を算出し、上記復帰先アドレ
ス(R)が保存されている場所を、算出された変位(R
−A)に更新するオフセット設定手段(16)と、 ガーベジコレクションにより、呼び出し元の命令コード
が移動した場合に、上記呼び出し元の先頭アドレス(A
)の格納場所を、移動先の新しい先頭アドレス(A1)
に更新する移動先アドレス設定手段(17)と、 上記オフセット設定手段(16)が設定した変位(R−
A)に、上記移動先の新しい先頭アドレス(A1)を加
え、その変位格納場所に、新しい復帰先アドレス(R−
A+A1)を設定する復帰先アドレス修正手段(18)
とを備え、 命令コード領域とデータ領域とを共通な領域上で管理す
るようにしたことを特徴とするガーベジコレクション処
理方式。[Claims] In a data processing system that performs dynamic area management and performs garbage collection on areas that are no longer needed, when another processing unit is called, the start address (A) of the caller and the return an address storage means (12) for storing a destination address (R); and an address storage means (12) for storing a destination address (R); (
The displacement (R-A) up to R) is calculated, and the location where the above return address (R) is saved is set to
- an offset setting means (16) for updating to A), and an offset setting means (16) for updating the above-mentioned starting address of the calling source (A) when the instruction code of the calling source is moved due to garbage collection;
) to the new starting address (A1)
the displacement (R-) set by the offset setting means (16);
Add the new start address (A1) of the movement destination to A), and add the new return destination address (R-) to the displacement storage location.
Return destination address correction means (18) for setting A+A1)
A garbage collection processing method characterized in that an instruction code area and a data area are managed in a common area.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP20752186A JPS6362053A (en) | 1986-09-03 | 1986-09-03 | Garbage collection processing system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP20752186A JPS6362053A (en) | 1986-09-03 | 1986-09-03 | Garbage collection processing system |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPS6362053A true JPS6362053A (en) | 1988-03-18 |
Family
ID=16541097
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP20752186A Pending JPS6362053A (en) | 1986-09-03 | 1986-09-03 | Garbage collection processing system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS6362053A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2008525915A (en) * | 2004-12-30 | 2008-07-17 | インテル コーポレイション | Reduce memory fragmentation |
| JP2014010661A (en) * | 2012-06-29 | 2014-01-20 | Fujitsu Ltd | Program, method and device for branch address management |
-
1986
- 1986-09-03 JP JP20752186A patent/JPS6362053A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2008525915A (en) * | 2004-12-30 | 2008-07-17 | インテル コーポレイション | Reduce memory fragmentation |
| JP2014010661A (en) * | 2012-06-29 | 2014-01-20 | Fujitsu Ltd | Program, method and device for branch address management |
| US9417872B2 (en) | 2012-06-29 | 2016-08-16 | Fujitsu Limited | Recording medium storing address management program, address management method, and apparatus |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0317080A2 (en) | Method and apparatus using variable ranges to support symbolic debugging of optimized code | |
| KR890004236A (en) | Stack Control | |
| US5297285A (en) | System for dynamically linking modular portions of computer software | |
| KR101244104B1 (en) | Computer system and method of adapting a computer system to support a register window architecture | |
| US4454580A (en) | Program call method and call instruction execution apparatus | |
| EP0069525A1 (en) | Data processing system | |
| KR930016880A (en) | Electronic device and its fixing information | |
| US6934939B2 (en) | Method for unwinding a program call stack | |
| EP0359254A2 (en) | Method of back-tracking in computer processing | |
| EP4345612B1 (en) | Program call stack creation method, and stack backtrace method and apparatus | |
| CN114816532B (en) | Register allocation method for improving RISC-V binary code density | |
| JP5186802B2 (en) | Microprocessor | |
| US5150474A (en) | Method for transferring arguments between object programs by switching address modes according to mode identifying flag | |
| WO2001057656A2 (en) | Reduced size object headers | |
| CN117234953A (en) | Kernel debugging method based on shadow code cache | |
| US7926048B2 (en) | Efficient call sequence restoration method | |
| KR940007701A (en) | Electronic device | |
| EP0180077B1 (en) | A data processing machine for compiling computer programs | |
| JPH05297911A (en) | Sequence control circuit for sequence controller | |
| Schimpf | Garbage collection for Prolog based on twin cells | |
| US20030225973A1 (en) | Two area stack | |
| JPS6142301B2 (en) | ||
| JP2573391B2 (en) | Programmable controller | |
| JPH0792754B2 (en) | Assembling device | |
| JPH0667942A (en) | Log extraction system |