JPH0520082A - Execution system of object-oriented language - Google Patents

Execution system of object-oriented language

Info

Publication number
JPH0520082A
JPH0520082A JP3327280A JP32728091A JPH0520082A JP H0520082 A JPH0520082 A JP H0520082A JP 3327280 A JP3327280 A JP 3327280A JP 32728091 A JP32728091 A JP 32728091A JP H0520082 A JPH0520082 A JP H0520082A
Authority
JP
Japan
Prior art keywords
message
class
address
methods
method table
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
JP3327280A
Other languages
Japanese (ja)
Inventor
Kazunori Tomatake
和記 渡守武
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Publication of JPH0520082A publication Critical patent/JPH0520082A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

(57)【要約】 【目的】 処理依頼としてのメッセージと、これに対応
した処理手続きとしてのメソッドとの間の高速バインデ
ィングを実現する。 【構成】 クラス毎に1つのメソッドテーブル11を設
ける。該メソッドテーブル11には、複数のメソッド1
6の各々のアドレスをそれぞれメソッドアドレスとして
格納しておく。メソッドテーブル11中の各メソッドア
ドレスの格納位置を表わすディスプレースメントは、メ
ッセージの種類に応じた定数としてそれぞれコンパイル
時に予め決定しておく。複数のメソッド16のうちの1
つにより処理されるべき種類のメッセージを受け取るオ
ブジェクト13は、メソッドテーブル11のアドレスを
指し示すためのポインタ14を有する。複数のメソッド
16のうちのオブジェクト13が受け取ったメッセージ
に対応したメソッドのアドレスは、ポインタ14とメッ
セージ毎のディスプレースメントとに従ってメソッドテ
ーブル11から得られる。
(57) [Summary] [Purpose] To realize high-speed binding between a message as a processing request and a method as a processing procedure corresponding to this. [Configuration] One method table 11 is provided for each class. The method table 11 includes a plurality of methods 1
Each address of 6 is stored as a method address. The displacement representing the storage position of each method address in the method table 11 is determined in advance at the time of compilation as a constant corresponding to the type of message. 1 of 16 methods
An object 13 that receives a message of the type to be processed by one has a pointer 14 for pointing to the address of the method table 11. The address of the method corresponding to the message received by the object 13 of the plurality of methods 16 is obtained from the method table 11 according to the pointer 14 and the displacement of each message.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、オブジェクト指向言語
の実行システムに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an object oriented language execution system.

【0002】[0002]

【従来の技術】先ず、従来技術を説明するにあたって、
本発明が対象としているオブジェクト指向言語につい
て、必要な点を簡単に説明する。
2. Description of the Related Art First, in explaining the prior art,
The necessary points of the object-oriented language targeted by the present invention will be briefly described.

【0003】オブジェクト指向言語では、メモリ上の構
造データへ処理依頼を送るという形式で処理が進められ
る。この構造データをオブジェクトと呼び、処理依頼を
メッセージと呼ぶ。同じくメモリ上に生成される複数の
オブジェクトは、各々いずれかのクラスに属している。
そして、各クラスに対して、オブジェクトが一度に受け
取った1つの種類のメッセージを処理するための処理手
続き(これをメソッドと呼ぶ。)がメモリ上に定義され
ている。あるクラスの1つのインスタンスとしてのオブ
ジェクトが受け取った同一の種類のメッセージは、その
オブジェクトが属するクラスにおいて、そのメッセージ
に対応するメソッドの実行を通して処理されるのであ
る。
In the object-oriented language, processing proceeds in the form of sending a processing request to the structural data on the memory. This structural data is called an object, and the processing request is called a message. Similarly, the plurality of objects generated in the memory each belong to one of the classes.
A processing procedure (called a method) for processing one type of message received by the object at one time is defined in the memory for each class. A message of the same type received by an object as an instance of a class is processed through execution of a method corresponding to the message in the class to which the object belongs.

【0004】このようにあるメッセージに対して実行す
べきメソッドを対応付ける処理(これをバインディング
と呼ぶ。)は、重要な処理の1つであり、バインディン
グの処理速度がオブジェクト指向言語の実行システム全
体の速度を左右する要因となっている。即ち、オブジェ
クト指向言語の高速実行のためには、高速のバインディ
ングを実現する必要があるのである。なお、クラスに対
するメッセージに応答してそのクラスに属する新たなオ
ブジェクトをメモリ上に生成するためのオブジェクト生
成メソッドもある。
The process of associating a method to be executed with a certain message (this is called binding) is one of the important processes, and the processing speed of the binding is the same as that of the entire execution system of the object-oriented language. It is a factor that affects the speed. That is, it is necessary to realize high-speed binding for high-speed execution of an object-oriented language. There is also an object generation method for generating a new object belonging to the class on the memory in response to a message for the class.

【0005】また、オブジェクト指向言語の重要な機能
の1つとして、クラス間のメソッドの継承がある。メソ
ッドの継承とは、あるクラスを作成するときに、指定し
た別のクラス(これをスーパークラスと呼ぶ。)のため
に定義されたメソッドを受け継ぎ、受け継いだメソッド
をそのクラス(これをサブクラスと呼ぶ。)のメソッド
とすることである。但し、サブクラスにおいて、継承し
たメソッドを使わずに、新たにメソッドを定義し直すこ
ともできる。定義し直すとは、あるメッセージに対する
メソッドの継承を実施したうえで、サブクラスでそのメ
ッセージに対するメソッドとして別のメソッドを定義す
ることである。
Another important function of the object-oriented language is inheritance of methods between classes. Method inheritance means that when a certain class is created, it inherits the method defined for another specified class (this is called a superclass) and the inherited method is called that class (this is called a subclass). .) Method. However, it is also possible to redefine a new method in the subclass without using the inherited method. To redefine means to inherit a method for a message and then define another method as a method for the message in a subclass.

【0006】例えば、メッセージmに対応するメソッド
MがクラスAに定義されていて、クラスBを作成すると
きにクラスAをスーパークラスとして指定したならば、
クラスBに属するオブジェクトbに送られたメッセージ
mは、クラスAで定義されているメソッドMで処理され
ることになる。ところが、クラスBでメッセージmに対
応するメソッドとしてメソッドMMを定義し直した場合
には、クラスBに属するオブジェクトbに送られたメッ
セージmは、そのクラスBで定義されたメソッドMMで
処理されることになる。但し、この場合でも、クラスA
に属するオブジェクトaに送られたメッセージmは、そ
のクラスAで定義されたメソッドMで処理される。
For example, if the method M corresponding to the message m is defined in the class A and the class A is designated as the superclass when the class B is created,
The message m sent to the object b belonging to the class B will be processed by the method M defined in the class A. However, when the method MM is redefined in the class B as the method corresponding to the message m, the message m sent to the object b belonging to the class B is processed by the method MM defined in the class B. It will be. However, even in this case, class A
The message m sent to the object a belonging to is processed by the method M defined in the class A.

【0007】このように、オブジェクト指向言語の実行
システムでは、オブジェクトに送られたメッセージがど
のメソッドにバインディングされるかは、そのオブジェ
クトがどのクラスに属するかに応じて動的に決定されな
ければならない。
As described above, in an object-oriented language execution system, which method a message sent to an object is bound to must be dynamically determined according to which class the object belongs to. .

【0008】そこで、次に、図5及び図6を用いて、従
来のバインディングの方式について具体的に説明する。
メッセージは、通例メッセージ間の識別のためのメッセ
ージ識別子とこれに付随した引数とを有する。従来は、
メモリ上にはクラス毎に1つずつメッセージメソッド対
応テーブルが予め作成されており、あるメッセージがオ
ブジェクトに送られてきたときに、そのメッセージ中の
メッセージ識別子をキーとしてメッセージメソッド対応
テーブルを検索することにより、対応するメソッドを決
定していた。これにより、送られてきたメッセージとこ
れに対応するメソッドとの間のバインディングを実現し
ていたのである。
Then, the conventional binding method will be specifically described with reference to FIGS. 5 and 6.
A message usually has a message identifier for identifying between messages and an argument associated with it. conventionally,
One message method correspondence table is created in advance for each class on the memory. When a message is sent to an object, search the message method correspondence table using the message identifier in the message as a key. Has determined the corresponding method. This realized the binding between the sent message and the corresponding method.

【0009】図5は、従来のオブジェクト指向言語の実
行システムの構成を示す概念図であり、図6は、その実
行システムにおけるメッセージとメソッドとの間のバイ
ンディングの手順を示すフローチャート図である。
FIG. 5 is a conceptual diagram showing the structure of a conventional object-oriented language execution system, and FIG. 6 is a flow chart showing the procedure of binding messages and methods in the execution system.

【0010】図5において、51はあるクラスに関する
クラス情報であり、52はそのクラスに対して指定され
たスーパークラスのクラス情報60へのポインタであ
る。53は、メッセージメソッド対応テーブルであり、
このクラスでメッセージの種類毎に定義されている複数
のメソッド59のアドレス(メソッドへのポインタ)5
5と、各メソッドが処理するメッセージのメッセージ識
別子54とが対の形で格納されたものである。また、5
6はこのクラスに属する1つのオブジェクト、57はク
ラス情報51のアドレスを指し示すためのポインタ、5
8はオブジェクト56のデータの格納領域である。
In FIG. 5, reference numeral 51 is class information relating to a certain class, and 52 is a pointer to the class information 60 of the superclass designated for the class. 53 is a message method correspondence table,
Addresses (pointers to methods) of multiple methods 59 defined for each message type in this class 5
5 and the message identifier 54 of the message processed by each method are stored in the form of a pair. Also, 5
6 is one object belonging to this class, 57 is a pointer for pointing the address of the class information 51, 5
Reference numeral 8 is a storage area for the data of the object 56.

【0011】さて、オブジェクト56にある種類のメッ
セージが送られたとき、図6に示すように、先ずそのオ
ブジェクト56からクラス情報51へのポインタ57を
得る(ステップST61)。次に、そのポインタ57が
指し示すクラス情報51の中からメッセージメソッド対
応テーブル53を得て、そのテーブル53中の複数のメ
ッセージ識別子54の中に送られてきたメッセージのメ
ッセージ識別子と一致するものがあるかどうか検索する
(ステップST62)。続いて、メッセージメソッド対
応テーブル53の中に一致するメッセージ識別子54が
見つかったか否かを判別し(ステップST63)、メッ
セージ識別子54が見つかった場合には、そのメッセー
ジに対応するメソッド59のアドレス55を該メッセー
ジメソッド対応テーブル53の中から得る(ステップS
T64)。見つからなければ、同じクラス情報51の中
のスーパークラスのクラス情報60へのポインタ52を
得て(ステップST65)、今度はそのクラス情報への
ポインタ52に基づいてステップST62以降を繰り返
す。つまり、スーパークラスのためのメッセージメソッ
ド対応テーブルを更に検索することになる。
When a certain type of message is sent to the object 56, first, as shown in FIG. 6, a pointer 57 pointing from the object 56 to the class information 51 is obtained (step ST61). Next, the message method correspondence table 53 is obtained from the class information 51 pointed to by the pointer 57, and among the plurality of message identifiers 54 in the table 53, there is one that matches the message identifier of the transmitted message. It is searched whether or not (step ST62). Subsequently, it is determined whether or not the matching message identifier 54 is found in the message method correspondence table 53 (step ST63). If the message identifier 54 is found, the address 55 of the method 59 corresponding to the message is set. Obtained from the message method correspondence table 53 (step S
T64). If not found, a pointer 52 to the class information 60 of the superclass in the same class information 51 is obtained (step ST65), and step ST62 and subsequent steps are repeated based on the pointer 52 to the class information. That is, the message method correspondence table for the superclass is further searched.

【0012】[0012]

【発明が解決しようとする課題】上記従来のオブジェク
ト指向言語の実行システムは、メッセージとメソッドと
の間のバインディングのために、複数対のメッセージ識
別子54とメソッドアドレス55とが格納されたメッセ
ージメソッド対応テーブル53をクラス毎に設けたもの
であって、実行時にメッセージがオブジェクトに送られ
てくる毎にそのメッセージメソッド対応テーブル53を
検索する必要があった。従って、クラス情報51のメモ
リ占有領域が大きくなるとともに、バインディングに多
くの時間を要する問題があった。
The above-described conventional object-oriented language execution system handles message methods in which a plurality of pairs of message identifiers 54 and method addresses 55 are stored for binding between messages and methods. The table 53 is provided for each class, and it is necessary to search the message method correspondence table 53 each time a message is sent to an object at the time of execution. Therefore, there is a problem that the memory occupation area of the class information 51 becomes large and a lot of time is required for binding.

【0013】特に、サブクラスに属するオブジェクト5
6に送られてくるメッセージをスーパークラスから継承
されたメソッドへバインディングする場合には、複数回
のテーブル検索が必要になるので、バインディング時間
が非常に長くなる問題があった。
In particular, the object 5 belonging to the subclass
When binding the message sent to the method 6 to the method inherited from the superclass, it is necessary to search the table a plurality of times, which causes a problem that the binding time becomes very long.

【0014】本発明の目的は、クラス毎のテーブルの容
量を小さくするとともに、メッセージとメソッドとの間
の高速のバインディングを実現することにある。
An object of the present invention is to reduce the capacity of a table for each class and to realize high-speed binding between a message and a method.

【0015】[0015]

【課題を解決するための手段】上記目的を達成するため
に、本発明は、メッセージ識別子を伴なわないメソッド
アドレスが格納されたメソッドテーブルの構成を採用
し、且つ各メソッドアドレスの格納位置を表わすディス
プレースメントをメッセージの種類に応じた定数として
それぞれコンパイル時に予め決定しておく構成を採用し
たものである。
In order to achieve the above object, the present invention adopts a structure of a method table in which a method address without a message identifier is stored and represents a storage position of each method address. The configuration is such that the displacement is determined in advance as a constant according to the type of message at the time of compiling.

【0016】具体的に説明すると、請求項1の発明は、
処理依頼としての複数の種類のメッセージの各々に対応
した実行可能な処理手続きとして1つのクラスに対して
メモリ上において互いに異なるアドレスにそれぞれ定義
された複数のメソッドと、前記クラスのために前記メモ
リ上において前記複数のメソッドとは異なるアドレスに
作成され且つ前記複数のメソッドの各々のメモリ上での
アドレスがそれぞれメソッドアドレスとして格納され且
つ各メソッドアドレスの格納位置を表わすディスプレー
スメントが前記複数の種類のメッセージの各々に応じた
定数としてそれぞれコンパイル時に予め決定されたメソ
ッドテーブルと、前記クラスに対して前記メモリ上にお
いて前記複数のメソッド及びメソッドテーブルとは異な
るアドレスに生成され且つ前記メソッドテーブルのメモ
リ上でのアドレスを指し示すためのポインタを有し且つ
一度に前記複数の種類のメッセージのうちの1つを受け
取るオブジェクトとを備えた構成を採用したものであ
る。そして、前記オブジェクトが受け取ったメッセージ
は、前記ポインタと前記メッセージの種類毎の定数とし
てのディスプレースメントとに従って、前記メソッドテ
ーブル中の該メッセージに対応したメソッドアドレスを
通して該メッセージに対応したメソッドにバインディン
グされ、且つ該バインディングされたメソッドの実行を
通して処理を受けるものである。
Specifically, the invention of claim 1 is as follows.
A plurality of methods respectively defined at different addresses on a memory for one class as an executable processing procedure corresponding to each of a plurality of types of messages as processing requests, and on the memory for the class. In the above, the displacements that are created at different addresses from the plurality of methods, the addresses on the memory of each of the plurality of methods are respectively stored as method addresses, and the displacement indicating the storage location of each method address is the message of the plurality of types. A method table predetermined at the time of compilation as a constant corresponding to each of the methods, and a plurality of methods and method tables generated at different addresses in the memory for the class and in the memory of the method table. address And it has a pointer for indicating in which a configuration in which a object to receive one of the plurality of types of messages employing a time. Then, the message received by the object is bound to the method corresponding to the message through the method address corresponding to the message in the method table according to the pointer and the displacement as a constant for each type of the message, In addition, processing is performed through the execution of the bound method.

【0017】また、請求項2の発明は、複数のクラスの
各々に対して前記複数のメソッド、メソッドテーブル及
びオブジェクトをそれぞれ備え、前記複数のクラスのう
ちの1つのクラスのためのメソッドテーブルと他の1つ
のクラスのためのメソッドテーブルとは、両クラス間で
のメソッドの継承のために、同一のディスプレースメン
トで表わされる位置に同一のメソッドアドレスが各々格
納された構成としている。
The invention according to claim 2 further comprises the plurality of methods, the method table and the object for each of the plurality of classes, and a method table for one of the plurality of classes and other methods. The method table for one class has a configuration in which the same method address is stored at the position represented by the same displacement for inheriting the method between both classes.

【0018】また、請求項3の発明は、複数のクラスの
各々に対して前記複数のメソッド、メソッドテーブル及
びオブジェクトをそれぞれ備え、前記複数のクラスのう
ちの1つのクラスのためのメソッドテーブルと他の1つ
のクラスのためのメソッドテーブルとは、同一のディス
プレースメントで表わされる位置に異なるメソッドアド
レスが各々格納された構成としている。
The invention according to claim 3 is further provided with the plurality of methods, the method table and the object for each of the plurality of classes, and a method table for one of the plurality of classes and other methods. The method table for one class is configured such that different method addresses are stored at the positions represented by the same displacement.

【0019】また、請求項4の発明は、前記1つのクラ
スのために作成されたメソッドテーブルは、該クラスに
対して新たに生成されるオブジェクトに占有させるため
に前記メモリ上に確保すべき領域の大きさが更に格納さ
れている構成としたものである。
According to a fourth aspect of the invention, the method table created for the one class is an area to be secured on the memory in order to occupy an object newly created for the class. Is further stored.

【0020】[0020]

【作用】請求項1の発明によれば、ある種類のメッセー
ジがオブジェクトに送られてきたときに、そのオブジェ
クトが有するポインタ中のアドレスとそのメッセージに
対する定数としてのディスプレースメントとを加え合わ
せるだけで、メソッドテーブルの検索を行うことなく該
メッセージに対応したメソッドアドレスを直ちに得るこ
とができ、そのメソッドアドレスを通してメッセージと
メソッドとがバインディングされる。しかも、メソッド
テーブル中のメソッドアドレスはメッセージ識別子を伴
なう必要がないので、そのメソッドテーブルのメモリ占
有領域が従来のメッセージメソッド対応テーブルに比べ
て小さくなる。
According to the invention of claim 1, when a message of a certain type is sent to an object, the address in the pointer of the object and the displacement as a constant for the message are simply added, The method address corresponding to the message can be immediately obtained without searching the method table, and the message and the method are bound through the method address. Moreover, since the method address in the method table does not need to be accompanied by the message identifier, the memory occupation area of the method table becomes smaller than that of the conventional message method correspondence table.

【0021】また、請求項2の発明によれば、スーパー
クラスとしての1つのクラスのためのメソッドテーブル
と、サブクラスとしての他の1つのクラスのためのメソ
ッドテーブルとは、同一のディスプレースメントで表わ
される位置に同一のメソッドアドレスが各々格納されて
いるので、その同一のメソッドアドレスを通して両クラ
ス間でのメソッドの継承が実現される。つまり、両クラ
ス間で継承されるべきメソッドのアドレスは両メソッド
テーブルにおいて共通のディスプレースメントで表わさ
れる同じ位置に格納されているので、例えばスーパーク
ラスに属するオブジェクトaに送られたメッセージmが
メソッドMにバインディングされる場合には、サブクラ
スに属するオブジェクトbに送られた同一のメッセージ
mも同一のメソッドMにバインディングされることにな
る。しかも、このようにクラス間でのメソッドの継承が
ある場合でも、その継承がない場合と同じく、オブジェ
クトが有するポインタ中のアドレスとメッセージに対す
る定数としてのディスプレースメントとを加え合わせる
だけで、メソッドテーブルの検索を行うことなく所要の
メソッドアドレスを直ちに得ることができる。
According to the invention of claim 2, the method table for one class as a superclass and the method table for another class as a subclass are represented by the same displacement. Since the same method address is stored in each position, the inheritance of the method between both classes is realized through the same method address. That is, since the address of the method to be inherited between both classes is stored in the same position represented by the common displacement in both method tables, for example, the message m sent to the object a belonging to the superclass is the method M. When bound to the same method, the same message m sent to the object b belonging to the subclass is also bound to the same method M. Moreover, even if there is a method inheritance between classes in this way, just as with the case where the method does not inherit, by simply adding the address in the pointer of the object and the displacement as a constant for the message, the method table The required method address can be immediately obtained without performing a search.

【0022】また、請求項3の発明によれば、スーパー
クラスとしての1つのクラスのためのメソッドテーブル
と、サブクラスとしての他の1つのクラスのためのメソ
ッドテーブルとは、同一のディスプレースメントで表わ
される位置に異なるメソッドアドレスが各々格納されて
おり、前述のメソッドの定義し直しに対応することがで
きる。例えばスーパークラスでメッセージmに対応する
メソッドとしてメソッドMを定義する一方、サブクラス
で同じメッセージmに対応するメソッドとしてメソッド
MMを定義し直した場合には、そのスーパークラスに属
するオブジェクトaに送られたメッセージmはメソッド
Mにバインディングされるのに対して、そのサブクラス
に属するオブジェクトbに送られた同一のメッセージm
は異なるメソッドMMにバインディングされることにな
る。
According to the invention of claim 3, the method table for one class as a superclass and the method table for another class as a subclass are represented by the same displacement. Different method addresses are stored in the respective positions, and it is possible to correspond to the redefinition of the above method. For example, when the method M is defined as the method corresponding to the message m in the superclass, and the method MM is redefined as the method corresponding to the same message m in the subclass, it is sent to the object a belonging to the superclass. Message m is bound to method M, whereas the same message m sent to object b belonging to its subclass
Will be bound to different methods MM.

【0023】また、請求項4の発明によれば、前記各メ
ソッドアドレスに加えて、新たなオブジェクトの生成の
ために必要なメモリ占有領域の大きさが、クラス毎のメ
ソッドテーブルに格納されている。クラスに対するメッ
セージに応答してそのクラスに属する新たなオブジェク
トをメモリ上に生成するための前述のオブジェクト生成
メソッドの実行を起動するためには、メソッドのアドレ
スが格納されたテーブルのアドレスをそのオブジェクト
生成メソッドに引き渡すだけでなく、生成すべきオブジ
ェクトの大きさをも該オブジェクト生成メソッドに引き
渡す必要がある。ところが、請求項4の発明によれば、
オブジェクトの所要の大きさがメソッドテーブルの中に
格納されているので、メソッドテーブルのアドレスを1
つの引数としてオブジェクト生成メソッドに引き渡すだ
けでよく、そのオブジェクト生成メソッドによる引数の
処理時間が短縮できる。しかも、メソッドテーブルのア
ドレスを受け取ったオブジェクト生成メソッドは、生成
すべきオブジェクトのためにメモリ上に所要の大きさの
領域を確保したうえで、その領域の中に設けたメソッド
テーブルへのポインタの中に先に引数として受け取った
メソッドテーブルのアドレスを書き込むことにより、そ
のメソッドテーブルに関連付けられた新たなオブジェク
トを生成することができる。これにより、その新たなオ
ブジェクトについても、メッセージとメソッドとの間の
高速バインディングを担保できることとなる。
According to the fourth aspect of the invention, in addition to each method address, the size of the memory occupied area required for generating a new object is stored in the method table for each class. . In response to a message for a class, in order to trigger the execution of the above-described object creation method for creating a new object belonging to that class in memory, the address of the table in which the method address is stored is created for that object. It is necessary to pass not only the method to the method but also the size of the object to be created to the object creating method. However, according to the invention of claim 4,
Since the required size of the object is stored in the method table, set the address of the method table to 1
It only needs to be passed as one argument to the object generation method, and the processing time of the argument by the object generation method can be shortened. Moreover, the object creation method that received the address of the method table allocates an area of the required size in memory for the object to be created, and then uses the pointer to the method table provided in that area. By writing the address of the method table previously received as an argument, a new object associated with the method table can be generated. As a result, even for the new object, high-speed binding between the message and the method can be secured.

【0024】[0024]

【実施例】以下、本発明の実施例を図面に基づいて詳細
に説明する。
Embodiments of the present invention will now be described in detail with reference to the drawings.

【0025】図1は、本発明の一実施例に係るオブジェ
クト指向言語の実行システムの構成を示す概念図であ
り、図2は、その実行システムにおけるメッセージとメ
ソッドとの間のバインディングの手順を示すフローチャ
ート図である。
FIG. 1 is a conceptual diagram showing a configuration of an object oriented language execution system according to an embodiment of the present invention, and FIG. 2 shows a procedure of binding between a message and a method in the execution system. It is a flowchart figure.

【0026】図1において、11はあるクラスのための
メソッドテーブルであり、12はこのクラスでメッセー
ジの種類毎に定義されている複数のメソッド16の各々
へのポインタ(各メソッドアドレスを格納したもの)で
ある。また、13はこのクラスに属する1つのオブジェ
クト、14はメソッドテーブル11のアドレスを指し示
すためのポインタ、15はオブジェクト13のデータの
格納領域である。
In FIG. 1, 11 is a method table for a certain class, and 12 is a pointer to each of a plurality of methods 16 defined for each message type in this class (each method address is stored). ). Further, 13 is one object belonging to this class, 14 is a pointer for pointing the address of the method table 11, and 15 is a data storage area of the object 13.

【0027】クラス間におけるメソッドの継承がある場
合、メソッドテーブル11は、スーパークラスからこの
クラス(サブクラス)へ継承されたメソッド16のアド
レスが先ず並び、その後に該サブクラスで追加定義され
たメソッド16のアドレスが並ぶようにメモリ上に作成
される。つまり、このクラスのメソッドテーブル11
と、該クラスに対して指定されたスーパークラスのメソ
ッドテーブルとは、継承された共通のメソッド16に関
する同一のメソッドアドレスが各テーブル内において同
じ位置に格納されているのである。但し、該サブクラス
で定義し直したメソッド16については、メソッドテー
ブル11中の継承されたメソッドのアドレスが、その順
番を変えずに該サブクラスで定義し直したメソッド16
のアドレスに置き換えられるのである。
When there is a method inheritance between classes, the method table 11 shows that the addresses of the methods 16 inherited from the superclass to this class (subclass) are arranged first, and then the methods 16 additionally defined in the subclass are listed. It is created on the memory so that the addresses are lined up. That is, the method table 11 of this class
In the method table of the superclass designated for the class, the same method address for the inherited common method 16 is stored at the same position in each table. However, regarding the method 16 redefined in the subclass, the method 16 redefined in the subclass without changing the order of the addresses of the inherited methods in the method table 11.
Will be replaced with the address of.

【0028】以上のとおり、このメソッドテーブル11
内での各メソッドアドレスの格納位置を表わすディスプ
レースメント、即ち、あるメッセージに対して該メソッ
ドテーブル11の何番目に格納されたメソッドアドレス
をアクセスすべきかを表わす数値は、各メソッド16に
対応するメッセージの種類の各々に応じた定数となって
おり、それぞれコンパイル時に予め決定される。特に継
承されたメソッドについては、スーパークラスとサブク
ラスとで同じディスプレースメントを使用することがで
きるのである。
As described above, this method table 11
The displacement indicating the storage position of each method address within the message, that is, the numerical value indicating the number of the method address stored in the method table 11 to be accessed for a certain message is the message corresponding to each method 16. Is a constant corresponding to each of the types, and is determined in advance when compiling. In particular for inherited methods, the same displacement can be used in superclasses and subclasses.

【0029】さて、オブジェクト13にある種類のメッ
セージが送られたとき、図2に示すように、先ずそのオ
ブジェクト13中のポインタ14からメソッドテーブル
11のアドレス(先頭のメソッドアドレスの格納位置)
を得る(ステップST21)。このオブジェクト13が
受け取ったメッセージにバインディングすべきメソッド
16のアドレスは、そのメソッドテーブル11中におい
て、そのメッセージの種類に応じた定数のディスプレー
スメントで表わされた位置に格納されているから、メソ
ッドテーブル11を検索しなくとも該当するメソッドア
ドレスが直ちに得られる(ステップST22)。つま
り、そのメソッドアドレスを内容とするメソッド16へ
のポインタ12を通して、実行すべきメソッド16を直
ちに指定できるのである。
Now, when a certain type of message is sent to the object 13, as shown in FIG. 2, first, the address of the method table 11 from the pointer 14 in the object 13 (the storage position of the first method address)
Is obtained (step ST21). The address of the method 16 to be bound to the message received by the object 13 is stored in the method table 11 at a position represented by a constant displacement according to the type of the message. The corresponding method address is immediately obtained without searching 11 (step ST22). That is, the method 16 to be executed can be immediately specified through the pointer 12 to the method 16 having the method address as the content.

【0030】以上のとおり本実施例によれば、多くの時
間を要するテーブル検索を行うことなく、たった2回の
ポインタ14,12の参照によってメッセージとメソッ
ドとの間のバインディングを実現できるので、バインデ
ィング時間が非常に短くなる。また、たった2回のポイ
ンタの参照によってバインディングを実現できる点は継
承されたメソッドの場合も同様であり、従来は複数回の
テーブル検索が必要であったのに比べてバインディング
時間を大幅に短縮することができる。しかも、メソッド
テーブル11中の各メソッドアドレスはいずれもメッセ
ージ識別子を伴なう必要がないので、そのメソッドテー
ブル11の容量を従来のメッセージメソッド対応テーブ
ル(図5中の53)に比べて半減することができる。
As described above, according to the present embodiment, it is possible to realize the binding between the message and the method by referring to the pointers 14 and 12 only twice without performing a table search that requires a lot of time. The time will be very short. In addition, the fact that binding can be realized by referring to the pointer only twice is the same as in the case of the inherited method, and the binding time is greatly shortened compared to the case where the table search is required multiple times in the past. be able to. Moreover, since each method address in the method table 11 need not be accompanied by a message identifier, the capacity of the method table 11 should be halved compared to the conventional message method correspondence table (53 in FIG. 5). You can

【0031】次に、以上の実施例を更に具体的に説明す
る。図3は、図1の構成を2つのクラスA,Bについて
具体化した構成を示す概念図である。但し、クラスB
は、クラスAをスーパークラスとするサブクラスであ
る。
Next, the above embodiment will be described more specifically. FIG. 3 is a conceptual diagram showing a configuration in which the configuration of FIG. 1 is embodied for two classes A and B. However, class B
Is a subclass whose class A is a superclass.

【0032】図3において、31はクラスAのメソッド
テーブル、32はクラスAに属する1つのオブジェク
ト、33はクラスBのメソッドテーブル、34はクラス
Bに属する1つのオブジェクトである。また、35は、
クラスAについて定義された2つのメソッドであって、
メソッドMはメッセージmを処理するためのメソッド、
メソッドNはメッセージnを処理するためのメソッドで
ある。36は、クラスBについて定義されたメソッドで
ある。但し、クラスAをスーパークラスとするクラスB
は、クラスAからメソッドM,Nをそのまま継承するの
ではなくてメッセージmに対応するメソッドをメソッド
MMに定義し直したうえで、メッセージtを処理するた
めのメソッドTを追加定義したものである。
In FIG. 3, 31 is a method table of class A, 32 is one object belonging to class A, 33 is a method table of class B, and 34 is one object belonging to class B. Also, 35 is
Two methods defined for class A,
Method M is a method for processing message m,
Method N is a method for processing the message n. 36 is a method defined for the class B. However, class B with class A as a super class
Does not directly inherit the methods M and N from the class A, but redefines the method corresponding to the message m in the method MM, and additionally defines the method T for processing the message t. .

【0033】この図3を用いて、先ず、コンパイラ等に
よって行われるメソッドテーブル31,33の作成の手
順を簡単に説明する。
First, the procedure of creating the method tables 31 and 33 performed by the compiler or the like will be briefly described with reference to FIG.

【0034】メソッドテーブルは、クラス階層における
上位のクラスから順に作成される。即ち、図3では、ク
ラスBのスーパークラスとなるクラスAのメソッドテー
ブル31の方から先に作成される。クラスAではメソッ
ドMとメソッドNとが実行可能なメソッドとして定義さ
れているので、メソッドMとメソッドNとの各々のアド
レスが格納されたメソッドテーブル31が作成される。
このとき、各メッセージに対応するメソッドの各アドレ
スのメソッドテーブル31における格納位置、即ち、そ
のメソッドテーブル31内でのディスプレースメント
が、各々定数として決定される。図3の場合には、クラ
スAにおいてメッセージmに対応するメソッドMは、そ
のメソッドテーブル31の1番目のメソッドであると決
定され、メッセージnに対応するメソッドNは、2番目
のメソッドであると決定されるのである。
The method table is created in order from the upper class in the class hierarchy. That is, in FIG. 3, the method table 31 of the class A, which is a superclass of the class B, is created first. Since the method M and the method N are defined as executable methods in the class A, the method table 31 in which the addresses of the method M and the method N are stored is created.
At this time, the storage position of each address of the method corresponding to each message in the method table 31, that is, the displacement in the method table 31, is determined as a constant. In the case of FIG. 3, the method M corresponding to the message m in the class A is determined to be the first method in the method table 31, and the method N corresponding to the message n is the second method. It is decided.

【0035】次に、既にメソッドテーブルが作成された
クラスをスーパークラスとする他のクラスのメソッドテ
ーブルが作成される。即ち、図3では、クラスAをスー
パークラスとするクラスBのメソッドテーブル33が作
成される。そこでは、先ず、スーパークラスAのメソッ
ドテーブル31がコピーされてクラスBのメソッドテー
ブル33の原型が作成される。これにより、オブジェク
ト指向言語の重要な機能の1つであるメソッドの継承が
実現される。そして、クラスBで定義し直されたメッセ
ージmに対応するメソッドMMのアドレスを、メソッド
テーブル33のメッセージmに対応する位置、即ち、1
番目に格納する。そして、クラスBで新しく定義された
メッセージtに対応するメソッドTのアドレスをメソッ
ドテーブル33に追加格納する。このとき、メッセージ
tに対応するメソッドTは、メソッドテーブル33の3
番目であると決定される。
Next, a method table of another class whose super class is a class for which a method table has already been created is created. That is, in FIG. 3, the method table 33 of the class B having the class A as a super class is created. There, first, the method table 31 of the superclass A is copied and the prototype of the method table 33 of the class B is created. As a result, method inheritance, which is one of the important functions of object-oriented languages, is realized. Then, the address of the method MM corresponding to the message m redefined by the class B is set to the position corresponding to the message m in the method table 33, that is, 1
Store th. Then, the address of the method T corresponding to the message t newly defined in the class B is additionally stored in the method table 33. At this time, the method T corresponding to the message t is 3 in the method table 33.
Determined to be th.

【0036】以上の手続きを繰り返すことにより、全て
のクラスのためのメソッドテーブルが作成されることに
なる。この結果、図3の例では、クラスAのサブクラス
としてのクラスBのメソッドテーブル33におけるメソ
ッドアドレスの順番は、先ず、メッセージmに対応する
クラスAのメソッドMを定義し直した同じメッセージm
に対応するメソッドMMのアドレスと、メッセージnに
対応するようにクラスAから継承を受けたメソッドNの
アドレスとが並び、その後に、新たに定義されたメソッ
ドTのアドレスが入る順番となっている。つまり、両メ
ソッドテーブル31,33をオブジェクト32,34の
側から見ると、メッセージmに対応する位置はいずれも
1番目、メッセージnに対応する位置はいずれも2番目
となる。また、メッセージtに対応する位置は3番目と
なる。このように、両メソッドテーブル31,33中の
ディスプレースメントは、オブジェクト及びクラスの違
いを越えて、メッセージの種類毎にコンパイル時に予め
一意に決定される。
By repeating the above procedure, method tables for all classes are created. As a result, in the example of FIG. 3, the order of the method addresses in the method table 33 of the class B, which is a subclass of the class A, is such that the method M of the class A corresponding to the message m is first redefined.
The address of the method MM corresponding to the message is aligned with the address of the method N inherited from the class A so as to correspond to the message n, and then the address of the newly defined method T enters. . That is, when the method tables 31 and 33 are viewed from the side of the objects 32 and 34, the position corresponding to the message m is the first position, and the position corresponding to the message n is the second position. The position corresponding to the message t is the third position. In this way, the displacements in both the method tables 31 and 33 are uniquely determined in advance at the time of compilation for each message type, regardless of the difference between the object and the class.

【0037】さて、以上に説明した図3の例では、クラ
スAに属するオブジェクト32にメッセージmを送った
場合には、クラスAのメソッドテーブル31の1番目の
メソッドアドレスで示されるメソッドMがメッセージm
にバインディングされる。一方、クラスBに属するオブ
ジェクト34にメッセージmを送った場合には、クラス
Bのメソッドテーブル33の1番目のメソッドアドレス
で示されるメソッドMMがメッセージmにバインディン
グされる。これに対してクラスAに属するオブジェクト
32にメッセージnを送ったときにはメソッドNが、ク
ラスBに属するオブジェクト34にメッセージnを送っ
たときにも同じくメソッドNが、各々メッセージnにバ
インディングされる。また、クラスBに属するオブジェ
クト34にメッセージtを送ったときには、メソッドT
がメッセージtにバインディングされる。このように図
3の例によれば、クラス間のメソッドの継承の機能と同
時に、メッセージとメソッドとの間の動的バインディン
グを実現することができるのである。
In the example of FIG. 3 described above, when the message m is sent to the object 32 belonging to the class A, the method M indicated by the first method address of the method table 31 of the class A is the message. m
Bound to. On the other hand, when the message m is sent to the object 34 belonging to the class B, the method MM indicated by the first method address in the method table 33 of the class B is bound to the message m. On the other hand, when the message n is sent to the object 32 belonging to the class A, the method N is also bound to the message n when the message n is sent to the object 34 belonging to the class B. When the message t is sent to the object 34 belonging to the class B, the method T
Is bound to the message t. As described above, according to the example of FIG. 3, it is possible to realize a function of inheriting a method between classes and a dynamic binding between a message and a method.

【0038】次に、本発明の他の実施例を図面に基づい
て説明する。
Next, another embodiment of the present invention will be described with reference to the drawings.

【0039】図4は、本発明の他の実施例に係るオブジ
ェクト指向言語の実行システムの構成を示す概念図であ
る。同図において、41は、先頭にオブジェクト13の
大きさを格納するための領域42を備えたメソッドテー
ブルである。全てのクラスに対して、このようなメソッ
ドテーブル41が各々1つずつ作成される。各クラスの
ためのメソッドテーブル41の先頭領域42には、当該
クラスに属する新たなオブジェクト13を生成する際に
該オブジェクト13に占有させるためにメモリ上に確保
すべき領域の大きさが、コンパイル時に予め格納されて
いる。メソッドテーブル41は、このオブジェクトの大
きさの格納領域42の後に、図1の場合と同様の各メソ
ッド16へのポインタ12が並ぶ構成となっている。
FIG. 4 is a conceptual diagram showing the configuration of an object oriented language execution system according to another embodiment of the present invention. In the figure, 41 is a method table having an area 42 for storing the size of the object 13 at the head. One such method table 41 is created for all classes. In the head area 42 of the method table 41 for each class, the size of the area to be secured in the memory in order to be occupied by the new object 13 when the new object 13 belonging to the class is generated It is stored in advance. The method table 41 has a structure in which the pointers 12 to the respective methods 16 are arranged after the storage area 42 of the size of this object, as in the case of FIG.

【0040】しかも、いずれのクラスのためのメソッド
テーブル41についてもオブジェクトの大きさの格納領
域42のサイズは一定であって、各メソッドアドレスの
格納位置を表わすディスプレースメントには、図1の場
合に比べて領域42の一定のサイズ分だけバイアスが与
えられる。従って、メソッドテーブル41中の各メソッ
ドアドレスに関するディスプレースメントがオブジェク
ト及びクラスの違いを越えてメッセージの種類毎にコン
パイル時に予め一意に決定され、且つメッセージとメソ
ッドとの間の高速バインディングが実現できる点は、図
1に示す前実施例の場合と同様である。
Moreover, in the method table 41 for any class, the size of the object size storage area 42 is constant, and the displacement indicating the storage location of each method address is the same as in the case of FIG. In comparison, the bias is given only for the fixed size of the region 42. Therefore, the displacement related to each method address in the method table 41 is uniquely determined at compile time for each message type regardless of the difference between the object and the class, and the high-speed binding between the message and the method can be realized. The same as in the case of the previous embodiment shown in FIG.

【0041】さて、クラスに対するメッセージに応答し
てそのクラスに属する新たなオブジェクトをメモリ上に
生成するためには、オブジェクト生成メソッドを起動し
なければならない。そして、この起動に際しては、メソ
ッドのアドレスが格納されたテーブルのアドレスをその
オブジェクト生成メソッドに引き渡すだけでなく、生成
すべきオブジェクトの大きさをも該オブジェクト生成メ
ソッドに引き渡す必要がある。従って、図1に示す前実
施例の場合には、オブジェクト13を生成するためのオ
ブジェクト生成メソッドに対して、メソッドテーブル1
1のアドレスを1つの引数として渡してやるだけでな
く、生成すべきオブジェクト13の大きさを別の引数と
して渡してやることになる。ところが、図4に示す本実
施例によれば、オブジェクト13の所要の大きさがメソ
ッドテーブル41の中に格納されているので、そのメソ
ッドテーブル41のアドレスを1つの引数としてオブジ
ェクト生成メソッドに引き渡すだけでよく、オブジェク
ト生成メソッドによる引数の処理時間が短縮できる。つ
まり、オブジェクト生成メソッドの高速起動が可能にな
るのである。一般に、オブジュクト指向言語で記述され
たプログラムではオブジェクトの生成を頻繁に行うの
で、オブジェクト生成メソッドの起動の高速化を通し
て、プログラム全体の実行速度を大幅に向上させること
ができる。
Now, in order to generate a new object belonging to the class on the memory in response to the message for the class, the object generation method must be activated. Then, at the time of this activation, not only the address of the table storing the method address but also the size of the object to be generated needs to be transferred to the object generating method. Therefore, in the case of the previous embodiment shown in FIG. 1, the method table 1 is added to the object generation method for generating the object 13.
Not only is the address of 1 passed as one argument, but the size of the object 13 to be generated is passed as another argument. However, according to the present embodiment shown in FIG. 4, since the required size of the object 13 is stored in the method table 41, the address of the method table 41 is passed as one argument to the object generation method. The processing time of the argument by the object generation method can be shortened. In other words, the object generation method can be started at high speed. Generally, in a program written in an object-oriented language, objects are frequently created, so the execution speed of the entire program can be greatly improved by speeding up the activation of the object creation method.

【0042】このようにしてメソッドテーブル41のア
ドレスを受け取ったオブジェクト生成メソッドは、オブ
ジェクトの大きさの格納領域42の内容に従って、生成
すべきオブジェクト13をあるメモリ領域に割り付けた
うえで、そのメモリ領域中のポインタ14の中に先に引
数として受け取ったメソッドテーブル41のアドレスを
書き込むことにより、そのメソッドテーブル41に関連
付けられた新たなオブジェクト13を生成する。これに
より、その新たなオブジェクト13についても、2つの
ポインタ14,12を通したメッセージとメソッドとの
間の高速バインディングを担保できることとなる。
The object generation method that has received the address of the method table 41 in this way allocates the object 13 to be generated to a certain memory area according to the contents of the object size storage area 42, and then allocates that memory area. The new object 13 associated with the method table 41 is generated by writing the address of the method table 41 previously received as an argument into the pointer 14 therein. As a result, also for the new object 13, high-speed binding between the message and the method through the two pointers 14 and 12 can be secured.

【0043】[0043]

【発明の効果】以上説明してきたとおり、請求項1の発
明によれば、クラス毎のメソッドテーブル中の各メソッ
ドアドレスの格納位置を表わすディスプレースメントを
メッセージの種類に応じた定数としてそれぞれコンパイ
ル時に予め決定しておく構成を採用したので、オブジェ
クト中においてそのメソッドテーブルのアドレスを指し
示すポインタとメッセージの種類毎の定数としてのディ
スプレースメントとのみに基づいて、メソッドテーブル
の検索を行うことなく、オブジェクトが受け取ったメッ
セージをメソッドに対して高速にバインディングするこ
とができる。しかも、メソッドテーブル中のメソッドア
ドレスは従来とは違って検索のためのメッセージ識別子
を伴なう必要がないので、そのメソッドテーブルがメモ
リ上に占める容量を従来に比べて低減することができ
る。
As described above, according to the first aspect of the present invention, the displacement indicating the storage position of each method address in the method table for each class is set as a constant according to the type of message in advance at the time of compilation. Since the configuration is decided beforehand, the object can be received without searching the method table based only on the pointer that points to the address of the method table in the object and the displacement as a constant for each type of message. It is possible to quickly bind the message to the method. Moreover, unlike the conventional method, the method address in the method table does not need to be accompanied by a message identifier for retrieval, so that the capacity of the method table on the memory can be reduced as compared with the conventional method.

【0044】また、請求項2の発明によれば、2つのク
ラスの各々のためのメソッドテーブルは同一のディスプ
レースメントで表わされる位置に同一のメソッドアドレ
スが各々格納された構成を採用したので、その同一のメ
ソッドアドレスを通して両クラス間でのメソッドの継承
を実現すると同時に、メッセージとメソッドとの間の高
速バインディングを実現することができる。
Further, according to the second aspect of the invention, the method table for each of the two classes adopts a configuration in which the same method address is stored in the position represented by the same displacement. Method inheritance can be realized between both classes through the same method address, and at the same time, high-speed binding between message and method can be realized.

【0045】また、請求項3の発明によれば、2つのク
ラスの各々のためのメソッドテーブルは同一のディスプ
レースメントで表わされる位置に異なるメソッドアドレ
スが各々格納された構成を採用したので、メソッドの定
義し直しを含む動的なバインディングに対応することが
できる。
According to the third aspect of the present invention, the method table for each of the two classes has a structure in which different method addresses are stored at the positions represented by the same displacement. It can support dynamic binding, including redefinition.

【0046】また、請求項4の発明によれば、前記各メ
ソッドアドレスに加えて、新たなオブジェクトの生成の
ために必要なメモリの大きさを更にメソッドテーブルに
格納した構成を採用したので、メソッドテーブルのアド
レスを1つの引数としてオブジェクト生成メソッドに引
き渡すだけでよく、そのオブジェクト生成メソッドによ
る引数の処理時間が短縮でき、該オブジェクト生成メソ
ッドはメッセージとメソッドとの間の高速バインディン
グが担保された新たなオブジェクトを高速に生成するこ
とができる。
Further, according to the invention of claim 4, in addition to each method address, the memory size required for generating a new object is further stored in the method table. It is only necessary to pass the address of the table as an argument to the object generation method, the processing time of the argument by the object generation method can be shortened, and the object generation method is provided with a new fast binding between the message and the method. Objects can be generated at high speed.

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

【図1】本発明の一実施例に係るオブジェクト指向言語
の実行システムの構成を示す概念図である。
FIG. 1 is a conceptual diagram showing the configuration of an object oriented language execution system according to an embodiment of the present invention.

【図2】図1のオブジェクト指向言語の実行システムに
おけるメッセージとメソッドとの間のバインディングの
手順を示すフローチャート図である。
FIG. 2 is a flowchart showing a procedure of binding between a message and a method in the object oriented language execution system of FIG.

【図3】図1の構成を2つのクラスについて具体化した
構成を示す概念図である。
FIG. 3 is a conceptual diagram showing a configuration in which the configuration of FIG. 1 is embodied for two classes.

【図4】本発明の他の実施例に係るオブジェクト指向言
語の実行システムの構成を示す概念図である。
FIG. 4 is a conceptual diagram showing the configuration of an object oriented language execution system according to another embodiment of the present invention.

【図5】従来のオブジェクト指向言語の実行システムの
構成を示す概念図である。
FIG. 5 is a conceptual diagram showing a configuration of a conventional object-oriented language execution system.

【図6】図5のオブジェクト指向言語の実行システムに
おけるメッセージとメソッドとの間のバインディングの
手順を示すフローチャート図である。
6 is a flowchart showing a procedure of binding between a message and a method in the object oriented language execution system of FIG.

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

11,31,33,41 メソッドテーブル 12 メソッドへのポインタ 13,32,34 オブジェクト 14 メソッドテーブルへのポイン
タ 16,35,36 メソッド 42 オブジェクトの大きさの格納
領域
11, 31, 33, 41 Method table 12 Pointer to method 13, 32, 34 Object 14 Pointer to method table 16, 35, 36 Method 42 Object size storage area

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 処理依頼としての複数の種類のメッセー
ジの各々に対応した実行可能な処理手続きとして、1つ
のクラスに対してメモリ上において互いに異なるアドレ
スにそれぞれ定義された複数のメソッドと、 前記クラスのために前記メモリ上において前記複数のメ
ソッドとは異なるアドレスに作成され、且つ前記複数の
メソッドの各々のメモリ上でのアドレスがそれぞれメソ
ッドアドレスとして格納され、且つ各メソッドアドレス
の格納位置を表わすディスプレースメントが前記複数の
種類のメッセージの各々に応じた定数としてそれぞれコ
ンパイル時に予め決定されたメソッドテーブルと、 前記クラスに対して前記メモリ上において前記複数のメ
ソッド及びメソッドテーブルとは異なるアドレスに生成
され、且つ前記メソッドテーブルのメモリ上でのアドレ
スを指し示すためのポインタを有し、且つ一度に前記複
数の種類のメッセージのうちの1つを受け取るオブジェ
クトとを備え、 前記オブジェクトが受け取ったメッセージは、前記ポイ
ンタと前記メッセージの種類毎の定数としてのディスプ
レースメントとに従って、前記メソッドテーブル中の該
メッセージに対応したメソッドアドレスを通して該メッ
セージに対応したメソッドにバインディングされ、且つ
該バインディングされたメソッドの実行を通して処理を
受けることを特徴とするオブジェクト指向言語の実行シ
ステム。
1. A plurality of methods defined as different addresses in a memory for one class as an executable processing procedure corresponding to each of a plurality of types of messages as processing requests, and the class. Is created at a different address from the plurality of methods on the memory, and the addresses on the memory of each of the plurality of methods are stored as method addresses, respectively, and a display representing the storage location of each method address is displayed. Method is predetermined at the time of compilation as a constant corresponding to each of the plurality of types of messages, and the plurality of methods and method table in the memory for the class is generated at a different address, And the method table An object having a pointer for indicating an address in memory and receiving one of the plurality of types of messages at a time, wherein the message received by the object is the pointer and the type of the message. According to the displacement as a constant for each, the method is bound to the method corresponding to the message through the method address corresponding to the message in the method table, and is processed through the execution of the bound method. Object-oriented language execution system.
【請求項2】 複数のクラスの各々に対して前記複数の
メソッド、メソッドテーブル及びオブジェクトをそれぞ
れ備え、 前記複数のクラスのうちの1つのクラスのためのメソッ
ドテーブルと他の1つのクラスのためのメソッドテーブ
ルとは、両クラス間でのメソッドの継承のために、同一
のディスプレースメントで表わされる位置に同一のメソ
ッドアドレスが各々格納されていることを特徴とする請
求項1記載のオブジェクト指向言語の実行システム。
2. A plurality of methods, a method table, and an object for each of a plurality of classes, respectively, a method table for one of the plurality of classes, and a method table for another one of the plurality of classes. 2. The object table according to claim 1, wherein the method table has the same method address stored at the position indicated by the same displacement for inheriting the method between both classes. Execution system.
【請求項3】 複数のクラスの各々に対して前記複数の
メソッド、メソッドテーブル及びオブジェクトをそれぞ
れ備え、 前記複数のクラスのうちの1つのクラスのためのメソッ
ドテーブルと他の1つのクラスのためのメソッドテーブ
ルとは、同一のディスプレースメントで表わされる位置
に異なるメソッドアドレスが各々格納されていることを
特徴とする請求項1記載のオブジェクト指向言語の実行
システム。
3. A plurality of methods, a method table, and an object for each of a plurality of classes, respectively, a method table for one of the plurality of classes, and a method table for another one of the plurality of classes. The object-oriented language execution system according to claim 1, wherein different method addresses are stored in positions represented by the same displacement as the method table.
【請求項4】 前記1つのクラスのために作成されたメ
ソッドテーブルは、該クラスに対して新たに生成される
オブジェクトに占有させるために前記メモリ上に確保す
べき領域の大きさが更に格納されていることを特徴とす
る請求項1記載のオブジェクト指向言語の実行システ
ム。
4. The method table created for the one class further stores the size of the area to be reserved on the memory in order to occupy an object newly created for the class. The object-oriented language execution system according to claim 1, characterized in that:
JP3327280A 1990-12-25 1991-12-11 Execution system of object-oriented language Pending JPH0520082A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2-405862 1990-12-25
JP40586290 1990-12-25

Publications (1)

Publication Number Publication Date
JPH0520082A true JPH0520082A (en) 1993-01-29

Family

ID=18515467

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3327280A Pending JPH0520082A (en) 1990-12-25 1991-12-11 Execution system of object-oriented language

Country Status (1)

Country Link
JP (1) JPH0520082A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08110860A (en) * 1994-02-11 1996-04-30 Internatl Business Mach Corp <Ibm> Interface mechanism,class library and asynchronous data-processing method
WO1998019236A1 (en) * 1996-10-31 1998-05-07 Sony Corporation Information processing system and information processing method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08110860A (en) * 1994-02-11 1996-04-30 Internatl Business Mach Corp <Ibm> Interface mechanism,class library and asynchronous data-processing method
US5999987A (en) * 1994-02-11 1999-12-07 International Business Machines Corporation Concurrent processing in object oriented parallel and near parallel
WO1998019236A1 (en) * 1996-10-31 1998-05-07 Sony Corporation Information processing system and information processing method

Similar Documents

Publication Publication Date Title
US5848419A (en) Methods and apparatus for providing transparent persistence in a distributed object operating environment
US6163880A (en) Object model for Java™
US6792606B2 (en) Method and apparatus for object persistence
US5940837A (en) Distributed data base system
EP0620522A2 (en) High performance dynamic linking through caching
JP2000222212A (en) Determine the real class of an object at runtime
CN111984425B (en) Memory management method, device and equipment for operating system
CA2145671A1 (en) Shared library locating system
JPH113269A (en) System and method for assisting accurate garbage collection by separating contents of stack into sub-stacks
EP2049992A1 (en) Software transactional protection of managed pointers
JP3844801B2 (en) Method and mechanism for invocation on an object with interface inheritance
JPH04163630A (en) Method starting system in object directional language
JP2870582B2 (en) Hypermedia document management device
CN101430685A (en) Downloading method and system
JPH0520082A (en) Execution system of object-oriented language
CN111125216A (en) Method and device for importing data into Phoenix
US6658647B1 (en) Access to resource files stored in ROM
JP2000122876A (en) Information processing device
US6671783B1 (en) Method and article for managing references between objects in memories of different durations in a run-time environment
JPH11232103A (en) Program link method and method search method
JPH09146772A (en) Procedure call method
JP3693311B2 (en) Distributed processing system
JP3085309B2 (en) Debug system
JPH0337748A (en) External storage accessing system utilizing main storage
Franco et al. Towards a facility for lexically scoped, dynamic mutual recursion in Scheme

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20000111