JPH03212738A - Function access system - Google Patents

Function access system

Info

Publication number
JPH03212738A
JPH03212738A JP2008998A JP899890A JPH03212738A JP H03212738 A JPH03212738 A JP H03212738A JP 2008998 A JP2008998 A JP 2008998A JP 899890 A JP899890 A JP 899890A JP H03212738 A JPH03212738 A JP H03212738A
Authority
JP
Japan
Prior art keywords
function
definition
entry
compiled code
referenced
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
JP2008998A
Other languages
Japanese (ja)
Inventor
Yukiko Hashimoto
橋本 ユキ子
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.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2008998A priority Critical patent/JPH03212738A/en
Publication of JPH03212738A publication Critical patent/JPH03212738A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To speed up a function access by accessing the up-to-date definition of another compiled function from a certain compiled function without passing a function identification(ID) cell. CONSTITUTION:When a function B access instruction 211 in a function A definition compile code 2 is executed, control is immediately transferred to a function B definition compile code 4 in accordance with an address stored in a function B entry 221 without passing a function B ID cell 3. Similarly, control is immediately transferred to a function C definition compile code 6 in accordance with an address stored in a function C access instruction 212. When the definition of the function B, C or the like is changed and a new function definition compile code is loaded to a storage area, the contents of the function B entry 221 and the function C entry 222 in the literal table 22 of the code 2 are changed in accordance with the loaded new code to transfer control always to the up-to- date function definition.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は関数呼び出し方式に関し、特にインタプリタを
基本とするシステムにおけるコンパイルされた関数の呼
び出し方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a method for calling functions, and more particularly to a method for calling compiled functions in an interpreter-based system.

[従来の技術〕 ソースプログラムを解釈、実行しながら動作することを
基本とする言語処理システムに対し、ソースプログラム
をコンパイルするコンパイラを設け、ソースプログラム
以外にコンパイルされて得られたオブジェクトをも実行
可能とすることにより実行速度の向上を図った言語処理
システムがある。このような言語処理システムでは、プ
ログラミング上意味的な−かたまりを形成している単位
(これを関数という)を定義したり、既に定義されてい
る関数を再定義したりすることも、インクブリタ上で動
的に行えるようになっており、このとき、成る関数から
他の関数を実際に呼び出す前であれば、呼び出そうとし
ている関数の定義が変更されても正しく最新の関数定義
が呼び出せるようにすることが重要である。これは従来
、第5図に示すような構成で実現している。
[Prior art] A language processing system that operates by interpreting and executing source programs is provided with a compiler that compiles the source programs, and can also execute objects obtained by compiling other than source programs. There is a language processing system that aims to improve execution speed by doing this. In such a language processing system, it is not possible to define a unit that forms a semantic block in programming (this is called a function), or to redefine an already defined function. This can be done dynamically, and at this time, before actually calling another function from the function, even if the definition of the function you are trying to call changes, the latest function definition can be called correctly. It is important to This has conventionally been realized with a configuration as shown in FIG.

第5図に示すように、各関数A、Bには、関数名エント
リ101.301や関数定義エントリ102.302な
どのエントリを持つ関数識別セル100.300が割り
当てられ、その関数定義エントリ102.302から、
コンパイルされた関数定義コンパイルドコード(ソース
プログラム形式の関数定義をコンパイルしたもの)20
0.4OOをポイントしている。関数定義コンパイルド
コード200,400は、機械語命令列201゜401
を有すると共に、その関数定義から参照している文字列
、リスト、他の関数定義など他のオブジェクトのアドレ
スを解決するためのリテラルテーブル202,402を
備えている。一般に文字列やリストまた関数定義などの
オブジェクトは、関数のコンパイル時にはその記憶域上
のアドレスを決定することができないため、コンパイル
時にはリテラルテーブル202,402中の該当エント
リを参照して目的のオブジェクトをアクセスするような
命令を機械語命令列201.401中に生成し、関数定
義コンパイルドコード200,400の記憶域へのロー
ド時に、それらオブジェクトのアドレスをリテラルテー
ブル202,402中の該当エントリに書き込むように
している。即ち、たとえば関数Aから関数Bを呼び出す
関数B呼び出し命令2010は、それ用のエントリ20
20を参照して関数Bをアクセスするような命令とされ
、関数Aの関数定義コンパイルドコード200の記憶域
へのロード時に、呼び出し先の関数Bの関数定義コンパ
イルドコード400にかかる関数B用の関数識別セル3
00のアドレスを該当するエントリ2020に書き込む
ものである。
As shown in FIG. 5, a function identification cell 100.300 having entries such as a function name entry 101.301 and a function definition entry 102.302 is assigned to each function A and B, and the function definition entry 102.300 is assigned to each function A and B. From 302,
Compiled function definition Compiled code (compiled function definition in source program format) 20
The point is 0.4OO. The function definition compiled code 200, 400 is a machine language instruction sequence 201° 401
It also has literal tables 202 and 402 for resolving addresses of other objects such as character strings, lists, and other function definitions referenced from the function definition. Generally, the storage address of objects such as strings, lists, and function definitions cannot be determined when the function is compiled, so when compiling, the corresponding entry in the literal table 202, 402 is referenced to locate the target object. Generate instructions to access the machine language instruction sequence 201, 401, and write the addresses of these objects to the corresponding entries in the literal table 202, 402 when loading the function definition compiled code 200, 400 into the storage area. That's what I do. That is, for example, a function B call instruction 2010 that calls function B from function A has an entry 20 for it.
20 to access function B, and when the function definition compiled code 200 of function A is loaded into the storage area, the instruction for function B that is applied to the function definition compiled code 400 of the called function B function identification cell 3
00 address is written into the corresponding entry 2020.

以上のように構成することにより、例えば関数Bの関数
定義コンパイルドコード400を記憶域上にロードした
後に関数Bの定義を変更し、それ用の新たな関数定義コ
ンパイルドコードを記憶域にロードした場合、それに合
わせて関数B用の関数識別セル300の関数定義エント
リ302の内容を変更すれば、関数Aから常に最新の関
数定義を呼び出すことができる。
With the above configuration, for example, after loading the function definition compiled code 400 of function B into the storage area, the definition of function B can be changed, and the new function definition compiled code for it can be loaded into the storage area. In this case, by changing the contents of the function definition entry 302 of the function identification cell 300 for function B accordingly, the latest function definition can always be called from function A.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述した従来の関数呼び出し方式によっても常に最新の
関数定義を呼び出すことは可能であるが、必ず関数識別
セルの関数定義エントリを参照して関数を呼び出すため
、関数識別セルをアクセスするための処理が必要となり
、他のコンパイラ型言語に比べると関数呼び出しにかか
る時間が遅くなるという問題点があった。
Although it is possible to always call the latest function definition using the conventional function calling method described above, the function is always called by referring to the function definition entry in the function identification cell, so the processing to access the function identification cell is not necessary. The problem was that the time required to call a function was slower than in other compiled languages.

本発明はこのような従来の問題点を解決したもので、そ
の目的は、関数識別セルを経由することなく成る関数か
ら別の関数の最新定義を呼び出すことができる関数呼び
出し方式を提供することにある。
The present invention has solved these conventional problems, and its purpose is to provide a function calling method that allows a function to call the latest definition of another function without going through a function identification cell. be.

〔課題を解決するための手段〕[Means to solve the problem]

本発明の関数呼び出し方式は上記の目的を達成するため
に、 関数にかかる関数定義コンパイルドコード中の関数呼び
出し命令をリテラルテーブル中の該当エントリに格納さ
れたアドレス先へ関数識別セルを経由せずに制御を移行
せしめる命令にすると共に、その関数から呼び出される
呼び出し元関数の関数名および該呼び出し元関数に割り
当てたリテラルテーブル中の前記エントリの位置情報と
を保持する[参照している関数テーブル」と、その関数
を呼び出す呼び出し元関数の関数名を保持する「参照さ
れている関数テーブル」とを設け、関数にかかる関数定
義コンパイルドコードを記憶域ヘロードした際に、 該ロートした関数にかかる「参照している関数テーブル
」に設定された各関数名の呼び出し元関数にかかる[参
照されている関数テーブルJに前記ロードした関数の関
数名を格納すると共にその呼び出し元関数にかかる関数
定義コンパイルドコードの記憶域上のアドレスが確定し
ているときはそのアドレスをリテラルテーブル中のその
呼び出し元関数に対応するエントリに格納し、且つ、前
記ロードした関数にかかる「参照されている関数テーブ
ル」に設定された各関数名の呼び出し元関数にかかる関
数定義コンパイルドコードのリテラルテーブル中の該当
エントリに前記ロードした関数にかかる関数定義コンパ
イルトコートの記憶域上のアドレスを格納するようにし
ている。
In order to achieve the above object, the function call method of the present invention sends a function call instruction in the function definition compiled code related to the function to the address stored in the corresponding entry in the literal table without going through the function identification cell. [Referenced function table] holds the function name of the calling function called from that function and the position information of the entry in the literal table assigned to the calling function. and a "referenced function table" that holds the function name of the calling function that calls the function, and when the function definition compiled code for the function is loaded into the storage area, the "referenced function table" for the loaded function is stored. [The function name of the loaded function is stored in the referenced function table J, and the function definition compiled code related to the calling function is stored in the referenced function table J. When the address in the storage area of the code is fixed, that address is stored in the entry corresponding to the calling function in the literal table, and also in the "referenced function table" related to the loaded function. The address in the storage area of the function definition compiled code related to the loaded function is stored in the corresponding entry in the literal table of the function definition compiled code related to the calling function of each set function name.

〔作用〕[Effect]

本発明の関数呼び出し方式の作用を、理解を容易にする
為に関数Aから関数Bを呼び出す場合を例にして説明す
ると、先ず、関数への関数定義コンパイルドコード中の
関数Bを呼び出す命令はリテラルテーブル中の該当エン
トリに格納されたアドレス先へ関数B用の関数識別セル
を経由せずに制御を移行せしめる命令にされる。そして
、関数Aの関数定義コンパイルトコートを記憶域へロー
ドした際に、関数A用の「参照している関数テブル」に
設定された関数Bの関数名を転りに関数B用の「参照さ
れている関数テーブル」が特定され、そこに前記ロード
した関数Aの関数名が格納される。また、このとき呼び
出し元関数Bにかかる関数定義コンパイルドコードの記
憶域上のアドレスが確定している場合には、そのアドレ
スが関数Aの関数定義コンパイルトコートにおけるリテ
ラルテーブル中の関数Bに対応するエントリに格納され
る。これにより、関数Aの関数定義コンパイルドコード
における関数Bを呼び出す命令が実行されると、リテラ
ルテーブル中の該当エントリに格納されたアドレス先、
つまり関数Bの関数定義コンパイルドコードへ関数B用
の関数識別セルを経由することなく速やかに制御が移行
せしめられる。
To make the function calling method of the present invention easier to understand, we will explain the case where function B is called from function A as an example. First, the instruction to call function B in the function definition compiled code for the function is This is an instruction to transfer control to the address stored in the corresponding entry in the literal table without going through the function identification cell for function B. Then, when the function definition compiled code for function A is loaded into the storage area, the function name of function B set in the "referenced function table" for function A is changed to "referenced" for function B. The loaded function table is specified, and the function name of the loaded function A is stored there. At this time, if the address in the storage area of the function definition compiled code related to the calling function B is determined, that address corresponds to function B in the literal table in the function definition compiled code of function A. stored in the entry that As a result, when an instruction to call function B in the function definition compiled code of function A is executed, the address stored in the corresponding entry in the literal table,
In other words, control is quickly transferred to the function definition compiled code of function B without passing through the function identification cell for function B.

他方、関数Aの関数定義コンパイルドコードの記憶域上
へのロード時に、関数Bの関数定義コンパイルドコード
のアドレスが確定していないときは、その時点では関数
B用のエントリにはアドレスは格納されない。このアド
レスの格納は関数Bの関数定義コンパイルドコードが記
憶域上へロードされた時点で格納される。即ち、関数B
の関数定義コンパイルドコードを記憶域ヘロードした際
には、関数B用の「参照されている関数テーブル」の情
報によって関数Bが関数Aから呼ばれていることが判明
し、関数Aにかかる関数定義コンパイルドコードのリテ
ラルテーブルが検索され、関数B用のエントリに関数B
の関数定義コンパイルドコードの記憶域上のアドレスが
格納される。これによって、関数Aの関数定義コンパイ
ルドコードにおける関数Bを呼び出す命令の実行が可能
となる。
On the other hand, if the address of the function definition compiled code of function B is not determined when loading the function definition compiled code of function A into the storage area, the address is stored in the entry for function B at that point. Not done. This address is stored when the function definition compiled code of function B is loaded onto the storage area. That is, function B
When the function definition compiled code for function B is loaded into the storage area, it is found that function B is called by function A based on the information in the "referenced function table" for function B, and the function related to function A is The definition compiled code literal table is searched and the entry for function B is
Stores the memory address of the function definition compiled code. This makes it possible to execute an instruction that calls function B in the function definition compiled code of function A.

このように本発明では呼び出し先の関数Bの関数定義コ
ンパイルドコードが記憶域ヘロートされる時点でそのア
ドレスが呼び出し元の関数Aの関数定義コンパイルドコ
ードに設定されるので、関数Bの定義が変更され、関数
B用の新たな関数定義コンパイルドコードがロートされ
たときには、呼び出し元の関数Aの関数定義コンパイル
トコートにおける関数B対応のエントリのアドレスに関
数Bの最新の関数定義コンパイルドコードのアドレスが
保持されることになり、関数Aから常に最新の関数Bの
関数定義を呼び出すことができる。
In this way, in the present invention, when the function definition compiled code of the called function B is moved to the storage area, its address is set to the function definition compiled code of the called function A, so that the definition of the function B is When the new function definition compiled code for function B is changed and the new function definition compiled code for function B is loaded, the latest function definition compiled code for function B is stored at the address of the entry corresponding to function B in the function definition compiled code of the calling function A. The address of function B is held, and function A can always call the latest function definition of function B.

(実施例] 次に、本発明の実施例について図面を参照して詳細に説
明する。
(Example) Next, an example of the present invention will be described in detail with reference to the drawings.

第1図は本発明の一実施例の構成図であり、関数Aから
関数B、関数Cを本発明の方式で呼び出す場合にコンパ
イラによって記憶域上にロード作成された内容例を示し
ている。同図に示すように記憶域上には、関数Aにかか
るものとして、関数識別セル1.関数定義コンパイルド
コード2および「参照されている関数テーブル」14が
作成され、関数Bにかかるものとして、関数識別セル3
、関数定義コンパイルドコード4および「参照されてい
る関数テーブルJ34が作成され、関数Cにかかるもの
として、関数識別セル5.関数定義コンパイルトコ−ド
ロおよび「参照されている関数テーブル」54が作成さ
れている。
FIG. 1 is a block diagram of an embodiment of the present invention, and shows an example of contents loaded and created on a storage area by a compiler when functions A, B, and C are called using the method of the present invention. As shown in the figure, on the storage area, function identification cells 1. A function definition compiled code 2 and a "referenced function table" 14 are created, and a function identification cell 3 is created for function B.
, function definition compiled code 4 and "referenced function table J34" are created, and function identification cell 5.function definition compiled code 4 and "referenced function table" 54 are created as those related to function C. has been done.

関数への関数定義コンパイルドコード2は、機械語命令
列21とリテラルテーブル22と「参照している関数テ
ーブル」23とを含み、機械語命令列21中に関数B呼
び出し命令211と関数C呼び出し命令212とが存在
する。また、リテラルテーブル22には関数B用エント
リ221と関数C用エントリ222とがあり、関数B用
エンドIJ 221には関数Bの関数定義コンパイルド
コード4のアドレスが格納され、関数C用エントリ22
2には間数Cの関数定義コンパイルトコ−ドロのアドレ
スが格納されている。「参照している関数テーブル」2
3には図示は省略しているが、関数名Bとそれ用のエン
トリ221の位置情報とを格納するエントリと、関数名
Cとそれ用のエントリ222の位置情報とを格納するエ
ントリとが設けられている。関数B呼び出し命令211
は、関数B用エントリ221に格納されたアドレスヘジ
ヤンプするようなコードであり、関数C呼び出し命令2
12は、関数C用エントリ222に格納されたアドレス
ヘジャンプするようなコードである。
The function definition compiled code 2 for a function includes a machine language instruction string 21, a literal table 22, and a "referenced function table" 23, and includes a function B call instruction 211 and a function C call instruction in the machine language instruction string 21. There are instructions 212. Further, the literal table 22 has an entry 221 for function B and an entry 222 for function C. The end IJ 221 for function B stores the address of the function definition compiled code 4 of function B, and the entry 222 for function C stores the address of the function definition compiled code 4 of function B.
2 stores the address of the function definition compiled code for the number C. "Referenced function table" 2
Although not shown in FIG. 3, an entry for storing the function name B and the position information of the entry 221 for it, and an entry for storing the function name C and the position information for the entry 222 for it are provided. It is being Function B call instruction 211
is a code that jumps to the address stored in the entry 221 for function B, and is a code that jumps to the address stored in the entry 221 for function B.
12 is a code that jumps to the address stored in the entry 222 for function C.

関数A用の識別セルlは、関数名エントリ11゜関数定
義エントリ12.「参照されている関数テーブルエント
リ」13等で構成され、関数定義エントリ12に関数へ
の関数定義コンパイルドコード2のアドレスが格納され
ている。また「参照されている関数テーブルエントリJ
13には、「参照されている関数テーブル」14のアド
レスが格納されている。この[参照されている関数テー
ブル」14には関数Aを呼び出している関数が存在する
場合には、その関数名が格納される。
The identification cell l for function A is function name entry 11.function definition entry 12. It is composed of "referenced function table entries" 13 and the like, and the address of the function definition compiled code 2 to the function is stored in the function definition entry 12. Also, "Referenced function table entry J
13 stores the address of the "referenced function table" 14. If there is a function that calls function A, the "referenced function table" 14 stores the name of the function.

関数B用の識別セル3.関数C用の識別セル5も、関数
A用の識別セル1と同様に、関数名エントリ31,51
.関数定義エントリ32,52゜参照されている関数テ
ーブルエントリ33.53等で構成され、関数定義エン
トリ32.52に関数Bの関数定義コンパイシドコード
4.関数Cの関数定義コンパイルトコ−ドロのアドレス
が格納されている。また、参照されている関数テーブル
エントリ33.53には関数B用の「参照されている関
数テーブル」34.関数C用の「参照されている関数テ
ーブル」54のアドレスが格納されている。そして、こ
の場合、[参照されている関数テーブルJ34,54中
には関数Bを呼び出している関数Aの関数名がそれぞれ
格納されている。
Identification cell for function B3. Similarly to the identification cell 1 for function A, the identification cell 5 for function C also has function name entries 31, 51.
.. Function definition entries 32, 52° are composed of referenced function table entries 33, 53, etc., and function definition compiled code 4 of function B is written in function definition entry 32, 52. The address of the function definition compiled code for function C is stored. Also, the referenced function table entry 33.53 includes the "referenced function table" 34.53 for function B. The address of the "referenced function table" 54 for function C is stored. In this case, the function names of the function A that calls the function B are stored in the referenced function tables J34 and J54, respectively.

関数B、Cの関数定義コンパイルドコード4.6の内部
構造は図示を省略しているが、その構造は関数Aの関数
定義コンパイルドコード2と同様である。
The internal structure of the function definition compiled code 4.6 for functions B and C is not shown, but the structure is similar to the function definition compiled code 2 for function A.

以上のような構成を有するため、関数Aの関数定義コン
パイルドコード2における関数B呼び出し命令211が
実行されると、関数B用エントリ221に格納されたア
ドレスに従って、関数B用の識別セル3を経由すること
なく、関数Bの関数定義コンパイルドコード4に直ちに
制御が渡される。同様に、関数C呼び出し命令212が
実行されると、関数C用エントリ222に格納されたア
ドレスに従って関数Cの関数定義コンパイルトコ−トロ
に直ちに制御が渡されることになる。そして後述するよ
うに、関数B、  C等の定義が変更され、新たな関数
定義コンパイルドコードが記憶域にロードされた場合に
は、それに応して関数Aの関数定義コンパイルドコード
2のリテラルテーブル22における関数B用エントリ2
21.関数C用エントリ222の内容が変更せしめられ
ることにより、常に最新の関数定義に制御が渡るように
なっている。
With the above configuration, when the function B call instruction 211 in the function definition compiled code 2 of function A is executed, the identification cell 3 for function B is called according to the address stored in the entry 221 for function B. Control is immediately passed to the function definition compiled code 4 of function B without going through the process. Similarly, when the function C call instruction 212 is executed, control is immediately passed to the function definition compilation controller of the function C according to the address stored in the function C entry 222. As described later, when the definitions of functions B, C, etc. are changed and new function definition compiled code is loaded into the storage area, the literal of function definition compiled code 2 of function A is changed accordingly. Entry 2 for function B in table 22
21. By changing the contents of the entry 222 for function C, control is always passed to the latest function definition.

次に、関数定義コンパイルドコード2.4.6を記憶域
ヘロードする際にコンパイラが行う処理について、第1
図中から関数Cにかかる部分を省略して簡略化した第2
図およびコンパイラの処理例の流れを示す第3図を参照
して説明する。
Next, we will explain the first part about the processing that the compiler performs when loading the function definition compiled code 2.4.6 into the storage area.
The second part is simplified by omitting the part related to function C from the figure.
This will be explained with reference to the figure and FIG. 3 showing the flow of an example of compiler processing.

コンパイラは、関数Aの関数定義コンパイルドコード2
を記憶域上ヘロードする際、第3図の処理Slにおいて
、その間数Aが呼び出している関数Bの関数名231と
その関数Bに割り当てたリテラルテーブル22中の関数
B用エントリ221の位置情報(例えば第2図に示す如
きリテラルテ−プル22の先頭からの相対位置)232
との紐230を持つ「参照している関数テーブル」23
を作成する。
The compiler generates function definition compiled code 2 for function A.
When loading into the storage area, in process Sl of FIG. 3, the function name 231 of the function B called by the number A and the position information ( For example, the relative position from the beginning of the literal table 22 as shown in FIG. 2) 232
"Referenced function table" 23 that has a string 230 with
Create.

次に、処理S2において、関数A用の関数識別セル1お
よび「参照されている関数テーブル」14について、既
に作成されていればそれを使い、未作成であれば作成し
た後、関数A用の関数識別セル1中の関数定義エントリ
12tこ関数への関数定義コンパイルドコード2のアド
レスを格納する。
Next, in process S2, if the function identification cell 1 and the "referenced function table" 14 for function A have already been created, they will be used; if they have not been created, they will be created, and then the Function definition entry 12t in function identification cell 1 stores the address of function definition compiled code 2 for the function.

次に、「参照している関数テーブル」23に格納されて
いる全ての関数名に対し、以下の処理を行う (53〜
S9)。
Next, perform the following processing for all function names stored in the "referenced function table" 23 (53~
S9).

先ず、「参照している関数テーブル」23がら関数名を
1つ取り出し、関数名が終わりであれば処理33〜S9
の処理を終えて処理SIOへ進む。
First, extract one function name from the "referenced function table" 23, and if the function name is the end, go to steps 33 to S9.
After completing the processing, the process proceeds to processing SIO.

終わりでなシナれば、取り出した関数名の関数が既に存
在するか否かを判定しくS5)、存在していれば処理S
7へ進み、存在しなければその関数名の関数識別セルお
よび「参照されている関数テフルjを作成して処理s7
へ進む。次に処理s7において、その関数名の「参照さ
れている関数テーブル」に前記ロートした関数Aの関数
名を格納する。そして、処理S8でその関数名の関数識
別セル中の関数定義エンド丁Jにアドレスが格納されて
いるか否かを判定し、格納されていなければ処理S3に
戻り、格納されていればそのアドレスを前記ロードした
関数Aの関数定義コンパイルドコード2のリテラルチー
フル221こおけるその関数名に対応するエントリに格
納する(S9)。そして、処理S3に戻る。
If it is not the end, determine whether a function with the retrieved function name already exists (S5), and if it does exist, process S5).
Proceed to step 7, and if it does not exist, create the function identification cell of the function name and the "referenced function teful j" and process s7
Proceed to. Next, in process s7, the function name of the rotated function A is stored in the "referenced function table" for that function name. Then, in step S8, it is determined whether an address is stored in the function definition end J in the function identification cell of the function name, and if it is not stored, the process returns to step S3, and if it is stored, the address is It is stored in the entry corresponding to the function name in the literal file 221 of the function definition compiled code 2 of the loaded function A (S9). Then, the process returns to process S3.

以上の53〜S9の処理が関数Bの関数名に対し実行さ
れることにより、関数B用の関数識別セル3にリンクさ
れた「参照されている関数チーフル」34に関数Aの関
数名が登録され、且つ、関数Bが既に存在する場合には
即ち関数Bの関数定義コンパイルドコード4が記憶域に
ロートされている場合には、関数定義エントリ32に格
納されているアドレスが関数Aの関数定義コンパイルト
コ−12のリテラルテーブル22における関数B用エン
トリ221に格納されるごとになる。
By performing the above processes from 53 to S9 on the function name of function B, the function name of function A is registered in the "referenced function title" 34 linked to the function identification cell 3 for function B. and if function B already exists, that is, if the function definition compiled code 4 of function B has been loaded into the storage area, then the address stored in the function definition entry 32 is the function of function A. Each time it is stored in the entry 221 for function B in the literal table 22 of the definition compilation code 12.

次に、処理SlO〜S12においては、「参照されてい
る関数テーブルj14Lこ格納された全ての関数名に対
し、次のような処理が行われる。即ち、′参照されてい
る関数テーブル」14に関数名が登録されている場合、
その関数名の関数定義コンパイルドコードの「参照して
いる関数テーブル」中を呼び出し先の関数名(今回ロー
ドした関数の関数名)でサーチし、見つけた同一関数名
に対応する位置情報の指し示すリテラルテーブル22中
のエントリに、前記ロートした関数Aの関数定義コンパ
イルドコード2のアドレスを格納する。
Next, in processes SlO to S12, the following processing is performed for all function names stored in the ``referenced function table j14L''. If the function name is registered,
Search the "referenced function table" of the function definition compiled code for that function name using the called function name (function name of the function loaded this time), and point to the location information corresponding to the same function name found. The address of the function definition compiled code 2 of the loaded function A is stored in the entry in the literal table 22.

以上のような処理は関数Bの関数定義コンパイルトコー
ト4を記憶域ヘロートする際にも行われる。この結果、
関数Aの関数定義コンパイルドコト2のロート時に関数
Bが未だ存在していなかった場合、関数Bの関数定義コ
ンパビルドコート40ロート時に実行される処理5IO
−312の処理において「参照されている関数テーブル
」34中の関数Aの関数名が処理され、その関数への関
数定義コンパイルドコード2のリテラルチーフル22が
関数名Bでサーチされ、同一関数名(231)に対応す
る位1情91(232)の指し示すリテラルチーフル2
2のエントリ221に、[IBの関数定義コンパイルド
コード4のアドレスが格納されることになる。
The above processing is also performed when the function definition compiled code 4 of function B is moved to the memory area. As a result,
If function B does not exist yet when function A's function definition compile code 2 is loaded, process 5IO executed when function B's function definition compiler build code 40 is loaded.
In the process of -312, the function name of the function A in the "referenced function table" 34 is processed, and the literal character 22 of the function definition compiled code 2 for that function is searched for by the function name B, and the same function Literal full 2 indicated by the place 1 corresponding to the given name (231) 91 (232)
The address of the [IB function definition compiled code 4] is stored in the entry 221 of [IB].

また、関iBの定義が変更された場合、その変更後の関
数Bの関数定義コンパイルトコ−+”4が記憶域ヘロー
トされる場合にも第3図の処理が実行される。よって、
呼び出し元の関数への関数定義コンパイルトコート2に
おける関数B用エンドIJ 221の内容を関数Bの最
新の関数定義コンパイルドコード4のアドレスに一致さ
せることができる。
Furthermore, when the definition of function iB is changed, the process shown in FIG. 3 is also executed when the function definition compilation code +"4 of function B after the change is moved to the storage area. Therefore,
The contents of the end IJ 221 for function B in the function definition compiled code 2 for the calling function can be matched with the address of the latest function definition compiled code 4 of function B.

なお、関数定義がコンパイルされておらずL ISP言
語などのようなソースプログラムのままのリスト形式の
ときは、その定義のリスト形式を解釈部のエハリュエー
タに渡して実行させなければなろない。よって、この場
合はコンパイラは、従来と同様に関数識別セルを経由し
た呼び出し方式が行われるように制御する。即ち、第4
図に示すように、間数Aがソースプログラム形式の関数
りを呼び出す場合、関数りにかかるソースプログラム形
式の関数定義8のアドレスを関数定義エントリ72に保
持する関数り用の関数識別セルフを、関数り用エントリ
223が保持するようにし、関数り呼び出し命令213
はシステムのエハリュエータ9に制御を移すコードとす
るものである。
Note that if the function definition is not compiled and is in a list format as a source program such as in the LISP language, the list format of the definition must be passed to the interpreter of the interpreter for execution. Therefore, in this case, the compiler controls so that the calling method via the function identification cell is performed as in the conventional case. That is, the fourth
As shown in the figure, when the number A calls a function in the source program format, the function identification self for the function that holds the address of the function definition 8 in the source program format related to the function in the function definition entry 72 is The function entry 223 holds the function call instruction 213.
is a code that transfers control to the escalator 9 of the system.

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

以上説明したように、本発明の関数呼び出し方式によれ
ば、関数識別セルを経由することなく成るコンパイルさ
れた関数から別のコンパイルサした関数の最新定義を呼
び出すことが可能となり、関数呼び出しの高速化が実現
できる。
As explained above, according to the function calling method of the present invention, it is possible to call the latest definition of another compiled function from a compiled function without going through the function identification cell, and the function calling method is fast. can be realized.

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

第1図は本発明の一実施例の構成図、 第2図は第1図を簡略化した図、 第3図はコンパイラの処理例の流れ図、第4図はソース
プログラム形式の関数定義を呼び出す場合の構成例を示
す図および、 第5図は従来方式の説明図である。 図において、 1.3,5.7・・・関数識別セル 2.4.6・・・関数定義コンパイルドコード8・・・
ソースプログラム形式の関数定義9・・・システムのエ
バリュエータ 11.31.51・・・関数名エントリ12.32,5
2.72・・・関数定義エントリ13.33.53・・
・参照されている関数テーブルエントリ 14.34.54・・・参照されている関数テーブル2
1・・・機械語命令列 22・・・リテラルテーブル 23・・・参照している関数テーブル 211・・・関数B呼び出し命令 212・・・関数C呼び出し命令 221・・・関数B用エントリ 222・・・関数C用エントリ
Figure 1 is a configuration diagram of an embodiment of the present invention, Figure 2 is a simplified diagram of Figure 1, Figure 3 is a flowchart of an example of compiler processing, and Figure 4 calls a function definition in source program format. FIG. 5 is an explanatory diagram of a conventional system. In the figure, 1.3, 5.7...Function identification cell 2.4.6...Function definition compiled code 8...
Function definition in source program format 9...System evaluator 11.31.51...Function name entry 12.32,5
2.72...Function definition entry 13.33.53...
-Referenced function table entry 14.34.54...Referenced function table 2
1... Machine language instruction sequence 22... Literal table 23... Referenced function table 211... Function B call instruction 212... Function C call instruction 221... Entry for function B 222... ...Entry for function C

Claims (1)

【特許請求の範囲】 関数にかかる関数定義コンパイルドコード中の関数呼び
出し命令をリテラルテーブル中の該当エントリに格納さ
れたアドレス先へ関数識別セルを経由せずに制御を移行
せしめる命令にすると共に、その関数から呼び出される
呼び出し先関数の関数名および該呼び出し先関数に割り
当てたリテラルテーブル中の前記エントリの位置情報と
を保持する「参照している関数テーブル」と、その関数
を呼び出す呼び出し元関数の関数名を保持する「参照さ
れている関数テーブル」とを設け、 関数にかかる関数定義コンパイルドコードを記憶域へロ
ードした際に、 該ロードした関数にかかる「参照している関数テーブル
」に設定された各関数名の呼び出し先関数にかかる「参
照されている関数テーブル」に前記ロードした関数の関
数名を格納すると共にその呼び出し先関数にかかる関数
定義コンパイルドコードの記憶域上のアドレスが確定し
ているときはそのアドレスをリテラルテーブル中のその
呼び出し先関数に対応するエントリに格納し、且つ、前
記ロードした関数にかかる「参照されている関数テーブ
ル」に設定された各関数名の呼び出し元関数にかかる関
数定義コンパイルドコードのリテラルテーブル中の該当
エントリに前記ロードした関数にかかる関数定義コンパ
イルドコードの記憶域上のアドレスを格納するようにし
たことを特徴とする関数呼び出し方式。
[Scope of Claims] A function call instruction in a function definition compiled code related to a function is changed to an instruction for transferring control to an address stored in a corresponding entry in a literal table without going through a function identification cell, A "referenced function table" that holds the function name of the called function called from that function and the position information of the entry in the literal table assigned to the called function, and the calling function that calls that function. A "referenced function table" that holds function names is set up, and when the function definition compiled code for a function is loaded into the storage area, it is set in the "referenced function table" for the loaded function. The function name of the loaded function is stored in the "referenced function table" of the called function of each function name, and the memory address of the function definition compiled code for the called function is determined. If it is, store its address in the entry corresponding to the called function in the literal table, and also check the caller of each function name set in the "referenced function table" related to the loaded function. A function calling method characterized in that an address in a storage area of a function definition compiled code related to the loaded function is stored in a corresponding entry in a literal table of a function definition compiled code related to the function.
JP2008998A 1990-01-18 1990-01-18 Function access system Pending JPH03212738A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008998A JPH03212738A (en) 1990-01-18 1990-01-18 Function access system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008998A JPH03212738A (en) 1990-01-18 1990-01-18 Function access system

Publications (1)

Publication Number Publication Date
JPH03212738A true JPH03212738A (en) 1991-09-18

Family

ID=11708357

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008998A Pending JPH03212738A (en) 1990-01-18 1990-01-18 Function access system

Country Status (1)

Country Link
JP (1) JPH03212738A (en)

Similar Documents

Publication Publication Date Title
US5748963A (en) Adaptive binding
JP2986042B2 (en) Method and apparatus for modifying an object-oriented programming environment
US4712189A (en) Table driven translator
EP0620522A2 (en) High performance dynamic linking through caching
JPH01306923A (en) System for connecting different languages
JP2752094B2 (en) Backtrack processing method in logic language
JPH03212738A (en) Function access system
JPH01277934A (en) Switching system for parameter list reference method
JP2003076558A (en) Method and program for controlling program execution
JPH09282174A (en) Program execution method
JPH07244601A (en) Method and apparatus for accessing relational database
JPS62293434A (en) Branch destination forecasting controlling system
JPH0695868A (en) Software management system
JPS63626A (en) program management device
JPH0784797A (en) Method and apparatus for registering source code line number in load module
JPH0619721A (en) Machine language translation optimizing system
JPH0566949A (en) Calling system for function definition compiled code
HK40120198A (en) Method and apparatus for generating code based on ai, rpa and ai agent, and device
JPH01207824A (en) Module coupling control system
JPS62254237A (en) Inter-printer type branch instruction executing system
Felgentreu et al. Optimiizing Static Scope Lisp by Repetitive Interpretation of Recursive Function Calls
JP2607975B2 (en) Debug method
JPS6227822A (en) Backtrack control system
JPS6375837A (en) Reserved word managing system for maintaining compatibility for addition of reserved word of programming language
JPH0439734A (en) Program language translation processing system