JP2000311091A - Cache method and its device for symbol reference information - Google Patents

Cache method and its device for symbol reference information

Info

Publication number
JP2000311091A
JP2000311091A JP11123174A JP12317499A JP2000311091A JP 2000311091 A JP2000311091 A JP 2000311091A JP 11123174 A JP11123174 A JP 11123174A JP 12317499 A JP12317499 A JP 12317499A JP 2000311091 A JP2000311091 A JP 2000311091A
Authority
JP
Japan
Prior art keywords
interpreter
execution module
execution
symbol
information
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.)
Granted
Application number
JP11123174A
Other languages
Japanese (ja)
Other versions
JP3424596B2 (en
Inventor
Toshihiko Nakamura
寿彦 中村
Kazutoshi Usui
和敏 臼井
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 JP12317499A priority Critical patent/JP3424596B2/en
Publication of JP2000311091A publication Critical patent/JP2000311091A/en
Application granted granted Critical
Publication of JP3424596B2 publication Critical patent/JP3424596B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To obtain a storage area to absolute min. and to improve operation speed in the case of execution in the co-existing execution of an execution module and an interpreter code. SOLUTION: The execution module 4 is generated by compiling from an input file being a form to be executed in an interpreter system 5 and executed in cooperation with a prepared run-time environment in an information processor. In the information processor, a management array (symbol pointer array) 10 is independently provided. When a first dissolving processing is executed, the result is recorded in the execution module 4 simultaneously with the internal processing of the interpreter and it is utilized after that so that an overhead with the dissolving processing is reduced.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、インタプリタで実
行できる形式の入力ファイルから、コンパイルにより実
行モジュールを作成し、あらかじめ用意された実行(ラ
ンタイム)環境と協調して実行する情報処理装置におい
て用いられる、シンボル参照情報のキャッシュ方法なら
びに装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention is used in an information processing apparatus that creates an execution module by compiling from an input file in a format that can be executed by an interpreter, and executes the module in cooperation with an execution (runtime) environment prepared in advance. And a method and an apparatus for caching symbol reference information.

【0002】[0002]

【従来の技術】プログラム言語は、情報処理装置での実
行形態から区別すると、コンパイルされるものと、イン
タプリタによりインタプリテーションされるものに二分
される。前者はソースプログラムをコンパイルして特定
のコンピュータアーキテクチャに合わせそのコンピュー
タが実行できる機械語に変換する。CやCOBOLがこ
の代表である。後者は、一旦中間形式のプログラムコー
ドに変換され、この中間形式のプログラムコードをイン
タプリタにより逐次解釈しながら実行する。こちらはコ
ンパイル処理を要しないが実行時に逐次変換を要するた
め実行速度が遅いのが欠点であり、BASICやJav
aもこれにあたる。一方、コンパイラとインタプリタ双
方の利点を持つハイブリッド・コンパイラ・インタプリ
タが、特開平6−230976号「参照をリゾルブする
方法及び装置」に開示されている。ここには、コンパイ
ラによって実行可能なコードが生成され、コンパイルさ
れたコードを解釈するインタプリタにより、生成された
コードにおいてデータ参照をリゾルブ(解決)するため
の方法ならびに装置が詳細に説明されている。
2. Description of the Related Art Program languages can be divided into those compiled and those interpreted by an interpreter when distinguished from the form of execution in an information processing apparatus. The former compiles a source program and converts it into a machine language that can be executed by the computer according to a specific computer architecture. C and COBOL are representatives of this. The latter is temporarily converted into an intermediate-format program code, and the intermediate-format program code is executed while being sequentially interpreted by an interpreter. This method does not require compile processing, but has the disadvantage that the execution speed is slow because sequential conversion is required at the time of execution. BASIC or Java
a corresponds to this. On the other hand, a hybrid compiler interpreter having advantages of both a compiler and an interpreter is disclosed in Japanese Patent Application Laid-Open No. Hei 6-230976 "Method and Apparatus for Resolving References". It describes in detail a method and apparatus for resolving data references in generated code by an interpreter that generates code executable by a compiler and interprets the compiled code.

【0003】[0003]

【発明が解決しようとする課題】ところで、インタプリ
タ単独では、メソッドやオブジェクト、定数等のシンボ
ルの解決処理は、最初のアクセス時に参照位置を記録
し、2度目以降は記録した参照位置に直接アクセスする
ことでこのシンボル情報の実体にアクセスする。この仕
組みとして、最初の命令実行後に、その命令自体を書き
換えることで、シンボル解決処理が終了しているか否か
を高速に判別し、実行できるようになっている。しかし
ながら、コンパイラにより生成される実行モジュール
は、インタプリタで管理しているシンボルの解決とは無
関係に処理される。従って、前記公報に開示されている
ように、インタプリタとネイティブコードが混在し協調
して実行する場合、インタプリタと無関係なシンボル解
決処理は、インタプリタを通じたプログラムの実行に不
都合が生じる。また、命令の書き換えも出来ないため、
実行速度を犠牲にすることなく解決処理を行なうための
方法ならびに装置の登場が望まれていた。本発明は上記
事情に鑑みてなされたものであり、インタプリタで実行
できる形式の入力ファイルから、コンパイルにより実行
モジュールを作成し、あらかじめ用意したランタイム環
境と協調して実行する情報処理装置において、記憶領域
を必要最小限にとどめ、かつ、実行時の動作速度を向上
させることのできる、シンボル参照情報のキャッシュ方
法ならびに装置を提供することを目的とする。
By the way, with the interpreter alone, in the process of resolving symbols such as methods, objects, and constants, the reference position is recorded at the first access, and the recorded reference position is directly accessed from the second time. To access the entity of this symbol information. As this mechanism, by rewriting the instruction itself after the execution of the first instruction, it is possible to determine at a high speed whether or not the symbol solving process has been completed and execute it. However, the execution module generated by the compiler is processed independently of the resolution of the symbol managed by the interpreter. Therefore, as disclosed in the above publication, when the interpreter and the native code coexist and execute cooperatively, the symbol solving process unrelated to the interpreter causes a problem in executing the program through the interpreter. Also, since instructions cannot be rewritten,
There has been a desire for a method and apparatus for performing a solution process without sacrificing execution speed. The present invention has been made in view of the above circumstances, and an information processing apparatus that creates an execution module by compiling from an input file in a format that can be executed by an interpreter and executes the execution module in cooperation with a runtime environment prepared in advance, It is an object of the present invention to provide a method and an apparatus for caching symbol reference information, which can minimize the number of symbols and improve the operation speed at the time of execution.

【0004】[0004]

【課題を解決するための手段】上述した課題を解決する
ために請求項1に記載のシンボル参照情報のキャッシュ
方法は、インタプリタで実行できる形式の入力ファイル
から、コンパイルにより実行モジュールを作成し、あら
かじめ用意したランタイム環境と協調して実行する情報
処理装置において、前記インタプリタは、命令のオペラ
ンドとして、前記コンパイラにより生成されるシンボル
情報の管理用配列のインデックスを持ち、前記実行モジ
ュールにないシンボル情報を参照する際、前記インタプ
リタを介して実行モジュールをアクセスし、前記オペラ
ンドを含む命令を更新することによってシンボル情報の
解決処理を実行すると共に前記実行モジュールにもその
内容を記録し、以降、前記オペランドのポインタを用い
前記シンボル情報を参照することを特徴とする。請求項
2に記載のシンボル情報のキャッシュ方法は、請求項1
に記載のシンボル情報の参照方法において、前記コンパ
イラによって生成される整数配列に初期値を記録するこ
とにより、前記インタプリタを介してシンボル情報の参
照を行うと共に、シンボル情報の実態へのポインタ情報
を実行モジュール内の整数配列に記録された値を参照す
ることにより、前記シンボルの解決処理をコンパイル
時、もしくは実行時の初回の1回に限定して実行するこ
とを特徴とする。
According to a first aspect of the present invention, there is provided a method for caching symbol reference information, comprising the steps of: compiling an execution module from an input file in a format executable by an interpreter; In an information processing apparatus that executes in cooperation with a prepared runtime environment, the interpreter has, as an operand of an instruction, an index of a management array of symbol information generated by the compiler, and refers to symbol information not included in the execution module. In doing so, the execution module is accessed via the interpreter, the symbol information is resolved by updating the instruction including the operand, and the content is also recorded in the execution module. Using the symbol information And wherein the reference. According to a second aspect of the present invention, there is provided a symbol information caching method.
In the method of referring to symbol information described in 1, the symbol information is referenced through the interpreter by recording an initial value in an integer array generated by the compiler, and pointer information to the actual state of the symbol information is executed. By referring to the values recorded in the integer array in the module, the symbol resolution processing is executed only at the time of compiling or the first time at the time of execution.

【0005】請求項3に記載のシンボル情報のキャッシ
ュ装置は、インタプリタで実行できる形式の入力ファイ
ルから、コンパイルにより実行モジュールを作成し、あ
らかじめ用意したランタイム環境と協調して実行する情
報処理装置において、命令のオペランドとして、前記コ
ンパイラにより生成されるシンボル情報の管理用配列の
インデックスを持ち、前記実行モジュールにないシンボ
ル情報を参照する際、実行モジュールをアクセスする前
記インタプリタ中の第1の手段と、前記オペランドを含
む命令を更新することによってシンボル情報の解決処理
を実行すると共に、前記実行モジュールにその内容を記
録する前記インタプリタ中の第2の手段と、以降、前記
オペランドのポインタを用い前記シンボル情報を参照す
る前記実行モジュール中の手段とを有することを特徴と
する。
According to a third aspect of the present invention, there is provided an information processing apparatus for creating an execution module by compiling from an input file in a format executable by an interpreter and executing the execution module in cooperation with a runtime environment prepared in advance. First means in the interpreter having an index of a management array of symbol information generated by the compiler as an operand of the instruction and accessing an execution module when referring to symbol information not present in the execution module; A second means in the interpreter for executing a symbol information solving process by updating an instruction including an operand and recording the content of the symbol information in the execution module. The execution module to be referenced And having a means in the Le.

【0006】上述した構成において、独自に管理配列を
持ち、最初の解決処理時に、インタプリタの内部処理と
同時に実行モジュールにもその結果を記録し、以降それ
を利用することで解決処理に伴うオーバヘッドの軽減が
達成できる。特に、同一関数を何度もコールしたり、同
一変数に何度もアクセスするようなプログラムにおいて
大幅な実行速度向上が望める。また、コンパイル時に静
的に決定できるシンボルに関しては、コンパイル時にそ
の結果を実行モジュール内に保持することで、どのよう
なプログラムであっても、処理速度の大幅な軽減が達成
できる。
[0006] In the above-described configuration, the result is recorded in the execution module at the same time as the internal processing of the interpreter at the time of the first solution processing, and the overhead associated with the solution processing is used by using it thereafter. Reduction can be achieved. In particular, a significant improvement in execution speed can be expected for a program that calls the same function many times or accesses the same variable many times. Also, for symbols that can be determined statically at compile time, by storing the result in an execution module at compile time, the processing speed of any program can be significantly reduced.

【0007】[0007]

【発明の実施の形態】図1は本発明の実施形態を示すブ
ロック図である。図において、1は、インタプリット実
行される入力プログラムであり、インタプリッテッド・
コード・コンパイラ(以下、単にコンパイラ2という)
ならびにインタプリタシステム5に供給される。3はコ
ンパイラ2により変換されて出力されるアセンブリコー
ドファイルである。4はコンパイラ2により生成される
アセンブリコードを実行形式のロードモジュールに変換
した実行モジュールである。5は入力プログラム1を逐
次解釈実行するインタプリタシステムである。入力され
るプログラム1は、インタプリタシステム5で、逐次解
釈実行できる形式のファイルであり、実行時、実行モジ
ュール4は、インタプリタシステム5を構成するプログ
ラムモジュールから呼び出され動作を開始する。実行開
始後も必要な時に随時インタプリタシステム5が呼び出
される。コンパイラ2は、インタプリタシステム5で解
釈実行できる形式のファイルを入力とし、その内容を読
み取り、同等の処理をするアセンブリコードファイル3
を生成出力する。そのアセンブリコードファル3には、
インタプリタシステム5における変数や関数等のシンボ
ル管理分の整数配列が備えられ、初期値として“0”が
記録されている。ここで生成され出力されるアセンブリ
コードファイル3は、通常のアセンブラ等を用いて実行
モジュール4に変換する。
FIG. 1 is a block diagram showing an embodiment of the present invention. In the figure, reference numeral 1 denotes an input program to be interpreted,
Code compiler (hereinafter simply referred to as compiler 2)
And to the interpreter system 5. Reference numeral 3 denotes an assembly code file converted and output by the compiler 2. Reference numeral 4 denotes an execution module obtained by converting an assembly code generated by the compiler 2 into a load module in an execution format. Reference numeral 5 denotes an interpreter system for sequentially interpreting and executing the input program 1. The input program 1 is a file in a format that can be sequentially interpreted and executed by the interpreter system 5. At execution, the execution module 4 is called from a program module constituting the interpreter system 5 and starts operation. The interpreter system 5 is called whenever necessary after the start of execution. The compiler 2 receives as input a file in a format that can be interpreted and executed by the interpreter system 5, reads its contents, and performs an equivalent process on the assembly code file 3
Generate and output The assembly code file 3 contains:
An integer array for managing symbols such as variables and functions in the interpreter system 5 is provided, and “0” is recorded as an initial value. The assembly code file 3 generated and output here is converted into an execution module 4 using a normal assembler or the like.

【0008】図2、図3は、図1に示す本発明実施形態
の動作を説明するために引用した図であり、それぞれ、
実行モジュールとインタプリタコードを混在実行する際
の動作概要、インタプリタシステムと実行モジュールに
よるシンボル解決処理の概要を示す図である。図2は、
実行モジュール4とインタプリタシテスム5、そして、
インタプリタシステム5が読み込んで実行する入力プロ
グラム1、6がどのように連携して実行するかを概略表
現したものである。入力プログラム1は、図1における
入力プログラムと同一のもので、実行モジュール4の変
換前のコードである。入力プログラム6は、入力プログ
ラム1から呼び出し、または呼び出されて実行されるプ
ログラムである。図3は、シンボル解決処理を説明する
ために引用した図であり、インタプリタシステム5は、
入力プログラム1、6を入力として動作するが、メソッ
ドやオブジェクト、定数などのシンボル類11は、その
管理用配列(シンボル・ポインタ・アレイ)10からポ
インタを使って参照されており、命令のオペランドとし
て、その配列のインデックスを持ち、実体にアクセスで
きる仕組みになっている。インタプリタシステム5単独
で実行するときには、命令とオペランドを書き換え、メ
ソッドやオブジェクトなどのシンボル類11を直接指定
するようになっている。このオペランド参照の書き換え
作業をシンボル解決処理と呼ぶ。
FIGS. 2 and 3 are views cited for explaining the operation of the embodiment of the present invention shown in FIG.
FIG. 3 is a diagram illustrating an outline of an operation when an execution module and an interpreter code are mixedly executed, and an outline of a symbol solving process performed by the interpreter system and the execution module. FIG.
The execution module 4 and the interpretation system 5, and
This is a schematic representation of how the input programs 1 and 6 read and executed by the interpreter system 5 cooperate and execute. The input program 1 is the same as the input program in FIG. The input program 6 is a program that is called from the input program 1 or is called and executed. FIG. 3 is a diagram cited for explaining the symbol solving process, and the interpreter system 5 includes:
The operation is performed using the input programs 1 and 6 as input. Symbols 11 such as methods, objects, and constants are referred to by a pointer from a management array (symbol pointer array) 10 and used as operands of instructions. , Has an index of the array, and can access the entity. When executed by the interpreter system 5 alone, instructions and operands are rewritten, and symbols 11 such as methods and objects are directly designated. This rewriting operation of the operand reference is referred to as a symbol solving process.

【0009】以下、図1に示す本発明実施形態の動作に
ついて、図2乃至図3を参照しながら詳細に説明する。
実行時には、実行モジュール4を用いて実行するが、実
行モジュール4が、実行モジュール4にないオブジェク
ト・アクセス、メソッド・コールなどでは、インタプリ
タシステム5を呼び出し実行する。このような形で実行
する場合、入力したプログラム1内で閉じた変数、定数
等に関しては、ネイティブ独自に管理、実行できるが、
入力したプログラム1内のオブジェクト、メソッドや、
定数等、他のプログラムモジュール6からアクセスする
可能性のあるものは、そのアクセスするプログラムが、
インタプリタシステム5で解釈実行されている可能性が
あるため、実行モジュール4とインタプリタシステム5
が連携する仕組みが必要となる。
Hereinafter, the operation of the embodiment of the present invention shown in FIG. 1 will be described in detail with reference to FIGS.
At the time of execution, the execution is performed using the execution module 4, but the execution module 4 calls and executes the interpreter system 5 for an object access, a method call, or the like that is not included in the execution module 4. When executing in such a form, variables and constants closed in the input program 1 can be natively managed and executed independently.
Objects, methods, etc. in the input program 1
Those that may be accessed from other program modules 6, such as constants, are as follows:
The execution module 4 and the interpreter system 5 may be interpreted and executed by the interpreter system 5.
A mechanism to cooperate is required.

【0010】ここでは、メソッドに関し、インタプリタ
システム5を通じて実行モジュール4にアクセスするよ
うになっており、オブジェクトに関しては、入力プログ
ラム1を使い、これをインタプリタシステム5に入力し
て、インタプリタシステム5単独で実行するときと同じ
方式で管理する。実行モジュール4の実行時、それらの
オブジェクトにアクセスするときも、入力プログラム1
のオブジェクト管理形式を使う。また、入力プログラム
以外のモジュール6のメソッド、オブジェクトにアクセ
スする場合も、メソッドはインタプリタシステム5を通
じてコールし、オブジェクトはインタプリタシステム5
の方式でアクセスする。この実行モジュール4と、イン
タプリタシステム5とが連携して実行することを、以
降、(実行モジュールとインタプリタコードの)混在実
行と呼ぶ。インタプリタシステム5単独での実行の場
合、上述したシンボルの解決処理により、2度目のアク
セス以降、シンボル情報はオペランドのポインタを使っ
て高速にアクセスできる。
[0010] Here, for the method, the execution module 4 is accessed through the interpreter system 5, and for the object, the input program 1 is used and input to the interpreter system 5, and the interpreter system 5 alone uses the input program 1. Manage in the same way as when you run it. When executing the execution module 4 and accessing these objects, the input program 1
Use the object management format of When accessing a method or an object of the module 6 other than the input program, the method is called through the interpreter system 5 and the object is accessed by the interpreter system 5.
Access by the method of. The execution of the execution module 4 and the interpreter system 5 in cooperation with each other is hereinafter referred to as mixed execution (execution module and interpreter code). In the case of execution by the interpreter system 5 alone, the symbol information can be accessed at a high speed using the pointer of the operand after the second access due to the symbol resolution processing described above.

【0011】ここで、問題となるのは、インタプリタシ
ステム5と、実行モジュール4との混在実行において
は、インタプリタシステム5の実行が実行モジュール
の実行に比べ遅く、このインタプリタシテスム5を通じ
たシンボル解決処理や、シンボル解決したシンボルか否
かを調べる処理に関しても、実行と同様、実行モジュー
ル4の処理を遅くさせる要因となっていることである。
シンボル解決処理は、インタプリタシステム5内の仕組
みを使えば、同一シンボルのアクセスに対して、一度だ
けで済むが、実行モジュール4との混在実行において
は、そのシンボルを解決したか否かを調べるためだけで
インタプリタシステム5との混在実行が必要となる。そ
こで、コンパイラ2が、アセンブリコードファイル3を
出力する時、そのアセンブリコードファイル3に、イン
タプリタシステム5におけるオブジェクトやメソッドな
どのシンボル管理用の整数配列(シンボル・ポインタ・
アレイ)10を用意し、初期値として“0”を持たせ
る。最初のシンボル解決処理時に、インタプリタシステ
ム5を通じシンボル解決をすると同時に、シンボルの実
体へのポインタの情報を、実行モジュール4内の整数配
列13に記録する。シンボルには、定数の参照など、コ
ンパイル時に決定できる情報もあるので、これらの情報
に関しては、コンパイル時に決定し、アセンブリコード
ファイル3の出力段階で、その定数などを記録する。コ
ンパイル段階で決定するか、第1回目の実行で決定する
かの判断は、整数配列に“0”が入っているか、それ以
外の値が入っているかによって区別する。
The problem here is that in the mixed execution of the interpreter system 5 and the execution module 4, the execution of the interpreter system 5 is slower than the execution of the execution module, and the symbol resolution processing through the interpreter system 5 is performed. Also, the process of checking whether or not a symbol has been resolved is a factor that slows down the process of the execution module 4 as in the case of execution.
The symbol resolution processing is performed only once for access to the same symbol if the mechanism in the interpreter system 5 is used. However, in the mixed execution with the execution module 4, it is necessary to check whether or not the symbol has been resolved. Alone, mixed execution with the interpreter system 5 is required. Therefore, when the compiler 2 outputs the assembly code file 3, the assembly code file 3 includes an integer array (symbol, pointer, pointer, etc.) for managing symbols such as objects and methods in the interpreter system 5.
Array) 10 is prepared and "0" is given as an initial value. At the time of the first symbol resolution processing, the symbol is resolved through the interpreter system 5 and, at the same time, the information of the pointer to the entity of the symbol is recorded in the integer array 13 in the execution module 4. Since some symbols have information that can be determined at the time of compilation, such as reference to constants, such information is determined at the time of compilation, and the constants and the like are recorded at the output stage of the assembly code file 3. The determination as to whether the determination is made at the compilation stage or at the first execution is distinguished depending on whether "0" is included in the integer array or other values are included.

【0012】これらの処理によって、実行モジュール4
からのシンボル参照に関しても、シンボル解決処理をコ
ンパイル時、または実行時の最初の一度に限定し、か
つ、そのシンボルが解決処理を行なったか否かを実行モ
ジュール4単独で処理できるようになる。つまり、実行
速度を高速化できる。シンボルの解決処理で得られるの
は、アドレス、または定数である。定数の場合、解決処
理によって、“0”が入る可能性があるが、その場合は
未解決であると判断して、解決処理を実行しても問題は
生じない。また、“0”が入るケースはプログラムの性
質上ほとんど皆無と言って良く、処理速度への影響も最
小限に押さえられる。
With these processes, the execution module 4
As for the symbol reference from, the symbol resolution processing is limited to the first time at the time of compilation or at the time of execution, and whether or not the symbol has been resolved can be processed by the execution module 4 alone. That is, the execution speed can be increased. What is obtained by symbol resolution processing is an address or a constant. In the case of a constant, there is a possibility that “0” may be entered depending on the solution processing. In addition, it can be said that there is almost no case where "0" is entered due to the nature of the program, and the influence on the processing speed is minimized.

【0013】[0013]

【発明の効果】インタプリタの処理速度は、実行モジュ
ール4の動作に比べて遅く、インタプリタの処理をいか
に減らすかということが処理速度向上のための重要設計
事項となり、また、インタプリタと異なり、命令の書き
換えができないネイティブコードでは、解決処理による
オーバヘッドをいかに軽減するかが処理速度向上のため
の重要設計事項となる。インタプリタの内部の仕組みを
利用して、解決処理を一度だけにすることは可能である
が、インタプリタとの混在実行はなくならない。そこ
で、独自に管理配列を持ち、最初の解決処理時に、イン
タプリタの内部処理と同時に、実行モジュールにもその
結果を記録し、以降それを利用することで解決処理に伴
うオーバヘッドの軽減が達成できる。本発明は、特に、
同一関数を何度もコールしたり、同一変数に何度もアク
セスするようなプログラムにおいて大幅な実行速度向上
が望める。また、コンパイル時に静的に決定できるシン
ボルに関しては、コンパイル時にその結果を実行モジュ
ール内に保持することで、どのようなプログラムであっ
ても、処理速度の大幅な軽減が達成できる。
The processing speed of the interpreter is slower than the operation of the execution module 4, and how to reduce the processing of the interpreter is an important design item for improving the processing speed. For native code that cannot be rewritten, how to reduce the overhead due to the solution processing is an important design item for improving the processing speed. Although it is possible to perform the resolution process only once using the internal mechanism of the interpreter, mixed execution with the interpreter is not eliminated. Therefore, the management array is independently provided, and the result is recorded in the execution module at the same time as the internal processing of the interpreter at the time of the first solution processing, and by using the result thereafter, the overhead associated with the solution processing can be reduced. The present invention, in particular,
Significant improvement in execution speed can be expected for a program that calls the same function many times or accesses the same variable many times. Also, for symbols that can be determined statically at compile time, by storing the result in an execution module at compile time, the processing speed of any program can be significantly reduced.

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

【図1】 本発明の実施形態を示すブロック図である。FIG. 1 is a block diagram showing an embodiment of the present invention.

【図2】 図1における本発明実施形態の実行モジュー
ルとインタプリタによる混在実行時の動作概要を示す図
である。
FIG. 2 is a diagram showing an outline of operation at the time of mixed execution by an execution module and an interpreter according to the embodiment of the present invention in FIG. 1;

【図3】 図1における本発明実施形態のシンボル解決
処理の概要を示す図である。
FIG. 3 is a diagram showing an outline of a symbol solving process according to the embodiment of the present invention in FIG. 1;

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

1(6)…入力プログラム、2…インタプリッテッド・
コード・コンパイラ(コンパイラ)、3…アセンブリ・
コード・ファイル、4…実行モジュール(ロードモジュ
ール)、5…インタプリタシステム、10…シンボル管
理用配列、11…シンボル類
1 (6) ... input program, 2 ... interpreted
Code compiler (compiler), 3 ... assembly
Code file, 4 ... Execution module (load module), 5 ... Interpreter system, 10 ... Symbol management array, 11 ... Symbols

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 インタプリタで実行できる形式の入力フ
ァイルから、コンパイルにより実行モジュールを作成
し、あらかじめ用意した実行環境と協調して実行する情
報処理装置において、前記インタプリタは、命令のオペ
ランドとして、前記コンパイラにより生成されるシンボ
ル情報の管理用配列のインデックスを持ち、前記実行モ
ジュールにないシンボル情報を参照する際、前記インタ
プリタを介して実行モジュールをアクセスし、前記オペ
ランドを含む命令を更新することによってシンボル情報
の解決処理を実行すると共に前記実行モジュールにもそ
の内容を記録し、以降、前記オペランドのポインタを用
い前記シンボル情報を参照することを特徴とするシンボ
ル参照情報のキャッシュ方法。
1. An information processing apparatus for creating an execution module by compiling from an input file in a format that can be executed by an interpreter and executing the module in cooperation with an execution environment prepared in advance, wherein the interpreter uses the compiler as an operand of an instruction. Has an index of a management array of symbol information generated by the above, and refers to the symbol information not in the execution module, accesses the execution module via the interpreter, and updates the instruction including the operand to obtain the symbol information. Wherein the contents of the execution module are recorded and the symbol information is referred to using the pointer of the operand thereafter.
【請求項2】 前記コンパイラによって生成される整数
配列に初期値を記録することにより、前記インタプリタ
を介してシンボル情報の参照を行うと共に、シンボル情
報の実態へのポインタ情報を実行モジュール内の整数配
列に記録された値を参照することにより、前記シンボル
の解決処理をコンパイル時、もしくは実行時の初回の1
回に限定して実行することを特徴とする請求項1に記載
のシンボル参照情報のキャッシュ方法。
2. An initial value is recorded in an integer array generated by the compiler so that symbol information is referred to through the interpreter and pointer information to the actual state of the symbol information is stored in an integer array in an execution module. By referring to the value recorded in the first time at the time of compiling or executing the symbol resolution processing at the first time.
2. The method according to claim 1, wherein the method is executed only once.
【請求項3】 インタプリタで実行できる形式の入力フ
ァイルから、コンパイルにより実行モジュールを作成
し、あらかじめ用意した実行環境と協調して実行する情
報処理装置において、命令のオペランドとして、前記コ
ンパイラにより生成されるシンボル情報の管理用配列の
インデックスを持ち、前記実行モジュールにないシンボ
ル情報を参照する際、実行モジュールをアクセスする前
記インタプリタ中の第1の手段と、前記オペランドを含
む命令を更新することによってシンボル情報の解決処理
を実行すると共に、前記実行モジュールにその内容を記
録する前記インタプリタ中の第2の手段と、以降、前記
オペランドのポインタを用い前記シンボル情報を参照す
る前記実行モジュール中の手段とを有することを特徴と
するシンボル参照情報のキャッシュ装置。
3. An information processing apparatus which creates an execution module by compiling from an input file in a format executable by an interpreter and executes the module in cooperation with an execution environment prepared in advance, the information processing apparatus being generated by the compiler as an operand of an instruction. A first means in the interpreter for accessing an execution module having an index of an array for managing symbol information and referring to the symbol information which is not in the execution module, and updating the instruction including the operand to obtain the symbol information. A second means in the interpreter for executing the solution processing and recording the content in the execution module, and a means in the execution module for referring to the symbol information using the pointer of the operand. Symbol reference information characterized by the following: Cache device.
JP12317499A 1999-04-28 1999-04-28 Method and apparatus for caching symbol reference information Expired - Fee Related JP3424596B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP12317499A JP3424596B2 (en) 1999-04-28 1999-04-28 Method and apparatus for caching symbol reference information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP12317499A JP3424596B2 (en) 1999-04-28 1999-04-28 Method and apparatus for caching symbol reference information

Publications (2)

Publication Number Publication Date
JP2000311091A true JP2000311091A (en) 2000-11-07
JP3424596B2 JP3424596B2 (en) 2003-07-07

Family

ID=14854028

Family Applications (1)

Application Number Title Priority Date Filing Date
JP12317499A Expired - Fee Related JP3424596B2 (en) 1999-04-28 1999-04-28 Method and apparatus for caching symbol reference information

Country Status (1)

Country Link
JP (1) JP3424596B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62113244A (en) * 1985-11-12 1987-05-25 Omron Tateisi Electronics Co Program test device
JPH06230976A (en) * 1992-12-22 1994-08-19 Sun Microsyst Inc Method and apparatus for resolution of reference
JPH07168718A (en) * 1993-12-14 1995-07-04 Kobe Nippon Denki Software Kk Program executing device by interpreter
JPH10111801A (en) * 1996-10-03 1998-04-28 Matsushita Electric Ind Co Ltd Program call controller

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62113244A (en) * 1985-11-12 1987-05-25 Omron Tateisi Electronics Co Program test device
JPH06230976A (en) * 1992-12-22 1994-08-19 Sun Microsyst Inc Method and apparatus for resolution of reference
JPH07168718A (en) * 1993-12-14 1995-07-04 Kobe Nippon Denki Software Kk Program executing device by interpreter
JPH10111801A (en) * 1996-10-03 1998-04-28 Matsushita Electric Ind Co Ltd Program call controller

Also Published As

Publication number Publication date
JP3424596B2 (en) 2003-07-07

Similar Documents

Publication Publication Date Title
US5586328A (en) Module dependency based incremental compiler and method
US6078744A (en) Method and apparatus for improving compiler performance during subsequent compilations of a source program
US7877741B2 (en) Method and corresponding apparatus for compiling high-level languages into specific processor architectures
JP4640685B2 (en) Program code conversion method
US7856618B2 (en) Adaptively generating code for a computer program
US7409678B2 (en) Compiler, compilation and storage
US8522223B2 (en) Automatic function call in multithreaded application
JPH08339304A (en) Method and apparatus for generation of platform standard object file containing machine independence code
JP2008546086A (en) Method and apparatus for translating program code with access coordination for shared resources
JP2000347871A (en) Automatic stub/adapter generator
EP1049011A2 (en) Method and apparatus for handling exceptions as normal control flow
JP4806060B2 (en) Compiler program, compiling method, and computer system
EP1929399A2 (en) System and method for creating and using graphical object instances in a statechart environment
EP1782193A1 (en) Generating unwind information for optimized programs
US20120159463A1 (en) Method and system for creating, applying, and removing a software fix
US20160246622A1 (en) Method and system for implementing invocation stubs for the application programming interfaces embedding with function overload resolution for dynamic computer programming languages
KR100577366B1 (en) Method and apparatus for executing different forms of java methods
US8214815B2 (en) Reducing the run-time cost of invoking a server page
US11782774B2 (en) Implementing optional specialization when compiling code
Anderson et al. Experience report: Developing the Servo web browser engine using Rust
JP4093484B2 (en) Compiler, compilation method, compilation program, and recording medium
JP3424596B2 (en) Method and apparatus for caching symbol reference information
Hlopko et al. On the integration of Smalltalk and Java: practical experience with STX: LIBJAVA
Pichler et al. Hybrid Execution: Combining Ahead-of-Time and Just-in-Time Compilation
JPH11212807A (en) Program execution method

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20030401

LAPS Cancellation because of no payment of annual fees