JP2003076558A - Method and program for controlling program execution - Google Patents

Method and program for controlling program execution

Info

Publication number
JP2003076558A
JP2003076558A JP2001267965A JP2001267965A JP2003076558A JP 2003076558 A JP2003076558 A JP 2003076558A JP 2001267965 A JP2001267965 A JP 2001267965A JP 2001267965 A JP2001267965 A JP 2001267965A JP 2003076558 A JP2003076558 A JP 2003076558A
Authority
JP
Japan
Prior art keywords
program
interpreter
information
native
calling
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
JP2001267965A
Other languages
Japanese (ja)
Inventor
Tatsuo Isobe
竜雄 磯部
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.)
Hitachi Software Engineering Co Ltd
Original Assignee
Hitachi Software Engineering 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 Hitachi Software Engineering Co Ltd filed Critical Hitachi Software Engineering Co Ltd
Priority to JP2001267965A priority Critical patent/JP2003076558A/en
Publication of JP2003076558A publication Critical patent/JP2003076558A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To facilitate replacement of native codes in a system that directly executes a native code in place of part of an intermediate code not through an interpreter on an OS without having a dynamic link library function. SOLUTION: The native codes and first and second interface tables 600, 700 are loaded in a native code reservation area in a memory and after that, an operation of the interpreter is started. The table 600 stores information for calling the native code 110 from the interpreter 120 and the table 700 stores information for calling a library function intrinsic to the interpreter or the interpreter. When the native codes are replaced, the table 600 is also replaced with an updated table. In addition, storage positions of the tables 600, 700 are fixed positions.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、ソースプログラム
の一部をコンパイルして得られる中間コード部分と前記
ソースプログラムの他の部分をコンパイルして得られ、
インタプリタを介しないでコンピュータにより直接実行
される複数のネイティブ化されたプログラム部分とを含
むプログラムの実行制御方法及びそのようなプログラム
のためのプログラム実行制御プログラムに関する。
The present invention is obtained by compiling an intermediate code part obtained by compiling a part of a source program and another part of the source program,
The present invention relates to a program execution control method including a plurality of nativeized program parts directly executed by a computer without passing through an interpreter, and a program execution control program for such a program.

【0002】[0002]

【従来の技術】ソースプログラムのコンパイル及び実行
に関しては、同じソースプログラムを異なるアーキテク
チャを有するコンピュータ上で実行できるようにするた
めに、ソースプログラムを中間コードにコンパイルし、
得られた中間コードをそれぞれのコンピュータ用に準備
されたインタプリタにより解釈実行する方法が採られて
いる。すなわち、中間コードに含まれた複数の命令の各
々をインタプリタにより逐次解釈して、当該中間コード
を、使用中のコンピュータ上で実行可能な機械語命令で
あるネイティブコードに逐次変換して実行する。
2. Description of the Related Art With respect to compiling and executing a source program, the source program is compiled into intermediate code so that the same source program can be executed on a computer having a different architecture.
A method is adopted in which the obtained intermediate code is interpreted and executed by an interpreter prepared for each computer. That is, each of a plurality of instructions included in the intermediate code is sequentially interpreted by an interpreter, the intermediate code is sequentially converted into a native code that is a machine language instruction that can be executed on a computer in use, and then executed.

【0003】しかしながら、このようなインタプリタを
用いるプログラム実行制御方法では、中間コードを逐次
解釈実行するので、中間コードの実行に時間が掛かる。
そのため、ソースプログラムのうち実行時間を短くした
い部分、すなわち高速化したい中間コードの部分をあら
かじめネイティブなオブジェクトコード(以下、ネイテ
ィブコードと呼ぶことがある)に変換しておき、上記一
部の中間コードに代えてネイティブコードを実行する方
法が採られることもある。
However, in the program execution control method using such an interpreter, since the intermediate code is sequentially interpreted and executed, it takes time to execute the intermediate code.
Therefore, the part of the source program whose execution time you want to shorten, that is, the part of the intermediate code that you want to speed up, is converted into native object code (hereinafter sometimes referred to as native code) in advance, and the part of the intermediate code above is converted. Alternatively, a method of executing native code may be adopted.

【0004】[0004]

【発明が解決しようとする課題】このような中間コード
とネイティブコードとの組合せからなるプログラムを使
用すると、ネイティブコードを使用しない場合よりプロ
グラムの実行速度が速まるが、逆にいくつかの問題が生
じる。例えば、マイコンシステム分野で一般に使用され
るリアルタイムオペレーションシステム(リアルタイム
OS)のもとでは、ネイティブコードを、新たなネイテ
ィブコード、例えば改良したネイティブコードにより置
換(リプレース)したい場合、ネイティブコードの置換
を行うだけでは済まず、このためネイティブコードの置
換が容易でないという問題がある。
When a program consisting of such a combination of intermediate code and native code is used, the execution speed of the program is faster than when the native code is not used, but on the contrary, some problems occur. . For example, under a real-time operating system (real-time OS) generally used in the field of microcomputer systems, when it is desired to replace a native code with a new native code, for example, an improved native code, the native code is replaced. There is a problem that replacement of native code is not easy because of this.

【0005】すなわち、ネイティブコードと中間コード
との組をインタプリタにより実行可能にするためには、
インタプリタによりネイティブコードを呼び出せるよう
にする必要がある。一般に異なるプログラム単位を動的
にリンクするためのツールとしてダイナミックリンクラ
イブラリをOSが提供している場合、いずれかのプログ
ラムを更新した場合でも、更新後のプログラム単位を他
のプログラム単位が容易に呼び出すことができる。すな
わち、呼び出し元のプログラム単位が呼び出し先の更新
されたプログラム単位を指定してダイナミックリンクラ
イブラリを呼び出すだけで、当該更新後のプログラム単
位が更新の有無に関係なく呼び出される。
That is, in order to make a set of native code and intermediate code executable by the interpreter,
You need to be able to call native code by the interpreter. In general, when the OS provides a dynamic link library as a tool for dynamically linking different program units, even if any program is updated, another program unit easily calls the updated program unit. be able to. That is, the calling program unit simply calls the dynamic link library by designating the updated program unit of the call destination, and the updated program unit is called regardless of whether the updated program unit is updated.

【0006】呼び出し元のプログラム単位は、呼び出し
先のプログラム単位に割り当てられる、主記憶メモリ
(実メモリ)内の領域のメモリアドレスを知る必要はな
い。今の例では、インタプリタ内に、中間コードで記述
された命令を中間コードとして解釈して実行するのか、
当該命令用に用意されたネイティブコードを実行するの
かを判別する仕組みを作っておき、判別の結果後者と判
断された場合には、実行すべきネイティブコードをイン
タプリタにより指定してダイナミックリンクライブラリ
を呼び出せばよい。ダイナミックリンクライブラリは、
呼び出し先のプログラム単位をメモリにロードし、呼び
出し元のプログラム単位にリンクして実行する。
The calling program unit does not need to know the memory address of the area in the main memory (real memory) assigned to the calling program unit. In this example, whether the instructions written in the intermediate code are interpreted and executed as intermediate code in the interpreter,
Create a mechanism to determine whether to execute the native code prepared for the instruction, and if the result of the determination is the latter, call the dynamic link library by specifying the native code to be executed by the interpreter. Good. The dynamic link library is
Loads the called program unit into memory and links to the calling program unit for execution.

【0007】しかし、マイコンシステム分野で一般に使
用されるリアルタイムOSの大部分は、ダイナミックリ
ンクライブラリをサポートしていない。ダイナミックリ
ンクライブラリをサポートしていないOSのもとでは、
静的なリンクが使用される。今の場合には、インタプリ
タとネイティブコードとが静的にリンクされて一つのロ
ードモジュールが生成され、メモリにロードされて実行
される。
However, most of the real-time OSs generally used in the microcomputer system field do not support the dynamic link library. Under an OS that does not support the dynamic link library,
Static links are used. In the present case, the interpreter and the native code are statically linked to generate one load module, which is loaded into the memory and executed.

【0008】一般に静的なリンクによりリンクされたプ
ログラム単位間では、呼び出し元のプログラム単位は、
呼び出し先のプログラム単位に割り当てられたメモリ上
のアドレスをあらかじめ知ることができ、呼び出し先の
プログラム単位を実際に呼び出すときには、このメモリ
アドレスを利用して呼び出しを実行することができる。
したがって、インタプリタとネイティブコードとを静的
にリンクして一つのロードモジュールを生成した場合、
インタプリタとネイティブコードが互いに相手を呼び出
すことは容易である。
Generally, among program units linked by static linking, the calling program unit is
The address on the memory assigned to the called program unit can be known in advance, and when actually calling the called program unit, the call can be executed by using this memory address.
Therefore, if you statically link the interpreter and native code to generate one load module,
It is easy for the interpreter and native code to call each other.

【0009】しかし、インタプリタとネイティブコード
を静的にリンクした場合、ネイティブコードが新たなネ
イティブコードに変更されたときには、メモリにロード
されたネイティブコードを新たなネイティブコードによ
り置換するだけではだめであり、再度元のインタプリタ
と新たなネイティブコードとを静的にリンクし直して新
たな一つのロードモジュールを生成してメモリにロード
する必要がある。
However, when the interpreter and the native code are statically linked, when the native code is changed to the new native code, it is not enough to replace the native code loaded in the memory with the new native code. , It is necessary to statically relink the original interpreter and the new native code again to generate a new load module and load it into the memory.

【0010】このように、通常のリアルタイムOSの多
くについては、ネイティブコードと中間コードとの組を
インタプリタにより実行させる場合に、インタプリタと
ネイティブコードを静的にリンクして実行する従来のプ
ログラム実行制御方法では、ネイティブコードを新たな
ネイティブコードによりリプレースすることが容易でな
いという問題がある。
As described above, in most ordinary real-time OSs, when a set of native code and intermediate code is executed by the interpreter, the conventional program execution control for statically linking and executing the interpreter and the native code is executed. The method has a problem that it is not easy to replace the native code with new native code.

【0011】したがって、本発明の目的は、ダイナミッ
クリンクライブラリの機能を持たないOS上で中間コー
ドをインタプリタにより逐次解釈させて実行するととも
に高速化のために中間コードの一部に代えてネイティブ
コードをインタプリタを介さないでコンピュータ上で直
接実行させる場合にも、ネイティブコードのリプレース
を容易にするプログラム実行制御方法及び実行制御プロ
グラムを提供することである。
Therefore, an object of the present invention is to allow an interpreter to sequentially interpret and execute intermediate code on an OS that does not have the function of a dynamic link library, and to improve the speed, replace the native code with a part of the intermediate code. To provide a program execution control method and an execution control program that facilitate replacement of a native code even when it is directly executed on a computer without passing through an interpreter.

【0012】[0012]

【課題を解決するための手段】本発明に係るプログラム
実行制御方法は、ソースプログラムの一部をコンパイル
して得られる中間コード部分と前記ソースプログラムの
他の部分をコンパイルして得られるネイティブ化された
複数のプログラム部分とを含むプログラムのうち前記中
間コード部分をインタプリタにより解釈して実行し、前
記複数のネイティブ化されたプログラム部分の各々を前
記インタプリタを介しないでコンピュータにより直接実
行するプログラムの実行制御方法であって、前記複数の
ネイティブ化されたプログラム部分が主記憶メモリ内の
所定のネイティブコード専用領域内に記憶され、それぞ
れのネイティブ化された複数のプログラム部分を呼び出
すための情報を記憶したインタフェーステーブルが前記
ネイティブコード専用領域内の所定の位置に記憶された
状態で、前記中間コード部分の実行を開始し、前記中間
コード部分内の次に実行すべき命令に対応するネイティ
ブ化されたプログラム部分が前記複数のネイティブ化さ
れたプログラム部分に含まれているとき、当該対応する
ネイティブ化されたプログラム部分を呼び出すための情
報を前記インタフェーステーブルから前記インタプリタ
により読み出し、読み出された情報を使用して前記対応
するネイティブ化されたプログラム部分を前記インタプ
リタにより呼び出す、ステップを含むものである。
A program execution control method according to the present invention is a native program obtained by compiling an intermediate code part obtained by compiling a part of a source program and another part of the source program. A program including a plurality of program parts, the intermediate code part being interpreted and executed by an interpreter, and each of the plurality of native program parts being directly executed by a computer without passing through the interpreter. A control method, wherein the plurality of native program parts are stored in a predetermined area dedicated to native code in a main memory, and information for calling each native program part is stored. The interface table is the native code The execution of the intermediate code portion is started in a state of being stored at a predetermined position in the use area, and the nativeized program portion corresponding to the instruction to be executed next in the intermediate code portion is the plurality of natives. When included in a localized program part, the information for calling the corresponding nativeized program part is read by the interpreter from the interface table, and the corresponding nativeization is performed using the read information. The step of calling the executed program part by the interpreter is included.

【0013】これにより、中間コード部分内のつぎに実
行すべき命令に対応するネイティブ化されたプログラム
部分が存在するとき、当該命令として、そのネイティブ
化されたプログラム部分がインタプリタを介さないでコ
ンピュータにより直接実行される。後にネイティブ化さ
れた複数のプログラム部分の一部あるいは全部が変更さ
れた場合には、上記インタフェーステーブルの内容を、
変更後のネイティブ化されたプログラム部分に適応して
更新し、上記変更後の複数のネイティブ化されたプログ
ラム部分を上記ネイティブコード専用領域内にロード
し、更に変更後のインタフェーステーブルを上記ネイテ
ィブコード専用領域内の上記所定の位置にロードすれ
ば、上記インタプリタは、上記変更後のインタフェース
テーブルを読み出すことができ、このインタフェーステ
ーブル内の変更後の情報を利用して、上記複数のネイテ
ィブ化されたプログラム部分の変更にも拘わらず、上記
変更後の複数のネイティブ化されたプログラム部分のう
ちの任意のものを呼び出すことができる。
As a result, when there is a nativeized program part corresponding to the next instruction to be executed in the intermediate code part, the nativeized program part can be used as the instruction by the computer without passing through the interpreter. Directly executed. If some or all of the multiple natively converted program parts are changed later, change the contents of the above interface table to
Adapting and updating the modified native program parts, loading the modified multiple native program parts into the native code dedicated area, and further modifying the interface table dedicated to the native code The interpreter can read the modified interface table by loading it at the predetermined position in the area, and the modified information in the interface table can be used to read the plurality of native programs. Despite the modification of the part, any of the modified native program parts can be called.

【0014】望ましくは、前記プログラムの実行開始ス
テップは、前記インタプリタ内に設けられた複数の固有
のプログラム部分のそれぞれをいずれかのネイティブ化
されたプログラム部分から呼び出すための情報を記憶し
た他のインタフェーステーブルが前記ネイティブコード
専用領域内の所定の位置に記憶された状態でプログラム
の実行を開始し、前記プログラム実行制御方法は、前記
複数のネイティブ化されたプログラム部分のいずれかが
実行中に、前記複数の固有のプログラム部分のいずれか
を呼び出すための情報を当該実行中のネイティブ化され
たプログラム部分により前記他のインタフェーステーブ
ルから読み出し、読み出された情報を使用して前記いず
れかの固有のプログラム部分を前記実行中のネイティブ
化されたプログラム部分から呼び出す、ステップを更に
含むことである。
Preferably, the execution start step of the program stores another interface for storing information for calling each of the plurality of unique program parts provided in the interpreter from any of the native program parts. The execution of the program is started in a state where the table is stored in a predetermined position in the native code dedicated area, and the program execution control method is characterized in that, while any one of the plurality of nativeized program parts is executing, Information for calling one of a plurality of unique program parts is read from the other interface table by the running nativeized program part, and the read information is used to read the unique program. Portion the running nativeized program Calling from the portion is to further comprise a step.

【0015】これにより、いずれかのネイティブ化され
たプログラム部分が実行されているときに、当該プログ
ラム部分からインタプリタ内の固有のプログラム部分を
呼び出すことができ、ネイティブ化されたプログラム部
分からインタプリタに設けられたプログラム資源を利用
可能になる。
With this, when any of the nativeized program parts is being executed, a unique program part in the interpreter can be called from the program part, and the nativeized program part is provided in the interpreter. Available program resources.

【0016】更に望ましくは、前記他のインタフェース
テーブルは、いずれかのネイティブ化されたプログラム
部分から前記インタプリタを呼び出すための情報を更に
格納しているテーブルであり、前記プログラム実行制御
方法は、前記複数のネイティブ化されたプログラム部分
のいずれかが実行中に、前記インタプリタを呼び出すた
めの情報を、当該実行中のプログラム部分により前記他
のインタフェーステーブルから読み出し、前記インタプ
リタに関して読み出された前記情報を使用して前記イン
タプリタを前記実行中のネイティブ化されたプログラム
部分から呼び出す、ステップを更に含むことである。
More preferably, the other interface table is a table further storing information for calling the interpreter from any of the nativeized program parts, and the program execution control method is the plurality of the plurality of interface tables. Information for calling the interpreter during execution of any of the native program parts of the program is read from the other interface table by the executing program part, and the information read for the interpreter is used. And then calling the interpreter from the running nativeized program portion.

【0017】これにより、いずれかのネイティブ化され
たプログラム部分が実行されているときに、当該プログ
ラム部分からインタプリタを呼び出し、処理を依頼する
ことができ、ネイティブ化されたプログラム部分が、イ
ンタプリタというプログラム資源を利用することが可能
になる。
As a result, when any of the native program parts is being executed, it is possible to call an interpreter from the program part and request processing, and the native program part is a program called an interpreter. Resources can be used.

【0018】[0018]

【発明の実施の形態】以下、本発明に係るプログラム実
行制御方法及びプログラム実行制御プログラムの一つの
実施形態を図面を参照して具体的に説明する。
BEST MODE FOR CARRYING OUT THE INVENTION One embodiment of a program execution control method and a program execution control program according to the present invention will be specifically described below with reference to the drawings.

【0019】図1は、中間コードとネイティブコードと
の組合せからなるアプリケーションプログラムを生成す
る過程の一例を示す図である。まず、ソースプログラム
10を中間コードコンパイラ20によりコンパイルして
インタプリタ120で実行可能な中間コード30を生成
する。ソースプログラム10は、複数のモジュール10
A、10B、10C、…を含み、中間コード30には、
各モジュールに対応する中間コード30A、30B、3
0C、…が含まれる。
FIG. 1 is a diagram showing an example of a process of generating an application program including a combination of an intermediate code and a native code. First, the source program 10 is compiled by the intermediate code compiler 20 to generate the intermediate code 30 that can be executed by the interpreter 120. The source program 10 includes a plurality of modules 10
A, 10B, 10C, ...
Intermediate code 30A, 30B, 3 corresponding to each module
0C, ... are included.

【0020】近年、ソースプログラムとしては、取り扱
う様々な対象を共通の性質に着目してひとまとめにして
取り扱うことに適したオブジェクト指向プログラム言語
で記述されたプログラムが使用されることが多い。この
言語で記述されたソースプログラムにおいては、いろい
ろな対象物を示すオブジェクトをクラスとして定義す
る。クラスはオブジェクトを抽象化した概念である。ク
ラスの定義には、各種データの定義と、各種の処理内容
を定めるメソッドの定義とが含まれる。本実施の形態で
も、ソースプログラム10は、オブジェクト指向プログ
ラム言語で書かれていると仮定する。
In recent years, as a source program, a program written in an object-oriented programming language, which is suitable for handling various objects to be handled collectively by paying attention to a common property, is often used. In a source program written in this language, objects representing various objects are defined as classes. A class is a concept that abstracts objects. The definition of the class includes the definition of various data and the definition of the method that defines various processing contents. Also in this embodiment, it is assumed that the source program 10 is written in an object-oriented programming language.

【0021】システム設計者あるいは他の関係者が、得
られた中間コード30のうち高速化したい部分を適当な
方法により決定する。高速化したい部分は、アプリケー
ションプログラムの実行性能のネックになっている部分
であり、その部分を高速化すれば、アプリケーションプ
ログラムの全体性能が向上するという部分である。この
ような高速化したい中間コード部分を選択する方法は既
に知られているとおりである。ここでは、例えば中間コ
ード部分30Aが高速化したい中間コードと仮定する。
高速化したい中間コード部分30Aには、複数のメソッ
ドが含まれていると仮定する。
The system designer or another person concerned determines the portion of the obtained intermediate code 30 to be speeded up by an appropriate method. The part to be speeded up is the part that becomes the bottleneck in the execution performance of the application program, and the speeding up of that part improves the overall performance of the application program. A method for selecting such an intermediate code portion to be speeded up is already known. Here, for example, it is assumed that the intermediate code portion 30A is an intermediate code that is desired to be speeded up.
It is assumed that the intermediate code portion 30A to be accelerated includes a plurality of methods.

【0022】中間コード部分30Aを中間コード変換コ
ンパイラ40によってコンパイルして対応する高級言語
プログラム50を生成する。中間コード変換コンパイラ
40は、高速化したい中間コード部分30Aのコンパイ
ル結果として、高級言語プログラム50の他に第1、第
2のインタフェーステーブル60、70も生成するよう
に構成されている。
The intermediate code portion 30A is compiled by the intermediate code conversion compiler 40 to generate a corresponding high level language program 50. The intermediate code conversion compiler 40 is configured to generate the first and second interface tables 60 and 70 in addition to the high-level language program 50 as a compilation result of the intermediate code portion 30A to be speeded up.

【0023】ここで、高級言語プログラム50を記述す
る高級プログラム言語は、ソースプログラム10を記述
する高級プログラム言語とは異なると仮定しているが、
高級言語プログラム50を記述する高級プログラム言語
がソースプログラム10を記述する高級プログラム言語
とは同じであってもよい。例えば、高級言語プログラム
50を記述する高級プログラム言語はC又はC++であ
り、ソースプログラム10を記述するプログラム言語
は、他のプログラム言語でもよく、あるいは同じプログ
ラム言語でもよい。
It is assumed here that the high-level programming language that describes the high-level language program 50 is different from the high-level programming language that describes the source program 10.
The high-level programming language that describes the high-level language program 50 may be the same as the high-level programming language that describes the source program 10. For example, the high-level programming language that describes the high-level language program 50 is C or C ++, and the programming language that describes the source program 10 may be another programming language or the same programming language.

【0024】なお、第1、第2のインタフェーステーブ
ル60と70をそれぞれネイティブコードインタフェー
ステーブル、インタプリタアプリケーションプログラム
インタフェーステーブルと呼ぶことがある。第1、第2
のインタフェーステーブル60、70については後に説
明する。後に説明するように、第1、第2のインタフェ
ーステーブル60、70に格納されるべき複数の情報の
うち一部の情報(メモリアドレス)は、これらのテーブ
ルの生成時には決定されず、後に説明する、ネイティブ
リンカ100によるリンク時に決定される。
The first and second interface tables 60 and 70 may be referred to as a native code interface table and an interpreter application program interface table, respectively. First, second
The interface tables 60 and 70 will be described later. As will be described later, some information (memory address) of the plurality of information to be stored in the first and second interface tables 60 and 70 is not determined when these tables are generated, and will be described later. , Is determined at the time of linking by the native linker 100.

【0025】得られた高級言語プログラム50をネイテ
ィブコンパイラ80によりコンパイルしてオブジェクト
モジュール90を生成し、更に第1、第2のインタフェ
ーステーブル60、70を同じネイティブコンパイラ8
0によりコンパイルして対応する二つのオブジェクトモ
ジュール60A、70Aを生成する。
The obtained high-level language program 50 is compiled by the native compiler 80 to generate the object module 90, and the first and second interface tables 60 and 70 are set to the same native compiler 8.
Compile with 0 to generate two corresponding object modules 60A and 70A.

【0026】以下では、第1のインタフェーステーブル
60から得られたオブジェクトモジュール60Aを簡単
化のために第1のインタフェーステーブルあるいは第1
のオブジェクトモジュール化されたインタフェーステー
ブルと呼び、あるいはネイティブコードインタフェース
テーブルあるいはオブジェクトモジュール化されたネイ
ティブコードインタフェーステーブルと呼ぶことがあ
る。同様に、第2のインタフェーステーブル70から得
られたオブジェクトモジュール70Aも簡単化のために
第2のインタフェーステーブルあるいは第2のオブジェ
クトモジュール化されたインタフェーステーブルと呼
び、あるいはインタプリタアプリケーションプログラム
インタフェーステーブルあるいはオブジェクトモジュー
ル化されたインタプリタアプリケーションプログラムイ
ンタフェーステーブルと呼ぶことがある。
In the following, in order to simplify the object module 60A obtained from the first interface table 60, the first interface table or the first interface table
In some cases, it is referred to as an object modularized interface table of, or a native code interface table or an object modularized native code interface table. Similarly, the object module 70A obtained from the second interface table 70 is also called the second interface table or the second object modularized interface table for simplification, or the interpreter application program interface table or the object module. It may be called a computerized interpreter application program interface table.

【0027】得られたオブジェクトモジュール90及び
オブジェクトモジュール化された第1,第2のインタフ
ェーステーブル60A、70Aをネイティブリンカ10
0によりリンクしてネイティブコード110を生成す
る。このとき、オブジェクトモジュール90に含まれた
複数のメソッドは、オブジェクトモジュール化されたイ
ンタフェーステーブル60A,70Aと静的にリンクさ
れる。
The obtained object module 90 and the object module-formed first and second interface tables 60A and 70A are stored in the native linker 10.
Link with 0 to generate native code 110. At this time, the plurality of methods included in the object module 90 are statically linked to the object moduleized interface tables 60A and 70A.

【0028】得られたネイティブコード110には、高
速化したい中間コード部分30A、に含まれた複数のメ
ソッドに対応する複数のネイティブコード部分110
A、110B、…と第1、第2のインタフェーステーブ
ル60、70に対応する第1、第2のネイティブコード
化されたインタフェーステーブル600、700とが含
まれる。以下では、高速化したい中間コード部分30A
に含まれた複数のメソッドに対応するネイティブコード
部分110A、110B、…を単にネイティブメソッド
と呼ぶことがある。またネイティブコード化された第
1、第2のインタフェーステーブル600、700のい
ずれをも簡単化のために第1、第2のインタフェーステ
ーブルあるいは第1、第2のネイティブインタフェース
テーブルと呼ぶことがある。また、ネイティブコード化
されたインタフェーステーブル600、700をそれぞ
れネイティブコードインタフェーステーブル、インタプ
リタアプリケーションプログラムインタフェーステーブ
ルと呼ぶこともある。
The obtained native code 110 includes a plurality of native code portions 110 corresponding to a plurality of methods included in the intermediate code portion 30A to be speeded up.
A, 110B, ... And first and second natively coded interface tables 600, 700 corresponding to the first and second interface tables 60, 70 are included. In the following, the intermediate code part 30A that you want to speed up
The native code portions 110A, 110B, ... Corresponding to the plurality of methods included in the above may be simply referred to as native methods. Also, the natively coded first and second interface tables 600 and 700 may be referred to as first and second interface tables or first and second native interface tables for simplification. Also, the natively coded interface tables 600 and 700 may be referred to as a native code interface table and an interpreter application program interface table, respectively.

【0029】なお、インタプリタ120とネイティブコ
ード110は、切り替えながら実行されるので、ネイテ
ィブコンパイラ80やネイティブリンカ100は、イン
タプリタ120のビルド時(すなわち、インタプリタ1
20のソースプログラムをコンパイルし、得られたオブ
ジェクトモジュールをリンクしてインタプリタとして使
用するロードモジュールを生成する時)に使用されるも
のと同じものを使用する。
Since the interpreter 120 and the native code 110 are executed while being switched, the native compiler 80 and the native linker 100 are executed when the interpreter 120 is built (that is, the interpreter 1).
Compile 20 source programs and link the resulting object modules to produce a load module for use as an interpreter).

【0030】こうして、ソースプログラム10に対応す
る中間コード30と、ネイティブコード110が生成さ
れる。ネイティブコード110には、中間コード30の
うちの高速化すべき部分に対応する複数のプログラム部
分(ここでは複数のネイティブメソッド)110A、1
10Bと二つのインタフェーステーブル60、70に対
応する二つのネイティブ化されたインタフェーステーブ
ル600、700が含まれる。
Thus, the intermediate code 30 corresponding to the source program 10 and the native code 110 are generated. The native code 110 includes a plurality of program parts (here, a plurality of native methods) 110A, 1A corresponding to the part of the intermediate code 30 to be accelerated.
10B and two nativeized interface tables 600, 700 corresponding to the two interface tables 60, 70 are included.

【0031】なお、ここではネイティブ化されたプログ
ラム部分110A、110Bと、ネイティブ化されたイ
ンタフェーステーブル600、700をまとめてネイテ
ィブコードと呼んでいる。しかし、以下の説明において
は、ネイティブ化されたインタフェーステーブル60
0、700を含めないでネイティブ化されたプログラム
部分110A、110Bの両方若しくは一方をネイティ
ブコードと呼ぶことがある。特に、ネイティブプログラ
ムのリプレースに言及するときには、ネイティブコード
は、ネイティブ化されたプログラム部分を指す。
The native program parts 110A and 110B and the native interface tables 600 and 700 are collectively referred to as native code. However, in the following description, the nativeized interface table 60
Either or both of the program parts 110A and 110B that are nativeized without including 0 and 700 may be referred to as native code. In particular, when referring to the replacement of a native program, native code refers to the part of the program that has been nativeized.

【0032】ネイティブ化されたインタフェーステーブ
ル600と700、特にインタフェーステーブル600
は、ネイティブ化されたプログラム部分、例えば100
A又は100Bをリプレースしたときでも、新たなネイ
ティブ化されたプログラム部分をインタプリタが呼び出
すためのデータを保持するテーブルであって、リプレー
ス対象のプログラム部分ではないからである。
Nativeized interface tables 600 and 700, especially interface table 600
Is the nativeized program part, eg 100
This is because even when A or 100B is replaced, it is a table that holds data for the interpreter to call a new native program part, and is not the program part to be replaced.

【0033】後に詳細に説明するように、中間コード3
0のうち高速化対象部分30A以外の部分30B、30
Cは、インタプリタ120により逐次解釈して実行され
る。また高速化対象部分30Aの実行については、ネイ
ティブコード110内のプログラム部分、例えばネイテ
ィブメソッド110A、110Bがインタプリタ120
により呼び出されて、インタプリタ120による解釈実
行を受けないで、コンピュータにより直接実行される。
Intermediate code 3, as will be described in detail later.
0 parts 30B and 30 other than the speed-up target part 30A
The C is sequentially interpreted and executed by the interpreter 120. Regarding the execution of the acceleration target portion 30A, the program portion in the native code 110, for example, the native methods 110A and 110B is executed by the interpreter 120.
And is executed directly by the computer without being interpreted and executed by the interpreter 120.

【0034】第1のインタフェーステーブル600は、
インタプリタ120がネイティブコード110内の複数
のプログラム部分、例えば複数のメソッド110A、1
10Bのうちの任意のメソッドを呼び出すために設けら
れ、インタプリタ120により参照される。第2のイン
タフェーステーブル700は、ネイティブコード110
内のプログラム部分、例えばネイティブメソッド110
Aが実行されている状態で、当該ネイティブメソッド1
10Aが、インタプリタ120用のプログラムリソース
を利用可能にするために設けられている。なお、このよ
うなプログラムリソースの利用を可能にするためには、
インタプリタ120とは別にスイッチングモジュール1
30があらかじめ準備され、第2のインタフェーステー
ブル700は、スイッチングモジュール130により参
照される。
The first interface table 600 is
The interpreter 120 includes a plurality of program parts in the native code 110, for example, a plurality of methods 110A, 1
It is provided to call any method of 10B and is referenced by the interpreter 120. The second interface table 700 includes the native code 110.
Program part inside, eg native method 110
With A being executed, the native method 1
10A is provided to make program resources available for interpreter 120. In order to enable the use of such program resources,
Switching module 1 separate from interpreter 120
30 is prepared in advance, and the second interface table 700 is referred to by the switching module 130.

【0035】インタプリタ用のプログラムリソースの例
は、インタプリタ120内に設けられたインタプリタ固
有のプログラムであり、例えば、インタプリタ120内
に定義されたライブラリ関数である。ライブラリ関数の
例は、文字列の検索あるいは文字から数値への変換など
である。以下では、このようなインタプリタ120に固
有のプログラムを固有メソッドと呼ぶことにする。ネイ
ティブメソッド110Aがこのような固有メソッドを利
用したいときには、スイッチングモジュール130を呼
び出し、スイッチングモジュール130が、当該ネイテ
ィブメソッド110Aが指定した固有メソッドを第2の
インタフェーステーブル700を利用して呼び出す。
An example of the program resource for the interpreter is a program specific to the interpreter provided in the interpreter 120, for example, a library function defined in the interpreter 120. Examples of library functions are searching strings or converting characters to numbers. Hereinafter, such a program unique to the interpreter 120 will be referred to as a unique method. When the native method 110A wants to use such a unique method, the switching module 130 is called, and the switching module 130 calls the unique method designated by the native method 110A using the second interface table 700.

【0036】第2のインタフェーステーブル700は、
当該実行中のネイティブメソッド110Aが、インタプ
リタ120自身を呼び出し可能にするためにも使用され
ている。例えば、インタプリタに中間コードにより記述
されたメソッド(以下、簡単化のために中間コードメソ
ッドと呼ぶことがある)の実行を要求したいとき、当該
実行中のネイティブメソッド110Aは、インタプリタ
120を呼び出し、当該中間コードメソッドの呼び出し
を要求することができる。このメソッドはインタプリタ
120により解読して実行される。
The second interface table 700 is
The executing native method 110A is also used to make the interpreter 120 itself callable. For example, when it is desired to request the interpreter to execute a method described in the intermediate code (hereinafter, may be referred to as an intermediate code method for simplification), the executing native method 110A calls the interpreter 120, You can request calls to intermediate code methods. This method is decoded and executed by the interpreter 120.

【0037】図2は、本実施の形態でのアプリケーショ
ンプログラムの実行時における種々のプログラムに割り
当てられる、主記憶メモリ(実メモリ)内のメモリ領域
を示す図である。メモリには、OS領域210、インタ
プリタ領域220、ネイティブコードリザーブ領域23
0、中間コード展開領域240、中間コード用スタック
領域250が設けられる。ネイティブコードを利用しな
いで全ての中間コードをインタプリタで解釈実行する場
合には、領域230以外の領域210、220、24
0、250のみが使用される。
FIG. 2 is a diagram showing a memory area in the main memory (real memory) that is assigned to various programs when the application program is executed in this embodiment. The memory includes an OS area 210, an interpreter area 220, and a native code reserve area 23.
0, an intermediate code expansion area 240, and an intermediate code stack area 250 are provided. When interpreting and executing all the intermediate codes by the interpreter without using the native code, areas 210, 220, 24 other than the area 230 are used.
Only 0,250 are used.

【0038】本実施の形態では、ネイティブコードのリ
プレースを可能にするために、ネイティブコード専用領
域としてネイティブコードリザーブ領域230が設けら
れる。ネイティブコードのリプレースを実現するため
に、ネイティブコードリザーブ領域230は、まず、リ
アルタイムオペレーションシステムによって他の用途の
ためにつぶされないようにあらかじめ予約される。この
ためには、例えば、ネイティブコードリザーブ領域23
0は、インタプリタが動作を開始する前に、例えばイン
タプリタ領域220の直下に確保されるようにする。更
に、その後にOSにより確保される他の領域をネイティ
ブコードリザーブ領域230より下方のアドレス領域と
するのが簡便である。
In this embodiment, a native code reserve area 230 is provided as a native code dedicated area in order to enable replacement of the native code. To implement native code replacement, the native code reserve area 230 is first reserved in advance by the real-time operating system so as not to be crushed for other uses. For this purpose, for example, the native code reserve area 23
The value 0 is secured, for example, immediately below the interpreter area 220 before the interpreter starts its operation. Further, it is convenient to use another area secured by the OS thereafter as an address area below the native code reserve area 230.

【0039】ネイティブコードのリプレースを実現する
ために新に設けられたスイッチングモジュール130に
も、インタプリタ領域220内の領域が割り当てられ
る。インタプリタ固有のメソッド、例えば140にもイ
ンタプリタ領域220内の領域が割り当てられる。実際
には、インタプリタ120は、通常は複数の固有メソッ
ドを使用するが図では簡単化のために一つの固有メソッ
ド140のみが示されている。
The area in the interpreter area 220 is also allocated to the switching module 130 newly provided to realize the replacement of the native code. An area in the interpreter area 220 is also allocated to a method specific to the interpreter, for example, 140. In practice, interpreter 120 typically uses multiple native methods, but only one native method 140 is shown in the figure for simplicity.

【0040】ネイティブコードリザーブ領域230はネ
イティブコード110に割り当てられる。すなわち、ネ
イティブコード110に含まれネイティブ化されたプロ
グラム部分110A、110Bと、ネイティブ化された
第1、第2のインタフェーステーブル600、700に
もこの領域が割り当てられる。
The native code reserve area 230 is assigned to the native code 110. That is, this area is also allocated to the program parts 110A and 110B which are included in the native code 110 and are made native, and the first and second interface tables 600 and 700 which are made native.

【0041】図3は、第1のインタフェーステーブル6
0の例を示す図である。第1のインタフェーステーブル
60は、ネイティブ化された複数のプログラム単位、例
えば複数のメソッドの各々に対して3つのフィールド6
1から63を保持している。フィールド61には、ネイ
ティブコード化したメソッドの名称つまり関数の名称が
格納される。Cプログラム言語的に説明するならば、関
数の名称を示す文字列がこのフィールドにチェインされ
る。フィールド62にはそのメソッドの引数情報を示す
文字列がチェインされる。引数情報は、そのメソッドを
呼び出すのに使用する引数の総数、各引数の型などその
メソッドの引数に関する制約条件を指定する情報であ
る。フィールド63には実際にそのメソッドのネイティ
ブコードを格納しているメモリアドレスが格納される。
このメモリアドレスは、当該メソッドを呼び出すときの
入り口アドレスを示している。
FIG. 3 shows the first interface table 6
It is a figure which shows the example of 0. The first interface table 60 has three fields 6 for each of a plurality of program units that have been made native, for example, a plurality of methods.
Holds 1 to 63. The field 61 stores the name of the method that has been natively coded, that is, the name of the function. In the C programming language, a character string indicating the name of the function is chained in this field. In the field 62, a character string indicating the argument information of the method is chained. The argument information is information that specifies constraint conditions regarding the arguments of the method such as the total number of arguments used to call the method and the type of each argument. The field 63 stores the memory address that actually stores the native code of the method.
This memory address indicates the entry address when calling the method.

【0042】第1のインタフェーステーブル60が、中
間コード変換コンパイラ40により生成されたときに
は、メソッド名称と引数情報がフィールド61、62に
格納されるが、メモリアドレスはまだ決定されておら
ず、フィールド63には設定されない。オブジェクトモ
ジュール90及びオブジェクト化されたインタフェース
テーブル60A、60Bがネイティブリンカ100によ
りリンクされるときに、各メソッドのメモリアドレスが
決定される。したがって、ネイティブリンカ100が、
リンクを行うときに、各ネイティブメソッドのメモリア
ドレスをインタフェーステーブル60内の当該メソッド
に対するフィールド63に設定してネイティブ化された
インタフェーステーブル600を完成するように構成さ
れる。
When the first interface table 60 is generated by the intermediate code conversion compiler 40, the method name and the argument information are stored in the fields 61 and 62, but the memory address has not yet been determined and the field 63 has not been determined. Is not set to. When the object module 90 and the objectized interface tables 60A and 60B are linked by the native linker 100, the memory address of each method is determined. Therefore, the native linker 100
When linking, the memory address of each native method is set in the field 63 for that method in the interface table 60 to complete the nativeized interface table 600.

【0043】なお、ネイティブ化されたインタフェース
テーブル600への各メソッドのメモリアドレスの格納
をネイティブリンカ100に実行させる代わりに、他の
方法を用いてもよい。例えば、システム設計者が、ネイ
ティブリンカ100がリンクに関連して出力するアドレ
スデータを見て、ネイティブ化される前のインタフェー
ステーブル60にコマンド入力により格納した後、再
度、ネイティブコンパイラ80によるコンパイル、ネイ
ティブリンカ100によるリンクを実行させるようにし
てもよい。
Instead of causing the native linker 100 to store the memory address of each method in the nativeized interface table 600, another method may be used. For example, the system designer looks at the address data output by the native linker 100 in association with the link, stores it in the interface table 60 before being nativeized by command input, and then compiles it again by the native compiler 80 The link by the linker 100 may be executed.

【0044】図4は、第2のインタフェーステーブル7
0の例を示す図である。第2のインタフェーステーブル
70は、ネイティブメソッド110A又は110Bを実
行中に、インタプリタ120側が持っている固有メソッ
ド、例えばいわゆるライブラリ関数を呼び出すとき又は
中間コードとして用意されたメソッドをインタプリタを
介して呼び出すときに使用される。第2のインタフェー
ステーブル70は、ネイティブコード110内のプログ
ラム部分(ネイティブメソッド110A、110B)と
静的にリンクしているので、それぞれのネイティブメソ
ッドから読み出し可能である。
FIG. 4 shows the second interface table 7
It is a figure which shows the example of 0. The second interface table 70 is used when a native method held by the interpreter 120 side, for example, a so-called library function is called during execution of the native method 110A or 110B, or when a method prepared as intermediate code is called through the interpreter. used. Since the second interface table 70 is statically linked with the program parts (native methods 110A and 110B) in the native code 110, it can be read from each native method.

【0045】第2のインタフェーステーブル70は、イ
ンタプリタに関する情報を保持する3つのフィールド7
1、72、73及び各固有メソッドに対応して、当該固
有メソッドに関する情報を保持する3つのフィールド7
4、75、76を含んでいる。インタプリタ用のフィー
ルド71には、インタプリタの名称が登録される。より
具体的には、インタプリタの名称を表す文字列がこのフ
ィールドにチェインされる。フィールド72にはインタ
プリタ120を呼び出すときに用いる引数に関する情報
を示す文字列がチェインされる。引数情報は、インタプ
リタ120を呼び出すのに使用する引数の総数、各引数
の型などそのインタプリタ120の引数に関する制約条
件を指定する情報である。フィールド73には、当該イ
ンタプリタのメモリアドレス、つまりインタプリタの機
能を有する関数の先頭アドレスが格納される。
The second interface table 70 has three fields 7 holding information about the interpreter.
Corresponding to 1, 72, 73 and each unique method, three fields 7 for holding information about the unique method
4,75,76 are included. The name of the interpreter is registered in the interpreter field 71. More specifically, a character string representing the name of the interpreter is chained in this field. In the field 72, a character string indicating information about an argument used when calling the interpreter 120 is chained. The argument information is information that specifies constraint conditions regarding the arguments of the interpreter 120, such as the total number of arguments used to call the interpreter 120 and the type of each argument. The field 73 stores the memory address of the interpreter, that is, the start address of the function having the interpreter function.

【0046】フィールド74には、固有メソッドの名称
つまりライブラリ関数の名称が格納される。具体的に
は、関数の名称を示す文字列がこのフィールドにチェイ
ンされる。図に示したように、固有メソッドが、文字列
や数値を標準出力に出力するsysprintメソッド
の場合、メソッド名称“sysprint”がフィール
ド74に格納される。フィールド75にはそのメソッド
の引数情報を示す文字列がチェインされる。引数情報
は、そのメソッドを呼び出すのに使用する引数の総数、
各引数の型などそのメソッドの引数に関する制約条件を
指定する情報である。sysprintメソッドの場合
には、図示されたように文字列“Addr、Add
r、、、”が格納される。フィールド76には、その固
有メソッドのメモリアドレスが格納される。このメモリ
アドレスは、当該メソッドを呼び出すときの入り口アド
レスを示している。
The field 74 stores the name of the unique method, that is, the name of the library function. Specifically, a character string indicating the name of the function is chained in this field. As shown in the figure, when the unique method is a sysprint method that outputs a character string or a numerical value to the standard output, the method name “sysprint” is stored in the field 74. In the field 75, a character string indicating the argument information of the method is chained. The argument information is the total number of arguments used to call the method,
This is information that specifies the constraint conditions for the arguments of the method such as the type of each argument. In the case of the sysprint method, as shown in the figure, the character strings "Addr, Add
r, ..., Is stored. The memory address of the unique method is stored in the field 76. This memory address indicates the entry address when the method is called.

【0047】第2のインタフェーステーブル70が、中
間コード変換コンパイラ40により生成されたときに
は、インタプリタと固有メソッドに関するメモリアドレ
ス以外の情報が当該テーブルに設定されているが、メモ
リアドレスは設定されないことは、インタフェーステー
ブル60の生成時と同じである。ネイティブ化されたイ
ンタフェーステーブル700を生成するときに、固有メ
ソッドのメモリアドレス及びインタプリタ120のメモ
リアドレスをインタフェーステーブル700に設定して
インタフェーステーブル700を完成することは、ネイ
ティブ化されたインタフェーステーブル600の場合と
同じである。なお、第2のインタフェーステーブル70
0に設定されるべきインタプリタ120のメモリアドレ
ス及び固有メソッドのメモリアドレスは、インタプリタ
120に対するロードモジュールを生成するときに既に
決定されていると仮定する。
When the second interface table 70 is generated by the intermediate code conversion compiler 40, information other than the memory address regarding the interpreter and the unique method is set in the table, but the memory address is not set. This is the same as when the interface table 60 is generated. When the nativeized interface table 700 is generated, the memory address of the unique method and the memory address of the interpreter 120 are set in the interface table 700 to complete the interface table 700. Is the same as. The second interface table 70
It is assumed that the memory address of the interpreter 120 and the memory address of the native method that should be set to 0 have already been determined when generating the load module for the interpreter 120.

【0048】図5は、本実施の形態での中間コードの実
行手順の概略フローチャートである。まずリアルタイム
OSをOS領域210(図2)に通常通りロードした後
(あるいはメモリがROMである場合には、ROMのO
S領域210に組み込まれた状態で)リアルタイムOS
の初期化処理を実行させる(ステップS101)。その
初期化処理の中で、既に説明した方法であらかじめ生成
されたネイティブコード110をメモリのネイティブコ
ードリザーブ領域230にコピー(ロード)する(ステ
ップS102)。このとき、ネイティブコード110内
のプログラム部分110A、110Bと一緒に、ネイテ
ィブコード110に含まれたネイティブ化されたインタ
フェーステーブル600、700もコピーする。
FIG. 5 is a schematic flowchart of the execution procedure of the intermediate code in this embodiment. First, load the real-time OS into the OS area 210 (FIG. 2) normally (or if the memory is ROM, read the O
Real-time OS (incorporated in S area 210)
The initialization process of is executed (step S101). In the initialization process, the native code 110 generated in advance by the method described above is copied (loaded) into the native code reserve area 230 of the memory (step S102). At this time, the nativeized interface tables 600 and 700 included in the native code 110 are also copied together with the program parts 110A and 110B in the native code 110.

【0049】ここでは、通常そうであるように、中間コ
ード30がネットワーク(図示せず)を経由してあるい
は可搬型の記録媒体を用いてコンピュータの外側から提
供されると仮定している。したがって、その実体はコン
ピュータシステムの実行メモリ上ではなく、いわゆるフ
ァイルシステムのようなものの上にまず置かれると想定
している。ネイティブコードも同様にネットワークある
いは可搬型の記録媒体を用いてファイルシステム上にま
ずおかれる仮定し、コンピュータシステムが動作する前
にあたかも最初からそこにあったかのように取り扱うた
めに、コンピュータの動作開始時にネイティブコードリ
ザーブ領域230にネイティブコード110をコピー
(ロード)するようにしている。
It is assumed here that, as is usually the case, the intermediate code 30 is provided via a network (not shown) or from outside the computer using a portable recording medium. Therefore, it is assumed that the entity is first placed not on the execution memory of the computer system but on what is called a file system. Similarly, it is assumed that the native code is first placed on the file system using a network or a portable recording medium, and is treated at the beginning of computer operation as if it were there from the beginning before the computer system started operating. The native code 110 is copied (loaded) into the native code reserve area 230.

【0050】ネイティブコード110が変更された場
合、変更後のネイティブコードがコピーされるようにす
るために、コピーされるべきネイティブコードをユーザ
が指示可能にする必要がある。コピーされるべきネイテ
ィブコードは、例えばユーザが入力するコマンドでもっ
て指示するかあるいは適当な命令のユーザが指定可能な
オプションでもって指示することができる。
When the native code 110 is changed, it is necessary for the user to be able to indicate the native code to be copied so that the changed native code is copied. The native code to be copied can be indicated, for example, by a command entered by the user or by a user-specified option of the appropriate instruction.

【0051】つぎに、OSに含まれた、インタプリタ1
20のスタータプログラム(図示せず)が起動され、こ
のスタータプログラムにより以下の処理S103、S1
04が実行される。まず、インタプリタ120及びスイ
ッチングモジュール130をインタプリタ領域220に
ロードする(ステップS103)。インタプリタ120
に実行すべき中間コード30を指定することにより、イ
ンタプリタ120に中間コード30の実行を開始させる
(ステップS104)。
Next, the interpreter 1 included in the OS
20 starter programs (not shown) are started, and the following processes S103 and S1 are executed by this starter program.
04 is executed. First, the interpreter 120 and the switching module 130 are loaded into the interpreter area 220 (step S103). Interpreter 120
Specifying the intermediate code 30 to be executed causes the interpreter 120 to start executing the intermediate code 30 (step S104).

【0052】インタプリタ120は、通常そうであるよ
うに、指定された中間コードをメモリの中間コード展開
領域240に動的に展開し、中間コード用スタック領域
250を利用しながら中間コード30を実行する。中間
コード展開領域240には、実行したい中間コードがロ
ードされ、逐次実行される。この中間コード展開領域2
40にはヒープ領域も含まれる。中間コードのロードは
動的に行われ、実行が終わると領域はリリースされる。
中間コード用スタック領域250には、中間コードをイ
ンタプリタで実行する際に使用するスタックが設けられ
る。
The interpreter 120 dynamically expands the designated intermediate code in the intermediate code expansion area 240 of the memory, and executes the intermediate code 30 while using the intermediate code stack area 250, as is usually the case. . The intermediate code to be executed is loaded in the intermediate code expansion area 240 and sequentially executed. This intermediate code expansion area 2
A heap area is also included in 40. The loading of intermediate code is done dynamically and the region is released when it finishes executing.
The intermediate code stack area 250 is provided with a stack used when the intermediate code is executed by the interpreter.

【0053】本実施の形態では、中間コード30内のつ
ぎに実行すべき命令(中間コード命令)に対応するネイ
ティブ化されたプログラム部分がネイティブコード11
0に含まれている場合には、その命令はインタプリタに
より解釈して実行されるのではなく、その命令として、
その対応するネイティブコードが実行される。これによ
りその命令の実行が高速化される。更に、実行中のネイ
ティブ化されたプログラム部分110A又は110Bか
らインタプリタ120内の固有のプログラム部分(例え
ばライブラリ関数)140あるいはインタプリタ120
を呼び出すことができるようになっている。これによ
り、ネイティブ化されたプログラム部分110A又は1
10Bが、中間コードの命令と同様に、インタプリタ内
のプログラムリソース若しくはインタプリタ120が持
つ機能を利用することが可能になっている。
In the present embodiment, the native program portion corresponding to the instruction to be executed next in the intermediate code 30 (intermediate code instruction) is the native code 11
If it is included in 0, the instruction is not interpreted and executed by the interpreter, but as the instruction,
The corresponding native code is executed. This speeds up the execution of that instruction. Further, from the running nativeized program portion 110A or 110B to the native program portion (eg, library function) 140 in interpreter 120 or interpreter 120.
Can be called. As a result, the program part 110A or 1
10B can use the program resource in the interpreter or the function of the interpreter 120, similarly to the instruction of the intermediate code.

【0054】図6は、インタプリタ120による中間コ
ードの実行動作を示す概略フローチャートである。ま
ず、インタプリタ120は、実行すべき中間コード命令
に関して第1のインタフェーステーブル600を参照し
て、当該中間コード命令に対応するメソッドがネイティ
ブメソッドとしてネイティブコード110に含まれてい
るか否かを判別する(ステップS111)。ここで、中
間コード命令に対応するメソッドとは、中間コード命令
により使用されるメソッドである。例えば、実行すべき
中間コード命令が、いずれかのメソッドを呼び出す命令
である場合、そのメソッドが当該中間命令に対応するメ
ソッドである。
FIG. 6 is a schematic flowchart showing the operation of executing the intermediate code by the interpreter 120. First, the interpreter 120 refers to the first interface table 600 regarding the intermediate code instruction to be executed, and determines whether or not the method corresponding to the intermediate code instruction is included in the native code 110 as the native method ( Step S111). Here, the method corresponding to the intermediate code instruction is a method used by the intermediate code instruction. For example, if the intermediate code instruction to be executed is an instruction to call any method, that method is the method corresponding to the intermediate instruction.

【0055】第1のインタフェーステーブル600のメ
モリアドレスは固定されているので、インタプリタ12
0は、この固定アドレスを用いて第1のインタフェース
テーブル600を参照できるようになっている。上記判
定は、第1のインタフェーステーブル600に当該メソ
ッドの名称がいずれかのメソッドに対するフィールド6
1に登録されているメソッド名称に一致するか否かによ
り判別することができる。
Since the memory address of the first interface table 600 is fixed, the interpreter 12
0 can refer to the first interface table 600 by using this fixed address. The above determination is made by using the field 6 for the method whose method name is any in the first interface table 600.
It can be determined by whether or not the method name registered in 1 matches.

【0056】もし当該メソッドの名称が第1のインタフ
ェーステーブル600に登録されていない場合には、イ
ンタプリタ120により当該中間コード命令を解釈実行
し(ステップS112)、ステップS117に進む。
If the method name is not registered in the first interface table 600, the interpreter 120 interprets and executes the intermediate code instruction (step S112), and proceeds to step S117.

【0057】もし当該メソッドの名称がいずれかのフィ
ールド61に登録されている場合には、そのメソッド名
称に対応して登録されたメソッド引数情報62にしたが
って、引数を設定する(ステップS113)。すなわ
ち、引数の個数、型等の引数に関する制約条件を満たす
ように、呼び出しに使用する引数を設定する。制約条件
の他の例は、レジスタに載せられるサイズの引数は4個
までレジスタに置き、それ以外のサイズの引数はスタッ
クに置くということである。引数情報がこの制約条件を
示している場合には、この制約条件にしたがって呼び出
しに用いる複数の引数をレジスタとスタックに区分して
設定する。
If the name of the method is registered in any of the fields 61, the argument is set according to the method argument information 62 registered corresponding to the method name (step S113). That is, the arguments used for the call are set so as to satisfy the constraint conditions concerning the arguments such as the number of arguments and types. Another example of the constraint condition is that up to four arguments whose size can be placed in a register are placed in the register, and arguments of other sizes are placed in the stack. When the argument information indicates this constraint condition, a plurality of arguments used for the call are divided into a register and a stack and set according to the constraint condition.

【0058】つぎに、当該メソッドに対するメモリアド
レスをそのメソッドに対するフィールド63から読み出
し、そのメモリアドレスを用いて当該ネイティブメソッ
ドを呼び出す(ステップS114)。こうして、インタ
プリタ120からネイティブメソッドを呼び出すことが
できる。呼び出されたネイティブメソッドは、コンピュ
ータにより直接実行される。当該ネイティブメソッドの
実行の結果、当該ネイティブメソッドからのリターン値
がある場合、インタプリタ120は、当該リターン値を
中間コード側に引継ぐ(ステップS116)。こうし
て、中間コード命令が対応するネイティブメソッドを用
いて実行され、ステップS117に進む。
Next, the memory address for the method is read from the field 63 for the method, and the native method is called using the memory address (step S114). In this way, the native method can be called from the interpreter 120. The called native method is executed directly by the computer. As a result of the execution of the native method, if there is a return value from the native method, the interpreter 120 takes over the return value to the intermediate code side (step S116). Thus, the intermediate code instruction is executed using the corresponding native method, and the process proceeds to step S117.

【0059】以上のようにして中間コード命令の実行が
終了すると、全ての中間コード命令の実行が終了したか
否かが判断され(ステップS117)、そうでないとき
には以上の処理が後続の中間コード命令に対して繰り返
され、全ての中間コード命令の実行が終了したときに、
プログラムの実行が終了する。
When the execution of the intermediate code instructions is completed as described above, it is judged whether or not the execution of all the intermediate code instructions is completed (step S117). If not, the above-mentioned processing is followed by the subsequent intermediate code instructions. , And when all the intermediate code instructions have finished executing,
Program execution ends.

【0060】本実施の形態では、上記ステップS114
で呼び出されて実行されているネイティブメソッドか
ら、インタプリタ120に含まれた固有のメソッド若し
くはインタプリタ120を呼び出すことも可能になって
いる。具体的には、ネイティブメソッドの実行中にイン
タプリタ120に含まれた固有メソッド又はインタプリ
タ120が呼び出された場合(ステップS115)、ス
イッチングモジュール130を呼び出す。
In the present embodiment, the above step S114.
It is also possible to call a unique method included in the interpreter 120 or the interpreter 120 from a native method called and executed by the. Specifically, when the native method included in the interpreter 120 or the interpreter 120 is called during the execution of the native method (step S115), the switching module 130 is called.

【0061】図7は、スイッチングモジュール130の
処理の概略フローチャートである。まず、呼び出し先が
固有メソッドであるかインタプリタ120であるかが判
別される(ステップS131)。呼び出し先が固有メソ
ッドの場合には、ネイティブ化されたインタフェーステ
ーブル700から呼び出し先の固有メソッドの引数情報
を読み出し(ステップS132)、読み出された引数情
報に合わせて引数を設定する(ステップS133)。引
数情報に合わせて引数を設定する処理の例は、インタプ
リタ120がネイティブメソッドを呼び出す場合につい
て図6のステップS113に関して説明したとおりであ
る。
FIG. 7 is a schematic flowchart of the processing of the switching module 130. First, it is determined whether the call destination is the unique method or the interpreter 120 (step S131). When the callee is the unique method, the argument information of the unique method of the callee is read from the nativeized interface table 700 (step S132), and the argument is set according to the read argument information (step S133). . An example of the process of setting the argument according to the argument information is as described regarding step S113 of FIG. 6 in the case where the interpreter 120 calls the native method.

【0062】図7において、ネイティブ化されたインタ
フェーステーブル700から呼び出し先のメモリアドレ
スを読み出し(ステップS134)、読み出されたメモ
リアドレスを用いて固有メソッドを呼び出す(ステップ
S135)。固有メソッドの実行の結果、当該固有メソ
ッドからのリターン値がある場合、スイッチングモジュ
ール130は、当該リターン値をネイティブコード内の
プログラム部分(ネイティブメソッド110A又は11
0B)に引継ぐ(ステップS136)。これによって、
呼び出し元のネイティブメソッドが呼び出し先の固有メ
ソッドによる処理結果を利用して処理を続けることがで
きる。こうして、呼び出し先が固有メソッドである場合
のスイッチングモジュール130の処理が終了する。
In FIG. 7, the memory address of the call destination is read from the nativeized interface table 700 (step S134), and the unique method is called using the read memory address (step S135). When there is a return value from the specific method as a result of the execution of the specific method, the switching module 130 sets the return value to the program part (native method 110A or 11) in the native code.
0B) (step S136). by this,
The native method of the caller can continue processing by using the processing result of the unique method of the callee. Thus, the processing of the switching module 130 when the callee is the unique method is completed.

【0063】一方、呼び出し先がインタプリタ120で
あるとステップS131で判断された場合、ネイティブ
化されたインタフェーステーブル700からインタプリ
タ120の引数情報を読み出し(ステップS137)、
読み出された引数情報に合わせて引数を設定する(ステ
ップS138)。ネイティブ化されたインタフェーステ
ーブル700からインタプリタ120のメモリアドレス
を読み出し(ステップS139)、読み出されたメモリ
アドレスを用いてインタプリタ120を呼び出す(ステ
ップS140)。
On the other hand, if it is determined in step S131 that the call destination is the interpreter 120, the argument information of the interpreter 120 is read from the nativeized interface table 700 (step S137).
An argument is set according to the read argument information (step S138). The memory address of the interpreter 120 is read from the nativeized interface table 700 (step S139), and the interpreter 120 is called using the read memory address (step S140).

【0064】インタプリタ120の実行の結果、当該イ
ンタプリタ120からのリターン値がある場合、スイッ
チングモジュール130は、当該リターン値をネイティ
ブコード内のプログラム部分(ネイティブメソッド11
0A又は110B)に引継ぐ(ステップS141)。こ
れによって、呼び出し元のネイティブメソッドがインタ
プリタによる処理結果を利用して処理を続けることがで
きる。こうして、呼び出し先がインタプリタ120であ
る場合のスイッチングモジュール130の処理が終了す
る。
If there is a return value from the interpreter 120 as a result of the execution of the interpreter 120, the switching module 130 sets the return value to the program part (native method 11) in the native code.
0A or 110B) (step S141). This allows the calling native method to continue processing using the processing result of the interpreter. Thus, the processing of the switching module 130 when the callee is the interpreter 120 is completed.

【0065】このように、ネイティブメソッド、例えば
110Aがインタプリタ120により呼び出されて実行
されているときに、当該ネイティブメソッド110Aか
らインタプリタ120自身あるいはインタプリタ120
用の固有メソッドを利用することができる。
As described above, when a native method, for example, 110A is called and executed by the interpreter 120, the native method 110A interprets the interpreter 120 itself or the interpreter 120.
You can use the specific method for.

【0066】マイコンシステムの設計者が高速化したい
中間コード部分30Aの内容を変更したときには、そこ
に含まれるメソッドが変更される。メソッドの変更に
は、例えば、メソッドの内容の変更、他のメソッドの追
加、他のメソッドによる置換等があり得る。その結果、
生成されるネイティブ化されたプログラム部分110
A、110Bのいずれかのメソッド名称、引数情報、メ
モリアドレスのいずれかが変化することが生じる。した
がって、変更後のネイティブ化されたプログラム部分1
10A、110Bに合致するように、第1のインタフェ
ーステーブル600を変更する必要がある。
When the designer of the microcomputer system changes the contents of the intermediate code portion 30A that the user wants to speed up, the method contained therein is changed. The method change can include, for example, changing the content of the method, adding another method, replacing it with another method, and the like. as a result,
Generated native program part 110
Any of the method name, argument information, and memory address of either A or 110B may change. Therefore, the modified native program part 1
It is necessary to change the first interface table 600 to match 10A and 110B.

【0067】すなわち、第1のインタフェーステーブル
600に関して、メモリアドレス以外の変更をすべきと
きには、中間コード変換コンパイラ40により生成され
たときに、当該変更はそのときに生成されたインタフェ
ーステーブル60に反映されている。第1のインタフェ
ーステーブル600に関して、メモリアドレスを変更す
べきときには、当該変更は、オブジェクトモジュール9
0と、オブジェクトモジュール化されたインタフェース
テーブル60A、70Bをネイティブリンカ100によ
りリンクしてネイティブコード110を生成するとき
に、生成されたネイティブ化されたインタフェーステー
ブル600に反映される。
That is, regarding the first interface table 600, when a change other than the memory address is to be made, when the change is generated by the intermediate code conversion compiler 40, the change is reflected in the interface table 60 generated at that time. ing. Regarding the first interface table 600, when the memory address should be changed, the change is performed by the object module 9
When 0 and the object moduleized interface tables 60A and 70B are linked by the native linker 100 to generate the native code 110, they are reflected in the generated nativeized interface table 600.

【0068】こうして生成された変更後のネイティブコ
ード110が、図5のステップS102によりネイティ
ブコードリザーブ領域230にコピーされたときに、ネ
イティブ化されたプログラム部分及びインタフェーステ
ーブル600も更新される。しかし、変更後のインタフ
ェーステーブル600の記憶位置は固定されているの
で、インタプリタ120は、変更後のインタフェーステ
ーブル600をそれまでと同じく読み出すことができ
る。インタプリタ120は、インタフェーステーブル6
00内の変更後の情報を利用して上記変更後の複数のネ
イティブ化されたプログラム部分のうちの任意のものを
呼び出すことができる。ネイティブ化されたプログラム
部分の変更時に、変更後のネイティブコードをインタプ
リタとリンクする必要もなく、またインタプリタに関し
て何らかの処理をする必要がない。したがって、ネイテ
ィブ化されたオブジェクト部分のリプレースが容易にな
る。
When the changed native code 110 thus generated is copied to the native code reserve area 230 in step S102 of FIG. 5, the nativeized program part and the interface table 600 are also updated. However, since the storage location of the changed interface table 600 is fixed, the interpreter 120 can read the changed interface table 600 as before. The interpreter 120 uses the interface table 6
The modified information in 00 can be used to call any of the modified native program parts. It is not necessary to link the changed native code with the interpreter when changing the part of the program that has been made into a native form, and it is not necessary to perform any processing regarding the interpreter. Therefore, replacement of the nativeized object part becomes easy.

【0069】なお、第2のインタフェーステーブル70
0は、ネイティブ化されたオブジェクト部分の変更の影
響を受けない。このテーブル700は、インタプリタ1
20又はインタプリタ内の固有メソッドが変更されたと
きに変更する必要がある。変更の仕方は、第1のインタ
フェーステーブル600の変更と同様にして行うことが
できる。
The second interface table 70
0 is unaffected by changes to the nativeized object part. This table 700 is for interpreter 1
20 or need to change when the native method in the interpreter changes. The changing method can be performed in the same manner as the changing of the first interface table 600.

【0070】[0070]

【発明の効果】以上説明したように、本発明によれば、
ダイナミックリンクライブラリの機能を持たないOS上
で中間コードをインタプリタにより逐次解釈させて実行
するとともに高速化のために中間コードの一部に代えて
ネイティブコードをインタプリタを介さないでコンピュ
ータ上で直接実行させるシステムにおいて、ネイティブ
コードのリプレースが容易になる。
As described above, according to the present invention,
The intermediate code is serially interpreted and executed by an interpreter on an OS that does not have the function of the dynamic link library, and the native code is directly executed on the computer instead of a part of the intermediate code for speeding up without passing through the interpreter. Replaces native code easily in the system.

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

【図1】中間コードとネイティブコードとの組合せから
なるアプリケーションプログラムを生成する過程の一例
を示す図である。
FIG. 1 is a diagram showing an example of a process of generating an application program including a combination of intermediate code and native code.

【図2】アプリケーションプログラムの実行時における
種々のプログラムに割り当てられるメモリ領域を示す図
である。
FIG. 2 is a diagram showing memory areas assigned to various programs when an application program is executed.

【図3】第1のインタフェーステーブルの例を示す図で
ある。
FIG. 3 is a diagram showing an example of a first interface table.

【図4】第2のインタフェーステーブルの例を示す図で
ある。
FIG. 4 is a diagram showing an example of a second interface table.

【図5】本発明の実施の形態での中間コードからなるプ
ログラムの実行手順の概略フローチャートである。
FIG. 5 is a schematic flowchart of an execution procedure of a program including intermediate code according to the embodiment of the present invention.

【図6】インタプリタによる中間コードの実行動作の概
略フローチャートである。
FIG. 6 is a schematic flowchart of an intermediate code execution operation by an interpreter.

【図7】スイッチングモジュールの処理の概略フローチ
ャートである。
FIG. 7 is a schematic flowchart of processing of a switching module.

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】 ソースプログラムの一部をコンパイルし
て得られる中間コード部分と前記ソースプログラムの他
の部分をコンパイルして得られるネイティブ化された複
数のプログラム部分とを含むプログラムのうち前記中間
コード部分をインタプリタにより解釈して実行し、前記
複数のネイティブ化されたプログラム部分の各々を前記
インタプリタを介さないでコンピュータにより直接実行
するプログラムの実行制御方法であって、 前記複数のネイティブ化されたプログラム部分が主記憶
メモリ内の所定のネイティブコード専用領域内に記憶さ
れ、それぞれのネイティブ化された複数のプログラム部
分を呼び出すための情報を記憶したインタフェーステー
ブルが前記ネイティブコード専用領域内の所定の位置に
記憶された状態で、前記中間コード部分の実行を開始
し、 前記中間コード部分内のつぎに実行すべき命令に対応す
るネイティブ化されたプログラム部分が前記複数のネイ
ティブ化されたプログラム部分に含まれているとき、当
該対応するネイティブ化されたプログラム部分を呼び出
すための情報を前記インタフェーステーブルから前記イ
ンタプリタにより読み出し、 読み出された情報を使用して前記対応するネイティブ化
されたプログラム部分を前記インタプリタにより呼び出
す、 ステップを含むことを特徴とするプログラム実行制御方
法。
1. An intermediate code of a program including an intermediate code part obtained by compiling a part of a source program and a plurality of nativeized program parts obtained by compiling other parts of the source program. A method of controlling execution of a program, wherein a part is interpreted and executed by an interpreter, and each of the plurality of native program parts is directly executed by a computer without going through the interpreter, the plurality of native programs A part is stored in a predetermined area dedicated to native code in the main memory, and an interface table storing information for calling each of a plurality of nativeized program parts is stored in a predetermined position in the area dedicated to native code. In the memorized state, When a plurality of native program parts corresponding to instructions to be executed next in the intermediate code part are included in the plurality of native program parts. Reading the information for calling the localized program part from the interface table by the interpreter, and using the read information to call the corresponding nativeized program part by the interpreter. And program execution control method.
【請求項2】 前記インタフェーステーブル内の各ネイ
ティブ化されたプログラム部分を呼び出すための情報
は、当該プログラム部分の呼び出しに使用する引数に関
する制約を指定する引数情報及び当該プログラム部分の
メモリアドレスを含み、 前記読み出しステップは、呼び出すべきネイティブ化さ
れたプログラム部分を呼び出すための情報に含まれた引
数情報と当該ネイティブ化されたプログラム部分のメモ
リアドレスを読み出し、 前記呼び出すステップは、 読み出された引数情報に基づいて前記対応するネイティ
ブ化されたプログラム部分に引き渡すべき引数を設定
し、 前記読み出されたメモリアドレスを用いて前記対応する
ネイティブ化されたプログラム部分を呼び出すステップ
を含むことを特徴とする請求項1に記載のプログラム実
行制御方法。
2. The information for calling each nativeized program part in the interface table includes argument information that specifies constraints on arguments used for calling the program part and a memory address of the program part, The reading step reads the argument information included in the information for calling the nativeized program part to be called and the memory address of the nativeized program part, and the calling step is based on the read argument information. Setting the argument to be passed to the corresponding nativeized program part based on the above, and calling the corresponding nativeized program part using the read memory address. The program described in 1. Execution control method.
【請求項3】 前記プログラムの実行開始ステップは、
前記インタプリタ内に設けられた複数の固有のプログラ
ム部分のそれぞれをいずれかのネイティブ化されたプロ
グラム部分から呼び出すための情報を記憶した他のイン
タフェーステーブルが前記ネイティブコード専用領域内
の所定の位置に記憶された状態でプログラムの実行を開
始し、 前記複数のネイティブ化されたプログラム部分のいずれ
かが実行中に、前記複数の固有のプログラム部分のいず
れかを呼び出すための情報を当該実行中のネイティブ化
されたプログラム部分により前記他のインタフェーステ
ーブルから読み出し、 読み出された情報を使用して前記いずれかの固有のプロ
グラム部分を前記実行中のネイティブ化されたプログラ
ム部分から呼び出す、 ステップを更に含むことを特徴とする請求項1又は2に
記載のプログラム実行制御方法。
3. The step of starting execution of the program,
Another interface table storing information for calling each of a plurality of unique program parts provided in the interpreter from any of the native program parts is stored at a predetermined position in the native code dedicated area. Information for calling any one of the plurality of unique program parts while the one of the plurality of native program parts is being executed. Read from the other interface table by the programmed program portion and using the read information to call any of the unique program portions from the running nativeized program portion. The program implementation according to claim 1 or 2, characterized in that Control method.
【請求項4】 各固有のプログラム部分を呼び出すため
の前記情報は、当該固有のプログラム部分の呼び出しに
使用する引数に関する制約を指定する引数情報及び当該
固有のプログラム部分のメモリアドレスを含み、 前記他のインタフェーステーブルから前記情報を読み出
すステップは、呼び出すべき固有のプログラム部分を呼
び出すための情報に含まれた引数情報と当該固有のプロ
グラム部分のメモリアドレスを読み出し、 前記固有のプログラム部分を呼び出すステップは、 前記固有のプログラム部分に関して読み出された前記引
数情報に基づいて前記呼び出すべき固有のプログラム部
分に引き渡す引数を設定し、 前記呼び出すべき固有のプログラム部分に関して読み出
された前記メモリアドレスを用いて前記呼び出すべき固
有のプログラム部分を呼び出すステップを含むことを特
徴とする請求項3に記載のプログラム実行制御方法。
4. The information for calling each peculiar program part includes argument information designating a constraint concerning an argument used for calling the peculiar program part and a memory address of the peculiar program part, and the other information. The step of reading the information from the interface table of, reading the argument information included in the information for calling the unique program portion to be called and the memory address of the unique program portion, the step of calling the unique program portion, An argument to be passed to the unique program portion to be called is set based on the argument information read out to the unique program portion, and the calling is performed using the memory address read out to the unique program portion to be called. Power specific blog Program execution control method according to claim 3, characterized in that it comprises the step of invoking the arm portion.
【請求項5】 前記他のインタフェーステーブルは、い
ずれかのネイティブ化されたプログラム部分から前記イ
ンタプリタを呼び出すための情報を更に記憶し、 前記複数のネイティブ化されたプログラム部分のいずれ
かが実行中に、前記インタプリタを呼び出すための情報
を、当該実行中のプログラム部分により前記他のインタ
フェーステーブルから読み出し、 前記インタプリタに関して読み出された前記情報を使用
して前記インタプリタを前記実行中のネイティブ化され
たプログラム部分から呼び出す、 ステップを更に含むことを特徴とする請求項3又は4に
記載のプログラム実行制御方法。
5. The other interface table further stores information for invoking the interpreter from any of the nativeized program parts, during execution of any of the plurality of nativeized program parts. , The information for calling the interpreter is read from the other interface table by the executing program part, and the nativeized program executing the interpreter using the information read about the interpreter. 5. The program execution control method according to claim 3, further comprising a step of calling from a part.
【請求項6】 前記インタプリタを呼び出すための情報
は、当該インタプリタの呼び出しに使用する引数に関す
る制約を指定する引数情報及び当該インタプリタのメモ
リアドレスを含み、 前記他のインタフェーステーブルから前記インタプリタ
を呼び出すための情報を読み出すステップは、前記イン
タプリタを呼び出すための情報に含まれた前記引数情報
と当該インタプリタのメモリアドレスを読み出し、 前記インタプリタを呼び出すステップは、 前記インタプリタに関して読み出された前記引数情報に
基づいて前記インタプリタに引き渡すべき引数を設定
し、 前記インタプリタに関して読み出された前記メモリアド
レスを用いて前記インタプリタを呼び出すステップを含
むことを特徴とする請求項5に記載のプログラム実行制
御方法。
6. The information for calling the interpreter includes argument information that specifies constraints on arguments used to call the interpreter and a memory address of the interpreter, and calls the interpreter from the other interface table. The step of reading information reads the argument information included in the information for calling the interpreter and the memory address of the interpreter, and the step of calling the interpreter is based on the argument information read with respect to the interpreter. The program execution control method according to claim 5, further comprising the step of setting an argument to be passed to the interpreter, and calling the interpreter using the memory address read with respect to the interpreter.
【請求項7】 ソースプログラムの一部をコンパイルし
て得られる中間コード部分と前記ソースプログラムの他
の部分をコンパイルして得られ、前記インタプリタを介
さないでコンピュータにより直接実行されるネイティブ
化された複数のプログラム部分とを含むプログラムの実
行を制御するためのプログラム実行制御プログラムであ
って、 前記中間コード部分を逐次解読して実行するインタプリ
タと、 前記複数のネイティブ化されたプログラム部分を呼び出
すための情報を記憶したインタフェーステーブルとを備
え、 前記ネイティブ化された複数のプログラム部分は、主記
憶メモリ内の所定のネイティブコード専用領域内に記憶
され、 前記インタフェーステーブルは、前記所定のネイティブ
コード専用領域内の所定位置に記憶され、 前記インタプリタは、 前記中間コード部分内のつぎに実行すべき命令に対応す
るネイティブ化されたプログラム部分が前記複数のネイ
ティブ化されたプログラム部分に含まれているとき、当
該対応するネイティブ化されたプログラム部分を呼び出
すための情報を前記インタフェーステーブルから読み出
し、 読み出された情報を使用して前記対応するネイティブ化
されたプログラム部分を呼び出す、 ことを特徴とするプログラム実行制御プログラム。
7. A native code obtained by compiling an intermediate code part obtained by compiling a part of a source program and another part of the source program, which is directly executed by a computer without passing through the interpreter. A program execution control program for controlling execution of a program including a plurality of program parts, the interpreter sequentially decoding and executing the intermediate code part, and for calling the plurality of nativeized program parts An interface table storing information, wherein the plurality of native program parts are stored in a predetermined native code dedicated area in the main memory, and the interface table is stored in the predetermined native code dedicated area. Is stored in a predetermined position of When a plurality of native program parts corresponding to an instruction to be executed next in the intermediate code part are included in the plurality of native program parts, the interpreter corresponds to the corresponding native program part. A program execution control program, which reads information for calling from the interface table and calls the corresponding nativeized program part using the read information.
【請求項8】 前記ネイティブコード専用領域内の所定
の位置に記憶され、前記インタプリタ内に設けられた複
数の固有のプログラム部分のそれぞれをいずれかのネイ
ティブ化されたプログラム部分から呼び出すための情報
を記憶した他のインタフェーステーブルと、 前記複数のネイティブ化されたプログラム部分のいずれ
かが実行中に、前記複数の固有のプログラム部分のいず
れかを呼び出すための情報を当該実行中のネイティブ化
されたプログラム部分により前記他のインタフェーステ
ーブルから読み出し、読み出された情報を使用して前記
いずれかの固有のプログラム部分を前記実行中のネイテ
ィブ化されたプログラム部分から呼び出すプログラム、 を更に備えることを特徴とする請求項7に記載のプログ
ラム実行制御プログラム。
8. Information for calling each of a plurality of unique program parts stored in a predetermined position in the native code dedicated area and provided in the interpreter from any of the nativeized program parts. The stored other interface table and information for calling any of the plurality of unique program parts while any of the plurality of native program parts is executing, the running nativeized program A program for reading from the other interface table by the part and using the read information to call any one of the unique program parts from the running nativeized program part. The program execution control program according to claim 7.
【請求項9】 前記他のインタフェーステーブルは、い
ずれかのネイティブ化されたプログラム部分から前記イ
ンタプリタを呼び出すための情報を更に格納しているテ
ーブルであり、 前記複数のネイティブ化されたプログラム部分のいずれ
かが実行中に、前記インタプリタを呼び出すための情報
を、当該実行中のプログラム部分により前記他のインタ
フェーステーブルから読み出し、前記インタプリタに関
して読み出された前記情報を使用して前記インタプリタ
を前記実行中のネイティブ化されたプログラム部分から
呼び出すプログラム、 を更に備えることを特徴とする請求項8に記載のプログ
ラム実行制御プログラム。
9. The other interface table is a table further storing information for calling the interpreter from any of the nativeized program parts, and any one of the plurality of nativeized program parts. During execution, information for calling the interpreter is read from the other interface table by the program part in execution, and the information read for the interpreter is used to execute the interpreter. 9. The program execution control program according to claim 8, further comprising: a program called from a nativeized program part.
JP2001267965A 2001-09-04 2001-09-04 Method and program for controlling program execution Pending JP2003076558A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001267965A JP2003076558A (en) 2001-09-04 2001-09-04 Method and program for controlling program execution

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001267965A JP2003076558A (en) 2001-09-04 2001-09-04 Method and program for controlling program execution

Publications (1)

Publication Number Publication Date
JP2003076558A true JP2003076558A (en) 2003-03-14

Family

ID=19094018

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001267965A Pending JP2003076558A (en) 2001-09-04 2001-09-04 Method and program for controlling program execution

Country Status (1)

Country Link
JP (1) JP2003076558A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008542927A (en) * 2005-06-02 2008-11-27 ザ マスワークス, インク Calling late-bound functions from an external program environment
US7490320B2 (en) * 2005-02-18 2009-02-10 International Business Machines Corporation Method and apparatus for transforming Java Native Interface function calls into simpler operations during just-in-time compilation
JP2009294773A (en) * 2008-06-03 2009-12-17 Ricoh Co Ltd Information processor, information processing method, information processing program and recording medium
JP2015011518A (en) * 2013-06-28 2015-01-19 京セラドキュメントソリューションズ株式会社 Method of reducing application execution time

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7490320B2 (en) * 2005-02-18 2009-02-10 International Business Machines Corporation Method and apparatus for transforming Java Native Interface function calls into simpler operations during just-in-time compilation
US7913240B2 (en) 2005-02-18 2011-03-22 International Business Machines Corporation Method and apparatus for transforming java native interface function calls into simpler operations during just-in-time compilation
JP2008542927A (en) * 2005-06-02 2008-11-27 ザ マスワークス, インク Calling late-bound functions from an external program environment
JP2009294773A (en) * 2008-06-03 2009-12-17 Ricoh Co Ltd Information processor, information processing method, information processing program and recording medium
JP2015011518A (en) * 2013-06-28 2015-01-19 京セラドキュメントソリューションズ株式会社 Method of reducing application execution time

Similar Documents

Publication Publication Date Title
US8082544B2 (en) Managing parameter access in a task managing system
US5835768A (en) Computer operating system providing means for formatting information in accordance with specified cultural preferences
US5535389A (en) Business process objects with associated attributes such as version identifier
JP2666847B2 (en) Heterogeneous language communication method
US6961931B2 (en) Dependency specification using target patterns
JPH02272627A (en) Digital computer system and method of invocation of procedure of the same
US7096456B2 (en) Method and apparatus for providing dynamically scoped variables within a statically scoped computer programming language
JP2000242501A (en) Information processor, information processing method and program writing device
JP2000187594A (en) Run time addition of interface
JP2004503866A (en) Modular computer system and related methods
US6948170B2 (en) Computer and computer-readable storage medium for command interpretation
US7228527B1 (en) Method and system for structuring a procedure
US20010042241A1 (en) Apparatus and method for executing program using just-in time-compiler system
JP2003076558A (en) Method and program for controlling program execution
US6275985B1 (en) Method and apparatus for developing an application that implements garbage collection efficiently by combining proxy objects with compiler support
CN113220327B (en) Intelligent contract upgrading method and block chain system
US5765148A (en) Database processing apparatus and database processing method for variable length objects, and computer-readable memory medium for storing database processing program
US6311227B1 (en) Procedure calling method
CN114866451B (en) iOS end route communication improvement method, device, storage medium and equipment
JP3006505B2 (en) Apparatus and method for modifying a program including a parallel process, and a storage medium for storing the modified program
JPS6310239A (en) Patch production system for high-level language
AU2011204916B2 (en) Managing parameter access in a task managing system
JP3327640B2 (en) Instruction code selection device
JPH01207824A (en) Module coupling control system
JPH06266562A (en) Object code size optimizing system in object-oriented language processing system

Legal Events

Date Code Title Description
RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20050309

RD05 Notification of revocation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7425

Effective date: 20050323

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20061017

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070227