JPS6393055A - Real time type garbage collection back-up device - Google Patents

Real time type garbage collection back-up device

Info

Publication number
JPS6393055A
JPS6393055A JP61238500A JP23850086A JPS6393055A JP S6393055 A JPS6393055 A JP S6393055A JP 61238500 A JP61238500 A JP 61238500A JP 23850086 A JP23850086 A JP 23850086A JP S6393055 A JPS6393055 A JP S6393055A
Authority
JP
Japan
Prior art keywords
data
garbage collection
space
argument
register
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
JP61238500A
Other languages
Japanese (ja)
Inventor
Koji Hayashi
耕司 林
Toshihiro Ozawa
年弘 小沢
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP61238500A priority Critical patent/JPS6393055A/en
Publication of JPS6393055A publication Critical patent/JPS6393055A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To realize the real time type garbage collection at a high speed and with high object efficiency by simplifying decision of conditions done when a symbol processing program is executed in the form of the load and store instructions to be given to an external register. CONSTITUTION:The head address of a memory area equivalent to the present new space is written to an external register 203. When an entrance argument is needed at the entrance of an incorporated function or predicate, the relevant argument is written to a register 203. Then comparators 204 and 205 work with said argument writing timing. The comparator 205 outputs '1' when the pointer written to an external register 202 is larger than the end address written to the register 203. Therefore the output of an AND circuit 206 is equal to '1' as long as said pointer is kept between the head address and the end address. Then an argument pointer indicates a new space and no interruption is produced to a CPU 310. When the argument pointer indicates an old space, a control circuit 221 applies an interruption to the CPU 310 via an interruption request signal line 333.

Description

【発明の詳細な説明】 〔百 次〕 概要 産業上の利用分野 従来の技術 発明が解決しようとする問題点 問題点を解決するための手段 作用 実施例 ■、実施例と第1図との対応関係 ■、実施例の構成 ■、実施例の動作 ■1発明の変形態様 発明の効果 〔概 要〕 本発明は、記号処理プログラムの実行と、ガーベジコレ
クションとを交互に行なう実時間型ガーベジコレクショ
ン方式の支援装置であって、データの記憶領域上におけ
る格納空間位置および旧字間から新空間へのデータ移動
状態をハードウェアにより検出し、中央処理装置に対し
て割り込み処理を行なうことにより、実時間型ガーベジ
コレクションを高速に行ない、かつプログラムコードの
大きさをコンパクトにすることができるようにしたもの
である。
[Detailed description of the invention] [100th] Overview Industrial field of application Conventional technology Problems to be solved by the invention Means for solving the problems Example of action ■ Correspondence between the example and Fig. 1 Relationship ■, Structure of the embodiment ■, Operation of the embodiment ■1 Variations of the invention Effects of the invention [Summary] The present invention is a real-time garbage collection method that alternately performs execution of a symbolic processing program and garbage collection. This is a support device that uses hardware to detect the storage space position in the data storage area and the state of data movement from the old character to the new space, and performs interrupt processing to the central processing unit. This allows type garbage collection to be performed at high speed and the size of the program code to be compact.

〔産業上の利用分野〕[Industrial application field]

本発明は、rLIsPJ、rPrologJその他の記
号処理言語のための実時間型ガーベジコレクション支援
装置に関する。
The present invention relates to a real-time garbage collection support device for rLIsPJ, rPrologJ, and other symbolic processing languages.

rLIsPJ、rPrologJその他の記号処理言語
では、プログラムの実行時に動的に記憶領域の割当てを
行なうために記憶領域が浪費される。したがって、不要
になった記憶領域を回収して未使用領域に戻し再利用す
るガーベジコレクション(garbage colle
ction)が必要になる。
In rLIsPJ, rPrologJ, and other symbolic processing languages, storage space is wasted because storage space is dynamically allocated during program execution. Therefore, garbage collection is a process that collects storage areas that are no longer needed and returns them to unused areas for reuse.
ction) is required.

〔従来の技術〕[Conventional technology]

従来、記憶領域が使い尽くされた時点で、記号処理を行
なうプログラムを一時中断し、記憶領域の回収および再
利用を一括して行なう一括型ガーベジコレクション方式
が用いられてきた。
Conventionally, a batch garbage collection method has been used in which when a storage area is used up, a program that performs symbolic processing is temporarily suspended, and the storage area is collected and reused all at once.

ところが、近年rLIsPJ、rPro 1ogJその
他の記号処理言語が、実用的な応用(例えばプラント制
御など)に用いられるに従って、ガーベジコレクション
動作中における記号処理プログラムの長時間中断が問題
となった。これを解決するために、記号処理と記憶領域
の回収を交互に行ない、ガーベジコレクションによる記
号処理プログラムの中断をできるだけ短くする実時間型
のガーベジコレクション方式が要求されてきた。
However, in recent years, as rLIsPJ, rPro 1ogJ, and other symbolic processing languages have been used for practical applications (for example, plant control), long interruptions of symbolic processing programs during garbage collection operations have become a problem. To solve this problem, there has been a need for a real-time garbage collection method that alternately performs symbol processing and storage area recovery to shorten the interruption of symbol processing programs due to garbage collection as much as possible.

実時間型のガーベジコレクション方式には、ペイカー(
Baker)のアルゴリズムによる方式が発表されてい
るが、これはコピー法による一括型ガーベジコレクショ
ン方弐を発展させたものである。
Real-time garbage collection methods include paker (
Baker's algorithm has been announced, which is an evolution of the bulk garbage collection method using the copy method.

第4図は、コピー法による一括型ガーベジコレクション
方式を説明する図である。第4図(a)はその概念図で
あり、第4図(blはその動作説明図である。
FIG. 4 is a diagram illustrating a batch garbage collection method using the copy method. FIG. 4(a) is a conceptual diagram thereof, and FIG. 4(bl) is an explanatory diagram of its operation.

コピー法では記憶領域が二つの空間に分割され、記号処
理プログラムはいずれか一方の空間を使って進行する。
In the copy method, the storage area is divided into two spaces, and the symbol processing program uses one of the spaces to proceed.

いま、記号処理プログラムが使用している記憶領域が使
い尽くされると、記号処理プログラムが中断されガーベ
ジコレクションが起動される。ガーベジコレクションは
、記憶領域を使い尽くした旧字間410から、記号処理
プログラムから参照可能な有効データ411のみを新空
間420へ移動することにより、無駄な記↑α領域を振
り分は回収する。すべての有効データの移動が完了する
と、中断していた記号処理プログラムが再開され、新空
間420の有効データ421に対してデータ参照が行な
われる(425)。
When the storage area currently being used by the symbol processing program is used up, the symbol processing program is interrupted and garbage collection is activated. Garbage collection recovers wasteful writing ↑α area by moving only valid data 411 that can be referenced from the symbol processing program from the old character space 410 that has used up the storage area to the new space 420. When all valid data has been moved, the interrupted symbol processing program is restarted, and data references are made to the valid data 421 in the new space 420 (425).

これに対して、ペイカーのアルゴリズムによる実時間型
ガーベジコレクション方式は、一方の記憶領域が使い尽
くされてからの有効データの移動量を一回当たり有限個
数kに制限し、信号処理プログラムの実行と並列して複
数回数に分割して行なうことにより、ガーベジコレクシ
ョンによる記号処理プログラムの中断を短く抑えること
を特徴としている。
On the other hand, the real-time garbage collection method using Paker's algorithm limits the movement of valid data to a finite number k at a time after one storage area is used up, and The feature is that the interruption of the symbol processing program due to garbage collection can be kept short by dividing it into multiple times in parallel.

第5図は、ペイカーのアルゴリズムによる実時間型ガー
ベジコレクション方式を説明する図である。第5図(a
lはその概念図であり、第5図(blはその動作説明図
である。
FIG. 5 is a diagram illustrating a real-time garbage collection method using Paker's algorithm. Figure 5 (a
1 is its conceptual diagram, and FIG. 5 (bl is its operation explanatory diagram).

実時間型ガーベジコレクション方式では、記号処理プロ
グラムを完全に中断してデータの移動を一度に済ませて
空間を切り換える一括型と異なり、データの移動をに個
ずつ分割して行なうので、ガーベジコレクションが開始
されてから終了するまでの間は、ガーベジコレクション
と記号処理プログラムが交互に実行されることになる。
Unlike the batch type, which completely suspends the symbolic processing program and moves the data all at once to switch spaces, the real-time garbage collection method moves the data in parts, dividing the data into pieces, so garbage collection starts immediately. Garbage collection and symbol processing programs will be executed alternately between the time the program is executed and the program terminates.

すなわち、記号処理プログラムからのデータ参照はまず
旧字間510に対して行なわれ、参照される有効データ
511,512が新空間520に移動済か移動前かを調
べる。それが移動済であればそのポインタにより指定さ
れる新空間520の有効データ521を参照する。
That is, data reference from the symbol processing program is first made to the old character space 510, and it is checked whether the referenced valid data 511, 512 has been moved to the new space 520 or has not yet been moved. If it has been moved, the valid data 521 in the new space 520 specified by the pointer is referenced.

したがって、ペイカーのアルゴリズムによれば、ガーベ
ジコレクションによる記号処理プログラムの中断を有限
時間内に抑えることができる。
Therefore, according to Paker's algorithm, interruption of the symbol processing program due to garbage collection can be suppressed within a finite time.

参考文献二ヘンリー・ジー・ペイカー・ジュニア、「実
時間型リスト処理方式」、コミュニケイションオブザエ
ーシーエム、第21t’  1978年、(Ilenr
y G、Baker+Jr、+ ”Li5t Proc
essing in RealTime on a 5
erial Computer″ Communica
tionof the ACM、 Vol 2L 19
78 )〔発明が解決しようとする問題点〕 ところが、このようなペイカーのアルゴリズムによる実
時間型ガーベジコレクションでは、記号処理プログラム
とガーベジコレクションとを交互に実行している間は、
記号処理プログラムから参照されるデータが凹空間51
0および新空間520の両方の空間に存在することにな
る。しかも参照されたデータが凹空間にある場合は、ガ
ーベジコレクションの操作によってすでに新空間へ移動
されたデータである可能性がある。
References 2. Henry G. Paker, Jr., "Real-Time List Processing Method," Communications of the ACM, No. 21t' 1978, (Ilenr.
y G, Baker+Jr, +”Li5t Proc
essing in RealTime on a 5
erial Computer” Communica
tion of the ACM, Vol 2L 19
78) [Problem to be solved by the invention] However, in real-time garbage collection using Paker's algorithm, while the symbol processing program and garbage collection are being executed alternately,
Data referenced from the symbol processing program is in the concave space 51
0 and new space 520. Furthermore, if the referenced data is in the concave space, there is a possibility that the data has already been moved to the new space by garbage collection operations.

したがって、記号処理プログラムが正しく動作するため
には、プログラムから見えるすべてのデータが新空間5
20にあることを保証する必要がある。
Therefore, in order for a symbolic processing program to operate correctly, all data visible to the program must be
We need to ensure that it is within 20.

すなわち、「LISPJ、rPro logJその他の
処理系がもつすべての組込関数や述語の入口で、 ■ 引数のポインタチェックを行ない、ポインタが新旧
いずれの空間のデータを指すかを調べ、 ■ 凹空間を指す場合には、ガーベジコレクションによ
りすでに移動済ならばその場所を示すよう引数のポイン
タを更新し、 ■ 移動前であるならば、データを新空間へ移動し引数
のポインタを更新する、 操作が必要になることを意味する。
In other words, ``At the entrance to all built-in functions and predicates of LISPJ, rPro logJ, and other processing systems, ■ perform a pointer check on the argument, find out whether the pointer points to data in the old or new space, and ■ check the concave space. If the data has already been moved by garbage collection, update the argument pointer to point to that location; ■ If the data has not yet been moved, move the data to a new space and update the argument pointer. It means to become.

ここで、■の操作は一括型ガーベジコレクションの場合
にも必要な操作であり、ガーベジコレクションの仕事の
一部として還元されるので特に問題はない。しかし、■
の条件判断は特にガーベジコレクション中でなかった場
合にはまったく無駄に終わる操作であり、また■の操作
も一括型ガーベジコレクションでは必要のない操作であ
る。
Here, the operation (■) is also necessary in the case of batch garbage collection, and there is no particular problem because it is returned as part of the garbage collection work. However,■
Judging the condition is a completely useless operation, especially when garbage collection is not in progress, and operation (2) is also unnecessary in batch garbage collection.

このように、ペイカーのアルゴリズムによる実時間型ガ
ーベジコレクションでは、特に■および■の操作を必要
とするので、その処理系の速度が一括型ガーベジコレク
ションと比較して著しく低下する原因となっている。
In this way, real-time garbage collection using the Paker algorithm requires operations (1) and (2) in particular, which causes the speed of the processing system to drop significantly compared to batch garbage collection.

ここで、たとえばrLIsPJ言語の基本関数であるr
CARJをマイクロプロセッサMC68000のアセン
ブラによって実装した場合について、−捨型ガーベジコ
レクションと実時間型ガーベジコレクションとを比較し
てみる。rcARjは、人力されたポインタがリスト構
造を指す場合にその第一要素を返すことを指示する関数
であり、記号処理プログラムでは頻繁に用いられる。
Here, for example, r which is a basic function of rLIsPJ language
In the case where CARJ is implemented by the assembler of the microprocessor MC68000, a comparison will be made between wasteful garbage collection and real-time garbage collection. rcARj is a function that instructs to return the first element of a list structure when a manually entered pointer points to it, and is frequently used in symbol processing programs.

第6図は、−捨型ガーベジコレクションを持つ処理系の
場合の実装例を示す図である。
FIG. 6 is a diagram illustrating an example of implementation in the case of a processing system having -discard type garbage collection.

ここでは、引数601はスタック602を用いてポイン
タレジスタ(f p)から変位dだけアドレスが上位の
位置におかれて関数へ入力され、関数値はレジスタで返
されることを仮定している。
Here, it is assumed that the argument 601 is input to the function using the stack 602 and placed at a position above the pointer register (fp) by a displacement d, and the function value is returned in the register.

すなわち、コードは、 CAR: move、l   #d(fd)、aOmove、1 
  (ao)、aO となる。この場合には、実行に要するクロック数は28
であり、プログラムをコンパイルした場合のコード量(
オブジェクトの大きさ)は6バイトとなる。
That is, the code is: CAR: move, l #d(fd), aOmove, 1
(ao), aO. In this case, the number of clocks required for execution is 28
, and the amount of code when the program is compiled (
The object size) is 6 bytes.

第7図は、ペイカーのアルゴリズムに基づいた実装例を
示す図である。
FIG. 7 is a diagram showing an implementation example based on Payker's algorithm.

この場合には、前記■、■の処理のためと、移動を行な
うサブルーチンへの引数をセラ1−するオーハヘソドの
ために命令数が増加する。すなわち、引数701はスタ
ック702を用いてポインタレジスタ<f d)から変
位dだけアドレスが上位の位置に置かれて関数へ入力さ
れる。その引数ポインタは、新、旧いずれの空間を指し
ているかが判断される。さらに、変位d”のデータタグ
703を読み、新空間に移動済か否かを判断する。
In this case, the number of instructions increases for processing (1) and (2) above, and for passing arguments to the subroutine that performs the movement. That is, the argument 701 is input to the function using the stack 702, with the address placed at a higher position by a displacement d from the pointer register <f d). It is determined whether the argument pointer points to the new space or the old space. Furthermore, the data tag 703 of the displacement d'' is read to determine whether or not it has been moved to the new space.

以上のコードは、 CAR: move、1  1td(fd)、ao    ;引数
を読み込むcmp、1  11EAP TOP、aO:
ポインタは、新。
The above code is: CAR: move, 1 1td (fd), ao; read arguments cmp, 1 11EAP TOP, aO:
The pointer is new.

bge    CALL C0PY    ;旧いずれ
の空間cmp、 I   HEAP BOTTOM、 
ao  ;を指しているかbge    OK move、b   4d’ (ao)、dO;タグを読
むcmpi、w   FORWARDED、do   
;移動済か?bne        CALL  CO
PYmove、1   (ao)、l1d(fp)  
 ;新空間へのボイbra    OK       
  ンタを引数としCALL C0PY:      
    てセットmoveq、b  ttd、dO;引
数位置セットjsr    C0PY ROUTINE
  ;移動処理ルーチンへ 0に: move、1  1d(fp)、ao    ;d(f
p)は新空間move、1   (ao)、aOを指す
となる。
bge CALL C0PY; Old space cmp, I HEAP BOTTOM,
bge OK move, b 4d' (ao), dO; Read tag cmpi, w FORWARDED, do
; Has it been moved? bne CALL CO
PYmove, 1 (ao), l1d (fp)
;Boy bra to the new space OK
CALL C0PY with data as an argument:
set moveq, b ttd, dO; set argument position jsr C0PY ROUTINE
;Go to movement processing routine 0: move, 1 1d(fp), ao;d(f
p) indicates the new space move, 1 (ao), aO.

したがって、ポインタが新空間のデータを指していた場
合の実行うロック数は96、コード量は64バイトにも
なり、−捨型ガーベジコレクションに比べ約3.4倍の
処理速度と、11倍ものコード量の増加があることにな
る。
Therefore, when the pointer points to data in the new space, the number of locks to be executed is 96 and the amount of code is 64 bytes, which is approximately 3.4 times faster and 11 times faster than garbage collection. This will result in an increase in the amount of code.

このように、実時間型ガーベジコレクションは、記号処
理プログラムに対しては実時間処理を可能とするが、オ
ーバヘッドにより処理速度の低下およびコード量の増加
を引き起こす問題点があった。
As described above, real-time garbage collection enables real-time processing for symbolic processing programs, but has the problem of reducing processing speed and increasing the amount of code due to overhead.

本発明は、このような従来の問題点を解決するもので、
オーバヘッドを抑え高速処理を可能とする実時間型ガー
ベジコレクション支援装置を提供することを目的とする
The present invention solves these conventional problems,
The purpose of the present invention is to provide a real-time garbage collection support device that can suppress overhead and enable high-speed processing.

〔問題点を解決するための手段〕[Means for solving problems]

第1図は、本発明の実時間型ガーベジコレクション支援
装置の原理ブロック図である。本発明装置は、従来ソフ
トウェアにより実現していた実時間型ガーベジコレクシ
ョン方式の一部をハードウェアにより実現するものであ
る。
FIG. 1 is a block diagram of the principle of a real-time garbage collection support device according to the present invention. The device of the present invention implements a part of the real-time garbage collection method, which was conventionally implemented using software, using hardware.

図において、データ格納空間検出手段101は、組込関
数あるいは述語の入口で、入力引数が新空間あるいは旧
空間のいずれの空間を指すかをチェックする。
In the figure, data storage space detection means 101 checks whether an input argument points to a new space or an old space at the entrance of a built-in function or predicate.

データ移動状態検出手段103は、プログラムが参照し
たデータが新空間に移動済のデータであるか移動前のデ
ータであるかをチェックする。
The data movement state detection means 103 checks whether the data referenced by the program is data that has been moved to a new space or data that has not yet been moved.

制御手段105は、データ格納空間検出手段101およ
びデータ移動状態検出手段103の出力が接続され、各
出力が旧空間あるいは移動前を示す場合に中央処理装置
に対して、割込要求信号線333を介してデータ移動の
ための割込要求信号を送出する。
The control means 105 is connected to the outputs of the data storage space detection means 101 and the data movement state detection means 103, and sends an interrupt request signal line 333 to the central processing unit when each output indicates the old space or before movement. An interrupt request signal for data movement is sent via the

〔作 用〕[For production]

本発明は、データの記憶領域上における格納空間位置お
よび旧空間から新空間へのデータ移動状態をハードウェ
アにより検出する。
The present invention uses hardware to detect the storage space position of data in a storage area and the state of data movement from the old space to the new space.

すなわち、データ格納空間検出手段101により、書き
込まれたポインタと記憶領域の新空間のアドレス値とを
比較し、それが旧空間を指すかあるいは新空間を指すか
を判断する。また、旧空間のデータである場合には、さ
らに、データ移動状態検出手段103により、そのデー
タが新空間に移動済のデータであるか移動前のデータで
あるかを、参照ポインタタグの比較により判断する。
That is, the data storage space detection means 101 compares the written pointer with the address value of the new space in the storage area, and determines whether it points to the old space or the new space. If the data is in the old space, the data movement state detection means 103 determines whether the data has been moved to the new space or before movement by comparing reference pointer tags. to decide.

これらの判断および中央処理装置への割込要求をハード
ウェアにより実現することにより、実時間型ガーベジコ
レクションを高速に行ない、かつプログラムコードの大
きさをコンパクトにすることができる。
By implementing these judgments and interrupt requests to the central processing unit using hardware, real-time garbage collection can be performed at high speed and the size of the program code can be made compact.

〔実施例〕〔Example〕

以下、図面に基づいて本発明の実施例について詳細に説
明する。
Hereinafter, embodiments of the present invention will be described in detail based on the drawings.

第2図は、本発明の実時間型ガーベジコレクション方式
の一実施例の構成を示すブロック図である。
FIG. 2 is a block diagram showing the configuration of an embodiment of the real-time garbage collection system of the present invention.

第3図は、本発明実施例の動作を説明するフローチャー
トである。
FIG. 3 is a flowchart illustrating the operation of the embodiment of the present invention.

■、−乍41I!と第1゛との対応 仁ここで、本発明
の実施例と第1図との対応関係を示しておく。
■、-乍41I! Correspondence between the embodiment of the present invention and FIG. 1 Here, the correspondence between the embodiment of the present invention and FIG. 1 will be shown.

データ格納空間検出手段101は、外部レジスタ201
,202,203、比較器204,205および論理積
回路206に相当する。
The data storage space detection means 101 includes an external register 201
, 202, 203, comparators 204, 205, and AND circuit 206.

データ移動状態検出手段103は、外部レジスタ211
、新空間参照ポインタタグ値レジスタ212および比較
器213に相当する。
The data movement state detection means 103 includes an external register 211
, corresponds to the new space reference pointer tag value register 212 and the comparator 213.

制御手段i05は、制御回路221に相当する。The control means i05 corresponds to the control circuit 221.

↓−大1皿■徘戊 以上のような対応関係があるものとして、以下本発明の
実施例について説明する。
↓ - 1 Large Plate ■ Wandering An example of the present invention will be described below, assuming that there is a correspondence relationship as described above.

第2図において、中央処理装置(CPU)310と主記
憶装置320とがアドレスバス331およびデータバス
332を介して接続され、アドレスバス331およびデ
ータバス332の間に本発明の実時間型ガーベジコレク
ション支援装置(一点鎖線で示す)が接続される。
In FIG. 2, a central processing unit (CPU) 310 and a main memory 320 are connected via an address bus 331 and a data bus 332, and between the address bus 331 and the data bus 332, the real-time garbage collection of the present invention is performed. The support device (indicated by a dashed line) is connected.

アドレスバス331には外部レジスタ201゜202.
203,211が接続され、データバス332には外部
レジスフ211,201,202゜203が縦続接続さ
れる。外部レジスタ201゜202の各出力は比較器2
04に接続され、外部レジスタ202,203の各出力
は比較器205に接続される。比較器204.205の
各出力は、論理積回路206を介して制御回路221に
接続される。外部レジスタ211および新空間参照ポイ
ンタタグ値レジスタ212の出力は比較器213に接続
され、比較器213の出力が制御回路221に接続され
る。制御回路221の出力は、割込要求信号線333を
介して中央処理装置310に接続される。
The address bus 331 includes external registers 201, 202.
203 and 211 are connected, and external registers 211, 201, 202 and 203 are connected in cascade to the data bus 332. Each output of external registers 201 and 202 is output to comparator 2.
04, and each output of the external registers 202 and 203 is connected to a comparator 205. Each output of the comparators 204 and 205 is connected to the control circuit 221 via an AND circuit 206. The outputs of the external register 211 and the new space reference pointer tag value register 212 are connected to a comparator 213, and the output of the comparator 213 is connected to the control circuit 221. The output of the control circuit 221 is connected to the central processing unit 310 via an interrupt request signal line 333.

旦−3」I狙螺阪乍 以下、第2図および第3図に示すフローチャートを用い
て本発明実施例の動作について説明する。
Hereinafter, the operation of the embodiment of the present invention will be explained using the flowcharts shown in FIGS. 2 and 3.

現在の新空間に相当する記憶領域の先頭アドレスを外部
レジスタ201に書き込み、その終了アドレスを外部レ
ジスタ203に書き込む。組込関数や述語の人口で、人
力引数のチェックが必要になった場合には、その引数を
外部レジスタ202へ四き込む。このタイミングで比較
器204.205が作動する。比較器204,205は
、二つの入力のうち一方が他方より大きい(あるいは小
さい)ことをチェックする比較器である。
The start address of the storage area corresponding to the current new space is written to the external register 201, and the end address thereof is written to the external register 203. When a manual argument needs to be checked due to the number of built-in functions or predicates, the argument is stored in the external register 202. Comparators 204 and 205 operate at this timing. Comparators 204 and 205 are comparators that check whether one of two inputs is larger (or smaller) than the other.

たとえば、比較器204は外部レジスタ202に書き込
まれたポインタが、外部レジスタ201に四き込まれた
先頭アドレスより小のときに「1」を出力する。比較器
205は、外部レジスタ202に書き込まれたポインタ
が、外部レジスタ203に古き込まれた終了アドレスよ
り大のときに「1」を出力する。したがって、このポイ
ンタが先頭アドレスと終了アドレスの間にあれば、論理
積回路206の出力は「1」となる。すなわち、制御回
路2210入力が「1」の場合は、引数ポインタが新空
間を指し、外部レジスタ202への書き込みでは中央処
理装置310に対して割り込みは発生しない。
For example, the comparator 204 outputs "1" when the pointer written in the external register 202 is smaller than the starting address written in the external register 201. Comparator 205 outputs "1" when the pointer written to external register 202 is greater than the end address written to external register 203. Therefore, if this pointer is between the start address and end address, the output of the AND circuit 206 will be "1". That is, when the control circuit 2210 input is "1", the argument pointer points to a new space, and no interrupt is generated to the central processing unit 310 when writing to the external register 202.

その引数ポインタが旧空間を指す場合には、制御回路2
21は論理積回路206の出力(rob)により適当な
割込要求信号を発生し、割込要求信号線333を介して
中央処理装置310へ割り込みをかける。
If the argument pointer points to the old space, control circuit 2
21 generates an appropriate interrupt request signal from the output (rob) of the AND circuit 206, and issues an interrupt to the central processing unit 310 via an interrupt request signal line 333.

中央処理装置310の処理は、この割込要求13号によ
り瞬時にガーベジコレクションのための処理ルーチン(
INTI)へ移る。このルーチンは、外部レジスタ20
2でポイントされる旧空間のデータを読み出し、これを
外部レジスタ211へ吉き込む。このタイミングで比較
器213が作動する。
In response to this interrupt request No. 13, the processing of the central processing unit 310 instantly starts the processing routine for garbage collection (
Move to INTI). This routine uses the external register 20
The data in the old space pointed to by 2 is read out and placed in the external register 211. Comparator 213 operates at this timing.

比較器213では、外部レジスタ211と、データがガ
ーベジコレクションにより移動されたことを表すための
タグの即値を保持する新空間参照ポインタタグ値レジス
タ212の値が比較される。
The comparator 213 compares the value of the external register 211 and the new space reference pointer tag value register 212 that holds the immediate value of the tag to indicate that data has been moved by garbage collection.

それが等しいときはデータが新空間に移動済であり、ま
た等しくないときはデータが移動済でないことを示す。
If they are equal, it means that the data has been moved to the new space, and if they are not equal, it means that the data has not been moved.

これにより、データ移動処理内であるデータが、ガーベ
ジコレクションにより新空間に移動済か否かの判定が行
なわれる。
Thereby, it is determined whether the data in the data movement process has been moved to the new space by garbage collection.

移動済でない場合には、制御回路221に信号が伝達さ
れる。制御回路221は、この信号が入力されたときに
適当な割込要求信号を発生し、割込要求信号線333を
介して中央処理装置310へ割り込みをかける。
If it has not been moved, a signal is transmitted to the control circuit 221. When this signal is input, the control circuit 221 generates an appropriate interrupt request signal and issues an interrupt to the central processing unit 310 via the interrupt request signal line 333.

中央処理装置333では、この割込要求信号によりデー
タ移動処理ルーチン(COPY ROUTINE)が瞬
時に起動される。このデータ移動処理ルーチンは、デー
タの移動を行なって移動先アドレスを外部レジスタ21
1ヘセツトし、制御は処理ルーチン(INTI)へ戻る
In the central processing unit 333, a data movement processing routine (COPY ROUTINE) is instantaneously activated by this interrupt request signal. This data movement processing routine moves data and stores the movement destination address in the external register 22.
1 and control returns to the processing routine (INTI).

移動済の場合は割り込みはかからない。If it has already been moved, no interrupt will be generated.

処理ルーチン(INTI)では、次の命令で外部レジス
タ211の内容(データの移動先アドレス)を読んで、
外部レジスタ202へ書き込む。
In the processing routine (INTI), the following command reads the contents of the external register 211 (data movement destination address),
Write to external register 202.

そして制御はCARルーチンへ戻る。Control then returns to the CAR routine.

したがって、外部レジスタ202にはこの時点で正しく
新空間のデータを指すポインタがセットされていること
になる。
Therefore, a pointer pointing to the data in the new space is correctly set in the external register 202 at this point.

この場合のコードは、 CAR: move、1 #d(fd)、EXREG3move、
I EXREG3.a。
The code in this case is: CAR: move, 1 #d(fd), EXREG3move,
I EXREG3. a.

move、1 (ao)、aO INTI: move、I EXREG3.aO move、1 (ao)、EXREGImove、I 
EXREGI、aO move、l ao、EXREG3 ts となる。ただし、外部レジスタ211のアドレスをEX
REGIとし、外部レジスタ202のアドレスをEXR
IEG3とする。
move, 1 (ao), aO INTI: move, I EXREG3. aO move, 1 (ao), EXREGImove, I
EXREGI, aO move, l ao, EXREG3 ts. However, the address of external register 211 is
REGI and the address of external register 202 as EXR.
IEG3.

本発明装置を用いると、関数CARの実行うロック数は
、引数ポインタが新空間のデータを指していた場合には
56となり、本発明装置を用いない実装例(96)と比
較して約58%に短縮されている。また、−捨型ガーベ
ジコレクションによる場合(28)と比較しても、処理
速度の低下を2倍(従来は3.4倍)に抑えることがで
きる。
When the device of the present invention is used, the number of locks executed by the function CAR is 56 when the argument pointer points to data in a new space, which is approximately 58 compared to an implementation example (96) that does not use the device of the present invention. It has been shortened to %. Further, even when compared with the case (28) using -discard type garbage collection, the reduction in processing speed can be suppressed to twice (3.4 times in the conventional case).

さらに、プログラムをコンパイルした場合のコード量(
オブジェクトの大きさ)も本発明装置を用いた場合には
、30バイトと従来の実装例(64ハイド)と比較して
も半分以下とコンパクトになっており、−捨型ガーベジ
コレクションによる場合(6バイト)と比較しても、そ
の増加分を5倍(従来は11倍)に抑えることができる
Furthermore, the amount of code when the program is compiled (
When using the device of the present invention, the object size is 30 bytes, which is less than half that of the conventional implementation example (64 hides). Bytes), the increase can be suppressed to 5 times (compared to 11 times in the past).

l−λ凱卑変■皿様 なお、上述した本発明の実施例の比l2RS 204 
l-λKaihehen ■Dish-like.In addition, the ratio of the above-mentioned embodiments of the present invention l2RS 204
.

205および論理積回路206は、外部レジスタ202
に格納されたポインタが、外部レジスタ201および外
部レジスタ203に格納されたボイ  。
205 and the AND circuit 206 are connected to the external register 202
The pointer stored in the pointer is stored in the external register 201 and the external register 203.

ンタ内にあるか否かを検出するための構成であり、これ
に限定されることはない。
This is a configuration for detecting whether or not there is a computer in the computer, and the configuration is not limited to this.

また、比較器204,205は二人力の大小を検出する
構成であり、比較器213は二人力が等しいことを検出
する構成であって、外部レジスタ201〜203,21
1とともに公知の技術を利用することにより容易に実現
可能である。
Further, the comparators 204 and 205 are configured to detect the magnitude of the two-person force, and the comparator 213 is configured to detect that the two-person force is equal.
This can be easily realized by using known technology in conjunction with 1.

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

上述したように、本発明によれば、記号処理プログラム
実行時の条件判断を外部レジスタへのロードおよびスト
ア命令に筒略化することができ、処理時間のオーバヘッ
ドおよびコンパイル時のコード量のオーバヘッドを、従
来技術に比べて大幅に減少させることができる効果があ
る。
As described above, according to the present invention, conditional judgment during execution of a symbolic processing program can be simplified to load and store instructions to external registers, thereby reducing processing time overhead and code amount overhead during compilation. , it has the effect of being able to significantly reduce it compared to the conventional technology.

したがって、高速でオブジェクト効率の高い実時間型ガ
ーベジコレクションを実現することができ、実用的には
極めて有用である。
Therefore, it is possible to realize real-time garbage collection with high speed and high object efficiency, which is extremely useful in practice.

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

第1図は本発明の原理ブロック図、 第2図は本発明の一実施例の構成を示すブロック図、 第3図は本発明実施例の動作を説明するフローチャート
、 第4図はコピー法による一括型ガーベジコレクション方
式を説明する図、 第5図はペイカーのアルゴリズムによる実時間型ガーベ
ジコレクション方式を説明する図、第6図は一括型ガー
ベジコレクションを持つ処理系の場合の実装例を示す図
、 第7図はペイカーのアルゴリズムに基づいた実装例を示
す図である。 図において、 101はデータ格納空間検出手段、 103はデータ移動状態検出手段、 105は制御手段、 201〜203.211は外部レジスタ、204.20
5,213は比較器、 206は論理積回路、 212は新空間参照ポインタタグ値レジスタ、221は
制御回路、 310は中央処理装置、 320は主記憶装置、 331はアドレスバス、 332はデータバス、 333は割込要求信号線、 410.510は旧空間、 420.520は新空間である。 、332デー7I\゛ス 精ロ月不≧丁Pフ p 271コ 第1図 7JX姿諭実莢4月 第2図 ′teイ列フロー士や一ト 第3図 第4図 償1キ間型力゛−■シコし7ンっンプtへt走I:1月
14第5図
Fig. 1 is a block diagram of the principle of the present invention, Fig. 2 is a block diagram showing the configuration of an embodiment of the invention, Fig. 3 is a flowchart explaining the operation of the embodiment of the invention, and Fig. 4 is based on the copy method. Figure 5 is a diagram explaining the batch garbage collection method, Figure 5 is a diagram explaining the real-time garbage collection method using Paker's algorithm, Figure 6 is a diagram showing an implementation example for a processing system with batch garbage collection, FIG. 7 is a diagram showing an implementation example based on Payker's algorithm. In the figure, 101 is a data storage space detection means, 103 is a data movement state detection means, 105 is a control means, 201 to 203.211 are external registers, and 204.20
5, 213 is a comparator, 206 is an AND circuit, 212 is a new space reference pointer tag value register, 221 is a control circuit, 310 is a central processing unit, 320 is a main storage device, 331 is an address bus, 332 is a data bus, 333 is an interrupt request signal line, 410.510 is the old space, and 420.520 is the new space. , 332 Day 7 Mold Power゛-■ Shiko and 7th Nump T Run I: January 14 Figure 5

Claims (1)

【特許請求の範囲】 記号処理プログラムの実行と、ガーベジコレクションと
を交互に行なう実時間型ガーベジコレクション方式にお
いて、 アドレスバス(331)およびデータバス(332)に
接続され、組込関数あるいは述語の入口で入力引数が記
憶領域の新空間あるいは旧空間のいずれの空間を指すか
をチェックするデータ格納空間検出手段(101)と、 アドレスバス(331)に接続され、かつデータ格納空
間検出手段(101)を介してデータバス(332)に
接続され、前記プログラムが参照したデータが、前記新
空間に移動済のデータであるか移動前のデータであるか
をチェックするデータ移動状態検出手段(103)と、 データ格納空間検出手段(101)およびデータ移動状
態検出手段(103)の出力が取り込まれ、各出力が旧
空間あるいは移動前を示す場合に中央処理装置に対して
、割込要求信号線(333)を介してデータ移動のため
の割込要求を行なう制御手段(105)と、 を備えたことを特徴とする実時間型ガーベジコレクショ
ン支援装置。
[Claims] In a real-time garbage collection method in which execution of a symbolic processing program and garbage collection are performed alternately, the a data storage space detection means (101) for checking whether an input argument points to a new space or an old space in the storage area; and a data storage space detection means (101) connected to the address bus (331). a data movement state detection means (103) connected to the data bus (332) via a data bus (332) and checking whether the data referenced by the program is data that has been moved to the new space or data that has not yet been moved; , the outputs of the data storage space detection means (101) and the data movement state detection means (103) are taken in, and when each output indicates the old space or before movement, an interrupt request signal line (333) is sent to the central processing unit. 1. A real-time garbage collection support device comprising: a control means (105) for making an interrupt request for data movement via a controller (105).
JP61238500A 1986-10-07 1986-10-07 Real time type garbage collection back-up device Pending JPS6393055A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61238500A JPS6393055A (en) 1986-10-07 1986-10-07 Real time type garbage collection back-up device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61238500A JPS6393055A (en) 1986-10-07 1986-10-07 Real time type garbage collection back-up device

Publications (1)

Publication Number Publication Date
JPS6393055A true JPS6393055A (en) 1988-04-23

Family

ID=17031171

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61238500A Pending JPS6393055A (en) 1986-10-07 1986-10-07 Real time type garbage collection back-up device

Country Status (1)

Country Link
JP (1) JPS6393055A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001184254A (en) * 1999-12-27 2001-07-06 Nec Corp Information processor having garbage collection function, and method for the same, and recording medium
JP2002506550A (en) * 1997-06-26 2002-02-26 サン・マイクロシステムズ・インコーポレイテッド Bounded pause garbage collection systems and methods including write barriers for source and destination instances of partially relocated objects
JP2002506549A (en) * 1997-06-26 2002-02-26 サン・マイクロシステムズ・インコーポレイテッド Bounded downtime garbage collection system and method including write barrier associated with source instance of partially relocated object
WO2007034769A1 (en) * 2005-09-20 2007-03-29 National Institute Of Advanced Industrial Science And Technology Zero garbage collection communication mediation device
JP2009037547A (en) * 2007-08-03 2009-02-19 Hitachi Ltd Memory management method and computer using the method
US8856468B2 (en) 2010-12-01 2014-10-07 Kabushiki Kaisha Toshiba Memory device capable of improving write processing speed and memory control method
JP2018010507A (en) * 2016-07-14 2018-01-18 富士通株式会社 Memory management program, memory management method and memory management device
JP2020505684A (en) * 2017-01-19 2020-02-20 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Read logic and shift protection instructions

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002506550A (en) * 1997-06-26 2002-02-26 サン・マイクロシステムズ・インコーポレイテッド Bounded pause garbage collection systems and methods including write barriers for source and destination instances of partially relocated objects
JP2002506549A (en) * 1997-06-26 2002-02-26 サン・マイクロシステムズ・インコーポレイテッド Bounded downtime garbage collection system and method including write barrier associated with source instance of partially relocated object
JP2001184254A (en) * 1999-12-27 2001-07-06 Nec Corp Information processor having garbage collection function, and method for the same, and recording medium
WO2007034769A1 (en) * 2005-09-20 2007-03-29 National Institute Of Advanced Industrial Science And Technology Zero garbage collection communication mediation device
JP2009037547A (en) * 2007-08-03 2009-02-19 Hitachi Ltd Memory management method and computer using the method
US8397044B2 (en) 2007-08-03 2013-03-12 Hitachi, Ltd. Memory management method and computer using the method
US8589653B2 (en) 2007-08-03 2013-11-19 Hitachi, Ltd. Memory management method and computer using the method
US8856468B2 (en) 2010-12-01 2014-10-07 Kabushiki Kaisha Toshiba Memory device capable of improving write processing speed and memory control method
JP2018010507A (en) * 2016-07-14 2018-01-18 富士通株式会社 Memory management program, memory management method and memory management device
JP2020505684A (en) * 2017-01-19 2020-02-20 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Read logic and shift protection instructions

Similar Documents

Publication Publication Date Title
US6223208B1 (en) Moving data in and out of processor units using idle register/storage functional units
US5386563A (en) Register substitution during exception processing
US5148544A (en) Apparatus and method for control of asynchronous program interrupt events in a data processing system
JPS6252655A (en) Common interrupt system
KR20010070469A (en) Device and method for performing high-speed low overhead context switch
US4851992A (en) Register/saving/restoring system for saving and restoring data in a register of a slave processor
JPS6393055A (en) Real time type garbage collection back-up device
EP0523758B1 (en) A method and apparatus for coordinating execution of an instruction by a coprocessor
JP3981238B2 (en) Information processing device
US6675238B1 (en) Each of a plurality of descriptors having a completion indicator and being stored in a cache memory of an input/output processor
EP0297892B1 (en) Apparatus and method for control of asynchronous program interrupt events in a data processing system
EP0560393B1 (en) Microprocessor and data processing system with register file
IE75357B1 (en) Apparatus and method for providing an extended processing environment on nonmicrocoded data processing system
JPS603229B2 (en) Information processing method
JP2527038B2 (en) Extended memory transfer control method
JPH03188530A (en) Program prefetching device
JP2553526B2 (en) Multitasking processor
JPH03175539A (en) Debugging microprocessor
JPH0279122A (en) Floating point arithmetic mechanism
JPH05250161A (en) Microcomputer device
JPH02173828A (en) Interruption process system
JPS58205258A (en) Data processor
JPH0290331A (en) Inter-processor communication instruction processor for virtual computer system
JPH0282318A (en) Floating-point arithmetic unit
JPH0380355A (en) Computer with dma transfer mechanism