JPH11154095A - Operation method and device and transmission medium - Google Patents

Operation method and device and transmission medium

Info

Publication number
JPH11154095A
JPH11154095A JP32273697A JP32273697A JPH11154095A JP H11154095 A JPH11154095 A JP H11154095A JP 32273697 A JP32273697 A JP 32273697A JP 32273697 A JP32273697 A JP 32273697A JP H11154095 A JPH11154095 A JP H11154095A
Authority
JP
Japan
Prior art keywords
code
address
variable
generating
selecting
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.)
Withdrawn
Application number
JP32273697A
Other languages
Japanese (ja)
Inventor
Yorihisa Fujinami
順久 藤波
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.)
Sony Corp
Original Assignee
Sony 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 Sony Corp filed Critical Sony Corp
Priority to JP32273697A priority Critical patent/JPH11154095A/en
Publication of JPH11154095A publication Critical patent/JPH11154095A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PROBLEM TO BE SOLVED: To automatically perform optimization processing in executing plural objects. SOLUTION: A method (r) which is calling itself in a step S22 by termination recursion by using another element object as an argument is retrieved from methods of container objects selected in a step S21. In a step S23, an address variable showing the address of an element code is added corresponding to an element variable used by the method (r) or method (s), and in a step S24, the method of the container object is rewritten so that the address of the corresponding code is substituted in the original variable. In a step S25, a code generation key is generated for a method (s) having the method (r) expanded in line only once among methods (s) calling the method (r) and in a step S26, its code generation system is separated into the method (s) and method (r).

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、演算方法および装
置、並びに伝送媒体に関し、特に、オブジェクト指向型
言語を実行時に最適化する演算方法および装置、並びに
伝送媒体に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an arithmetic method and apparatus, and more particularly, to an arithmetic method and apparatus for optimizing an object-oriented language at the time of execution, and a transmission medium.

【0002】[0002]

【従来の技術】プログラムの実行時にマシンコードを生
成する方法は、実行時の変数の値に応じた最適化(実行
時最適化)を実施できるので、プログラムの性能を向上
させることができる。以下に、この実行時にマシンコー
ドを生成する方法を説明する。
2. Description of the Related Art A method of generating a machine code at the time of executing a program can perform optimization (execution-time optimization) according to the value of a variable at the time of execution, so that the performance of the program can be improved. Hereinafter, a method of generating the machine code at the time of this execution will be described.

【0003】図11は通常のプログラムの、コンパイル
から実行までの一連のプロセスを示す図である。ソース
プログラムは、コンパイラおよびリンカなどにより実行
可能ファイルに変換される。そして、得られた実行可能
ファイルは、ハードディスク装置などの外部メモリに格
納された後、必要に応じてRAM(Random Access Memo
ry)などの内部メモリに読み込まれる。読み込まれたフ
ァイルはCPU(Central Processing Uint)が実行可
能なマシンコードであり、このマシンコードを実行する
ことにより所望の処理がなされる。
FIG. 11 is a diagram showing a series of processes from compilation to execution of a normal program. The source program is converted into an executable file by a compiler and a linker. Then, the obtained executable file is stored in an external memory such as a hard disk device, and then, if necessary, a RAM (Random Access Memory) is stored.
ry). The read file is a machine code executable by a CPU (Central Processing Unit), and a desired process is performed by executing the machine code.

【0004】図12は、実行時にコード生成を行うプロ
グラムの、コンパイルから実行までの一連のプロセスを
示す図である。図11における場合と同様に、ソースプ
ログラムは、コンパイラおよびリンカにより実行可能フ
ァイルに変換される。そして、得られた実行可能ファイ
ルは、ハードディスク装置などの外部メモリに格納され
た後、必要に応じてRAMなどの内部メモリに読み込ま
れる。内部メモリに読み込まれたファイルは、マシンコ
ードで記述されており、このマシンコードを実行する
と、例えば操作者の入力などのような実行時の定数をも
とに最適化されたマシンコードが更に生成され、その最
適化されたマシンコードをCPUが実行することにより
所望の処理が更に高速に実行される。
FIG. 12 is a diagram showing a series of processes from compilation to execution of a program for generating a code at the time of execution. As in the case of FIG. 11, the source program is converted into an executable file by a compiler and a linker. Then, the obtained executable file is stored in an external memory such as a hard disk device, and then read into an internal memory such as a RAM as needed. The file read into the internal memory is described in machine code, and when this machine code is executed, optimized machine code is further generated based on execution-time constants such as operator input. Then, the CPU executes the optimized machine code, whereby desired processing is executed at a higher speed.

【0005】以上のように、実行時にコード生成を行う
プログラムでは、実行時定数に応じた最適化を行うこと
ができるので、処理を高速化することができる。
As described above, in a program for generating a code at the time of execution, optimization can be performed in accordance with an execution time constant, so that processing can be speeded up.

【0006】このように実行時にマシンコードを生成す
る方法は、部分計算の一種であり、古くは自己改変コー
ドのような特殊な方法に用いられてきた。近年では、タ
ーゲットマシンに依存しない実行時コード生成ルーチン
の記述方法や言語が提案されており、一般的な方法にな
りつつある。また、実行時コード生成系をソースプログ
ラムから自動的に生成すれば、プログラマがコード生成
系の正しさを確かめる必要がなくなる。
The method of generating a machine code at the time of execution as described above is a kind of partial calculation, and has been used for a special method such as a self-modifying code in old times. In recent years, a description method and a language of a runtime code generation routine that does not depend on a target machine have been proposed, and are becoming a general method. Also, if the runtime code generation system is automatically generated from the source program, the programmer does not need to check the correctness of the code generation system.

【0007】[0007]

【発明が解決しようとする課題】しかしながら、提案さ
れている多くの実行時最適化方法においては、単独のオ
ブジェクトに対する最適化しか行うことができないか、
あるいは、最適化処理を自動的に行うことができない課
題があった。
However, many of the run-time optimization methods that have been proposed only allow optimization for a single object.
Alternatively, there has been a problem that the optimization process cannot be performed automatically.

【0008】本発明はこのような状況に鑑みてなされた
ものであり、複数のオブジェクトに関して、自動的に実
行時最適化処理を行うことができるようにするものであ
る。
The present invention has been made in view of such a situation, and it is an object of the present invention to automatically perform a runtime optimization process for a plurality of objects.

【0009】[0009]

【課題を解決するための手段】請求項1に記載の演算方
法は、第1のオブジェクトと第2のオブジェクトよりな
るオブジェクト群の中から、第1のオブジェクトを選択
する選択ステップと、選択ステップで選択された第1の
オブジェクトのメソッドのうち、終端再帰で自分自身
を、第2のオブジェクトを引数として呼び出している第
1のメソッドを検索する検索ステップと、第1のメソッ
ド、または第1のメソッドを呼び出している第2のメソ
ッドで使用されている要素変数に対応して、その要素の
コードの番地を表す番地変数を付加する付加ステップ
と、第2のメソッドの中に、第1のメソッドを1回だけ
インライン展開したものに対するコード生成系を生成す
る生成ステップと、生成ステップで生成されたコード生
成系を、第1のメソッドと第2のメソッドに分離する分
離ステップとを備えることを特徴とする。
According to a first aspect of the present invention, there is provided an arithmetic method comprising the steps of: selecting a first object from an object group consisting of a first object and a second object; A retrieval step of retrieving a first method that calls itself by terminal recursion with the second object as an argument, among the methods of the selected first object, a first method or a first method Adding an address variable representing the address of the code of the element corresponding to the element variable used in the second method that calls the first method, and adding the first method to the second method. A generation step for generating a code generation system for the one-time inline expansion, and a code generation system generated in the generation step as a first method. Characterized in that it comprises a the separation step of separating the second method.

【0010】請求項2に記載の演算装置は、第1のオブ
ジェクトと第2のオブジェクトよりなるオブジェクト群
の中から、第1のオブジェクトを選択する選択手段と、
選択手段で選択された第1のオブジェクトのメソッドの
うち、終端再帰で自分自身を、第2のオブジェクトを引
数として呼び出している第1のメソッドを検索する検索
手段と、第1のメソッド、または第1のメソッドを呼び
出している第2のメソッドで使用されている要素変数に
対応して、その要素のコードの番地を表す番地変数を付
加する付加手段と、第2のメソッドの中に、第1のメソ
ッドを1回だけインライン展開したものに対するコード
生成系を生成する生成手段と、生成手段で生成されたコ
ード生成系を、第1のメソッドと第2のメソッドに分離
する分離手段とを備えることを特徴とする。
[0010] The arithmetic unit according to a second aspect of the present invention includes a selecting means for selecting a first object from an object group consisting of a first object and a second object;
Searching means for searching for the first method calling itself by terminal recursion with the second object as an argument, among the methods of the first object selected by the selecting means, and the first method or the first method Adding means for adding an address variable representing the address of the code of the element corresponding to the element variable used in the second method calling the first method; Generating means for generating a code generation system for a method obtained by performing inline expansion of the method once only, and separating means for separating the code generation system generated by the generation means into a first method and a second method. It is characterized by.

【0011】請求項3に記載の伝送媒体は、第1のオブ
ジェクトと第2のオブジェクトよりなるオブジェクト群
の中から、第1のオブジェクトを選択する選択ステップ
と、選択ステップで選択された第1のオブジェクトのメ
ソッドのうち、終端再帰で自分自身を、第2のオブジェ
クトを引数として呼び出している第1のメソッドを検索
する検索ステップと、第1のメソッド、または第1のメ
ソッドを呼び出している第2のメソッドで使用されてい
る要素変数に対応して、その要素のコードの番地を表す
番地変数を付加する付加ステップと、第2のメソッドの
中に、第1のメソッドを1回だけインライン展開したも
のに対するコード生成系を生成する生成ステップと、生
成ステップで生成されたコード生成系を、第1のメソッ
ドと第2のメソッドに分離する分離ステップとを備える
コンピュータプログラムを伝送することを特徴とする。
According to a third aspect of the present invention, there is provided the transmission medium, wherein a selecting step of selecting the first object from an object group consisting of the first object and the second object; A search step of searching for a first method that calls itself by terminal recursion with the second object as an argument, and a second method that calls the first method or the first method among the methods of the object. Adding an address variable representing the address of the code of the element corresponding to the element variable used in the method of the first method, and inline-expanding the first method only once in the second method Generating a code generation system for the object; and generating the code generation system generated in the generation step by a first method and a second method. Characterized by transmitting the computer program and a separation step of separating the.

【0012】請求項1に記載の演算方法、請求項2に記
載の演算装置、および請求項3に記載の伝送媒体におい
ては、第1のメソッド、または第1のメソッドを呼び出
している第2のメソッドで使用されている要素変数に対
応して、その要素のコードの番地を表す番地変数が付加
され、第2のメソッドの中に、第1のメソッドを1回だ
けインライン展開したものに対するコード生成系が生成
され、生成されたコード生成系が、第1のメソッドと第
2のメソッドに分離される。
[0012] In the arithmetic method according to the first aspect, the arithmetic unit according to the second aspect, and the transmission medium according to the third aspect, the first method or the second method that calls the first method is used. An address variable indicating the address of the code of the element is added corresponding to the element variable used in the method, and code generation is performed for the second method obtained by inline-expanding the first method only once in the second method. A system is generated, and the generated code generation system is separated into a first method and a second method.

【0013】[0013]

【発明の実施の形態】本発明は、オブジェクト指向型言
語に対して実行時最適化を行うものである。以下では、
本発明の一実施の形態である演算方法の概略について説
明し、続いて具体的な構成例について説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention performs runtime optimization for an object-oriented language. Below,
An outline of a calculation method according to an embodiment of the present invention will be described, and then a specific configuration example will be described.

【0014】オブジェクト指向型の言語では、データを
操作するためのインターフェース(Interface)と実装
(インプリメンテーション(Imprementation))とを明
確に分離しているため、データの操作方法やデータの操
作の順番を遅く決定することができる。従って、実行時
最適化を施すためには好適な言語であるということがで
きる。
In an object-oriented language, an interface for manipulating data and an implementation (implementation) are clearly separated from each other. Therefore, a method of manipulating data and an order of manipulating data are used. Can be determined late. Therefore, it can be said that the language is suitable for performing runtime optimization.

【0015】本発明では、実行時最適化の対象をオブジ
ェクトのメソッド(例えば、オブジェクト指向型の言語
の1つであるC++ではメンバ関数)とする。オブジェ
クトの公開されないインスタンス変数(C++ではpr
ivateメンバ)のうち、オブジェクトの生成時を除
いてどのメソッドでも変更されないものは、オブジェク
ト指向型言語のカプセル化機能によってオブジェクトの
一生の間、その値が変化しないことが保証される。
In the present invention, the object of runtime optimization is a method of an object (for example, a member function in C ++, which is one of object-oriented languages). Instance variables that are not exposed to the object (principles in C ++
Among the members (i.e., the members of the I.V.I.member) that are not changed by any method except when the object is created, the encapsulation function of the object-oriented language guarantees that their values do not change during the life of the object.

【0016】そこで、オブジェクトのインスタンスが生
成されるときに、値が変化しないインスタンス変数につ
いてメソッドを部分計算(実行時最適化)し、その結果
をマシンコードとしてオブジェクトのデータと共に格納
する。そして、メソッドが呼ばれた(参照された)場合
は、格納されているマシンコードを実行することにより
所望の処理を行うことが可能となる。
Therefore, when an instance of an object is generated, a method is partially calculated (run-time optimization) for an instance variable whose value does not change, and the result is stored as machine code together with the data of the object. Then, when the method is called (referenced), the desired processing can be performed by executing the stored machine code.

【0017】このように、部分計算の結果を関数ではな
くオブジェクトに結びつけたため、変数の値が不変とな
るので、従来のように部分計算の対象となる変数の値が
変化する度にマシンコードの生成をやり直す必要がなく
なる。
As described above, since the result of the partial calculation is linked to the object instead of the function, the value of the variable becomes invariable. Therefore, each time the value of the variable to be subjected to the partial calculation changes as in the related art, the machine code of the machine code is changed. There is no need to redo the generation.

【0018】また、オブジェクト指向型の言語では、オ
ブジェクトの生成と消滅の管理が自動的に行われるた
め、変数の複数の値に対応した複数のマシンコードを持
つようにした場合でも、各々の値を記憶する領域の管理
を行う必要がなくなる。
In an object-oriented language, the creation and extinction of an object are automatically managed. Therefore, even when a plurality of machine codes corresponding to a plurality of values of a variable are provided, each value of each variable is controlled. There is no need to manage the area for storing

【0019】更に、部分計算の候補となるオブジェクト
(のクラス)は、インスタンス変数の使い方を解析する
ことで自動的に検出することができる。すなわち、部分
計算によって実効速度が向上するか否かは、速度向上解
析などを応用することにより自動的に判別することがで
きる。従って、ターゲットマシンの種類によらず、プロ
グラムを最適化し、実行速度を向上させることができ
る。
Furthermore, an object (class) that is a candidate for partial calculation can be automatically detected by analyzing how to use instance variables. That is, whether or not the effective speed is improved by the partial calculation can be automatically determined by applying a speed improvement analysis or the like. Therefore, the program can be optimized and the execution speed can be improved regardless of the type of the target machine.

【0020】インスタンス生成時に行うマシンコードの
生成は、そのメソッドに特有の部分計算と考えることが
できる。従って、この部分計算を適用する(インスタン
ス生成時にマシンコードを生成する)ことにより、コン
パイルを行う際に、コード生成系を生成することができ
る。
The generation of the machine code performed at the time of instance generation can be considered as a partial calculation unique to the method. Therefore, by applying this partial calculation (generating machine code at the time of instance generation), a code generation system can be generated at the time of compiling.

【0021】次に、本発明の具体的な実施の形態につい
て説明する。
Next, a specific embodiment of the present invention will be described.

【0022】本実施の形態は、本発明をオブジェクト指
向型の言語であるC++のプリプロセッサ(コンパイラ
およびリンカの前処理を行うプロセッサ)に適用したも
のである。なお、C++を選択したのは、強い型付けを
利用することで、実行時コード生成系が扱う値の型が決
定できることから、実現が容易となるためである。
In this embodiment, the present invention is applied to a C ++ preprocessor (processor for preprocessing a compiler and a linker) which is an object-oriented language. The reason why C ++ is selected is that the use of strong typing makes it possible to determine the type of a value handled by the runtime code generation system, thereby facilitating the realization.

【0023】図1は、本発明の演算方法を適用したプリ
プロセッサの処理の概略を説明するフローチャートであ
る。また、図2は、この処理を実行する処理装置の構成
の一例を示すブロック図である。
FIG. 1 is a flowchart for explaining the outline of the processing of a preprocessor to which the operation method of the present invention is applied. FIG. 2 is a block diagram illustrating an example of a configuration of a processing device that performs this processing.

【0024】先ず、図2に示す処理装置の構成について
説明したのち、図1に示すフローチャートの動作につい
て説明を行う。
First, the configuration of the processing apparatus shown in FIG. 2 will be described, and then the operation of the flowchart shown in FIG. 1 will be described.

【0025】図2に示す処理装置は、各種演算を行うワ
ークステーション20、操作者がワークステーション2
0に入力を行う際に操作されるキーボード21、ワーク
ステーション20が処理するデータやプログラムを記憶
するハードディスク装置22、および、ワークステーシ
ョン20により処理された処理結果を表示するためのC
RT(Cathode Ray Tube)ディスプレイ装置23により
構成されている。
The processing apparatus shown in FIG. 2 includes a workstation 20 for performing various calculations, and an operator
0, a hard disk drive 22 for storing data and programs to be processed by the workstation 20, and a C for displaying processing results processed by the workstation 20.
An RT (Cathode Ray Tube) display device 23 is provided.

【0026】また、ワークステーション20は、各種処
理を行うと同時に、ワークステーション20の全体の制
御を行うCPU20a、CPU20aが実行するプログ
ラムやデータなどを格納しているROM(Read Only Me
mory)20b、CPU20aが処理したデータなどを一
時的に記憶するRAM20c、および、CPU20aと
キーボート21、ハードディスク装置22、CRTディ
スプレイ装置23とを相互に接続し、これらの間でデー
タの授受を行うIF(Interface)20dより構成され
ている。
The workstation 20 performs various processes, and at the same time, controls the entire workstation 20 by a CPU 20a, and a ROM (Read Only Memory) storing programs and data executed by the CPU 20a.
mory) 20b, a RAM 20c for temporarily storing data processed by the CPU 20a, and an IF for interconnecting the CPU 20a, the keyboard 21, the hard disk device 22, and the CRT display device 23 and exchanging data between them. (Interface) 20d.

【0027】図2に示すキーボード21から操作者が所
定の入力を行うことにより、図1に示すフローチャート
の処理が実行される。処理が実行されると、CPU20
aは、ハードディスク装置22に格納されている図示せ
ぬC++のソースプログラムをRAM20cへ読み込
み、読み込んだソースプログラムの中で実行時最適化が
可能なクラスを決定する(ステップS10)。
When the operator performs a predetermined input from the keyboard 21 shown in FIG. 2, the processing of the flowchart shown in FIG. 1 is executed. When the processing is executed, the CPU 20
A reads a C ++ source program (not shown) stored in the hard disk device 22 into the RAM 20c, and determines a class that can be optimized during execution in the read source program (step S10).

【0028】そして、CPU20aは、ステップS10
で決定されたクラスのメンバ関数を中間表現に翻訳し、
C++で記述されたコード生成ルーチンを生成する(ス
テップS11)。
Then, the CPU 20a determines in step S10
Translates the member function of the class determined by
A code generation routine described in C ++ is generated (step S11).

【0029】続いて、CPU20aは、生成されたコー
ド生成ルーチンをステップS10で決定されたクラスの
コンストラクタ(生成演算子)に埋め込み(ステップS
12)ステップS13へ進む。
Subsequently, the CPU 20a embeds the generated code generation routine in the constructor (generation operator) of the class determined in step S10 (step S10).
12) Go to step S13.

【0030】ステップS13において、CPU20a
は、全てのクラスについて実行時最適化が行われたか否
かを判別し、全てのクラスについて実行時最適化が行わ
れていない(NO)と判別すると、ステップS11に戻
り同様の処理を繰り返す。また、全てのクラスに付いて
実行時最適化が行われた(YES)と判別すると、処理
を終了する(エンド)。
In step S13, the CPU 20a
Determines whether or not runtime optimization has been performed for all classes, and if it is determined that runtime optimization has not been performed for all classes (NO), returns to step S11 and repeats the same processing. If it is determined that the runtime optimization has been performed for all the classes (YES), the process ends (END).

【0031】以上の処理の結果生成されたC++のソー
スプログラムをコンパイルおよびリンクし、実行する
と、最適化の適用されたクラスのインスタンスが生成さ
れる際に、マシンコードが生成されることになる。
When the C ++ source program generated as a result of the above processing is compiled, linked, and executed, machine code is generated when an instance of the class to which the optimization is applied is generated.

【0032】図3は、以上の原理に従って、複数のオブ
ジェクトにより構成されるオブジェクト群に対して実行
時最適化処理を行う場合の、より具体的な処理例を表し
ている。このオブジェクト群は、それを代表するコンテ
ナオブジェクトと、それ以外の要素オブジェクトとによ
り構成されている。
FIG. 3 shows a more specific processing example in the case where the runtime optimization processing is performed on an object group composed of a plurality of objects according to the above principle. This object group is constituted by a container object representing the object group and other element objects.

【0033】最初にステップS21において、コンテナ
オブジェクトを選択する処理が行われる(図6を参照し
て後述する具体例では、StringListがコンテナオブジェ
クトとして選択され、String,StringLinkが要素オブジ
ェクトとされる)。
First, in step S21, a process of selecting a container object is performed (in a specific example described later with reference to FIG. 6, StringList is selected as a container object, and String and StringLink are set as element objects).

【0034】次に、ステップS22に進み、コンテナオ
ブジェクトのメソッドの中から、所定のメソッドrを検
索する処理が実行される。このメソッドrの検索処理の
詳細は、図4に示されている。
Next, the process proceeds to step S22, in which a process for searching for a predetermined method r from among the methods of the container object is executed. Details of the search processing of the method r are shown in FIG.

【0035】最初に、ステップS41において、コンテ
ナオブジェクトのメソッドの中から終端再帰(終端は複
数であってもよい)により、自分自身を他の要素オブジ
ェクト(へのポインタ)を引数として呼び出しているメ
ソッド(図7の例では、return search(p,q->next);)
があるか否かが判定される。そのようなメソッドが存在
する場合には、ステップS42に進み、そのメソッド
(図6の例では、int search (char const *p,StringLi
nk *q))が仮にメソッドrとされる。次に、ステップS
43に進み、ステップS42で設定されたメソッドrの
呼び出しの実引数(呼び出した側の引数)が、値を把握
することができる変数であるか否かが判定される。すな
わち、メソッドrからメソッドrの呼び出しでは、コン
テナオブジェクトの非公開の(Privateの)インスタン
ス変数か、あるいは要素オブジェクトのインスタンス変
数であるか否かが判定される(図6の例では、要素オブ
ジェクトのインスタンス変数であるという条件が満たさ
れる)。ただし、この場合において、後述するように、
ステップS47で、メソッドrを呼び出しているメソッ
ド(図6の例では、int search(char const *p))がメ
ソッドsとされるのであるが、このメソッドsからメソ
ッドrの呼び出しにおいては、コンテナオブジェクトの
非公開変数であるか否かが判定される(int search(cha
r const *p)は、図7のreturn search(p,top);により、
int search (char const *p,StringLink *q))を呼び出
している)。
First, in step S41, a method that calls itself using another element object (pointer to) as an argument by terminal recursion (there may be a plurality of terminals) from among the methods of the container object. (In the example of FIG. 7, return search (p, q->next);)
It is determined whether or not there is. If such a method exists, the process proceeds to step S42, and the method (in the example of FIG. 6, int search (char const * p, StringLi
nk * q)) is assumed to be a method r. Next, step S
Proceeding to 43, it is determined whether the actual argument of the call of the method r set in step S42 (the argument on the calling side) is a variable whose value can be grasped. That is, when the method r is called from the method r, it is determined whether it is a private (private) instance variable of the container object or an instance variable of the element object (in the example of FIG. The condition that it is an instance variable is satisfied). However, in this case, as described later,
In step S47, the method that calls the method r (int search (char const * p) in the example of FIG. 6) is set as the method s. When the method r is called from the method s, the container object Is determined as a private variable (int search (cha
r const * p) is obtained by return search (p, top); in FIG.
int search (char const * p, StringLink * q))).

【0036】ステップS43で、メソッドrの呼び出し
の実引き数が、値を把握することができる変数であると
判定された場合には、ステップS44に進み、そのイン
スタンス変数(要素変数)(sまたはrから、rを呼び
出すときの実引数となるインスタンス変数であり、図7
の例では、topとnext)に代入を行ったり、ポインタを
生成したりするメソッドにおいて、代入される値が、そ
のメソッドで生成した要素オブジェクト(へのポイン
タ)か、ヌルポインタか、あるいは、要素変数のいずれ
かであるか否かが判定される(図6の例では要素変数へ
のポインタを生成するメソッドはなく、代入を行うメソ
ッドだけがある。そのようなメソッドであるadd(図
9)では、nextにtopを代入し、topに生成したオブジェ
クトへのポインタを代入している。もう1つのメソッド
であるStringList(コンストラクタ)では、topにヌル
ポインタを代入している)。以上の条件が満足される場
合には、メソッドrは、コンテナオブジェクトのメソッ
ドが生成した要素オブジェクトしか引数にとらないこと
が保証されることになる。
If it is determined in step S43 that the actual argument of the invocation of the method r is a variable whose value can be grasped, the process proceeds to step S44, where the instance variable (element variable) (s or FIG. 7 is an instance variable that is an actual argument when r is called from r.
In the example above, in a method that assigns to top and next) or creates a pointer, the value to be assigned is either an element object (pointer to) created by the method, a null pointer, or an element. It is determined whether it is any of the variables (in the example of FIG. 6, there is no method for generating a pointer to an element variable, but only a method for performing assignment. Such a method, add (FIG. 9)) In this example, we assign top to next and assign a pointer to the created object to top, and another method, StringList (constructor), assigns a null pointer to top). When the above condition is satisfied, it is guaranteed that the method r takes only the element object generated by the method of the container object as an argument.

【0037】ステップS44において、YESの判定が行
われた場合には、ステップS45に進み、メソッドrを
要素オブジェクトのインスタンス変数の値について最適
化できるとき、そのインスタンス変数が不変であるか否
かが判定される(図6の例では、StringLinkのデータメ
ンバのうちsについて最適化が行われる。コンテナオブ
ジェクトであるStringListは、そのどのメンバ関数でも
要素オブジェクトを外に見せず、また、どのメンバ関数
でもsを変更しないため、不変であると判定される)。
If YES is determined in the step S44, the process proceeds to a step S45. When the method r can be optimized with respect to the value of the instance variable of the element object, it is determined whether or not the instance variable is unchanged. (In the example of FIG. 6, optimization is performed on s of the data members of StringLink. StringList, which is a container object, does not show the element object out of any of its member functions. Since s is not changed, it is determined to be unchanged.)

【0038】ステップS45において、YESの判定が行
われた場合には、ステップS46に進み、メソッドrを
ステップS42で設定したメソッドに確定し、さらに、
ステップS47において、メソッドrを呼び出している
メソッドをメソッドsと設定する。
If YES is determined in the step S45, the process proceeds to a step S46, where the method r is determined to the method set in the step S42, and further,
In step S47, the method calling the method r is set as the method s.

【0039】ステップS41,S43,S44,S45
のいずれかの条件が満足されないと判定された場合に
は、コンテナオブジェクトにメソッドrが存在しないこ
とになるので、実行時最適化処理は終了される。
Steps S41, S43, S44, S45
If it is determined that any one of the conditions is not satisfied, the method r does not exist in the container object, and the runtime optimization process ends.

【0040】図3に戻って、以上のようにして、メソッ
ドrが検索されたとき、ステップS23に進み、メソッ
ドrまたはメソッドsが使用している要素変数(図6の
StringLinkのnextとStringListのtop)に対応して、そ
の要素のコードの番地を表すインスタンス変数(番地変
数)(図8のnext_codeとtop_code)を、対応する要素
変数を持つクラス定義に付加する処理が実行される。ま
た、ステップS24において、元の変数(top_codeに対
するtop、また、next_codeに対するnext)へのそのメソ
ッドで生成した要素オブジェクト(へのポインタ)、ヌ
ルポインタ、あるいは要素変数の代入時(ヌルポインタ
の場合は後述する)に、対応するコードの番地を代入す
るように、コンテナオブジェクトのメソッドを書き換え
る処理(図9)が実行される。
Returning to FIG. 3, when the method r is searched as described above, the process proceeds to step S23, where the element variable used by the method r or the method s (see FIG. 6).
The process of adding an instance variable (address variable) (next_code and top_code in FIG. 8) indicating the address of the code of the element corresponding to the next of StringLink and the top of StringList to the class definition having the corresponding element variable Be executed. In step S24, when an element object (pointer to) generated by the method, a null pointer, or an element variable is assigned to an original variable (top for top_code and next for next_code) (in the case of a null pointer, The process of rewriting the method of the container object (FIG. 9) is executed so that the address of the corresponding code is substituted for the address of the corresponding code (described later).

【0041】さらに、ステップS25に進み、メソッド
sの中に、メソッドrを1回だけインライン展開したも
のに対するコード生成系を生成する処理が実行される。
ただし、関数の境界を超える最適化を制限し、境界を超
えて定数伝搬を行ったり、コードを移動したり、共通部
分式の値を一時変数に入れて渡したりしないようにす
る。これは、メソッドsのコードが、再生成や要素の関
係の変化に対応するためである。仮にメソッドsの使用
しているインスタンス変数の値が不変であり、コードが
再生成されないときは、メソッドsからメソッドrへの
定数伝搬は許容される。
Further, in step S25, a process of generating a code generation system for a method s in which the method r is inline-expanded only once is executed.
However, limit optimizations beyond function boundaries to avoid constant propagation across boundaries, code migration, and passing common subexpression values in temporary variables. This is because the code of the method s responds to regeneration and changes in the relationship between elements. If the value of the instance variable used by the method s is unchanged and the code is not regenerated, the constant propagation from the method s to the method r is allowed.

【0042】次に、ステップS26に進み、以上のよう
にして生成されたコード生成体系を、メソッドsとメソ
ッドrに分ける処理が実行される。メソッドsの中のメ
ソッドrがあった部分では、引数の要素のコードを呼び
出す命令(図8のMOV ESI,[ECX].top ; ESIに最初の文
字列,; 最初の文字列のコードを呼び出す,CALL DWORD
PTR [ECX].top_code)を生成するようにする。また、
メソッドrの最後では、自分自身を呼び出すのではな
く、引数の要素のコードにジャンプする命令(図8の M
OV EAX,[ESI].next_code,MOV ESI,[ESI].next ; ESIに
次の文字列,JMP EAX ; 次の文字列のコードへ)を生成
するようにする。
Next, the process proceeds to step S26, in which a process of dividing the code generation system generated as described above into a method s and a method r is executed. In the part where the method r exists in the method s, an instruction for calling the code of the element of the argument (MOV ESI, [ECX] .top in FIG. 8; the first character string in the ESI; , CALL DWORD
PTR [ECX] .top_code). Also,
At the end of the method r, an instruction to jump to the code of the element of the argument instead of calling itself (M in FIG. 8)
OV EAX, [ESI] .next_code, MOV ESI, [ESI] .next; Generate next character string in ESI, JMP EAX; Code to next character string).

【0043】コード生成系のメソッドrの部分(図9
の、<コード生成し、番地をqqcodeに>)は、コンテナオ
ブジェクトのメソッド中の要素オブジェクトのインスタ
ンスを生成する部分(図9の StringLink *l=new Strin
gLink(p);)に埋め込んで使用する。仮に、メソッドr
の中で引数がヌルポインタかどうか判定して処理を分け
ているのであれば、ヌルポインタでないと仮定し、最適
化処理を実行する。なお、要素変数にヌルポインタを代
入する操作があった場合には、そこで、引数がヌルポイ
ンタであるとして、最適化したコードを生成し、対応す
る番地変数に、その番地を代入するようにする。
The method r part of the code generation system (FIG. 9)
<Code generation and address to qqcode>) is the part that generates an instance of the element object in the method of the container object (StringLink * l = new Strin in FIG. 9).
Use it embedded in gLink (p);). Assuming the method r
If the processing is divided by determining whether the argument is a null pointer in, the optimization processing is executed on the assumption that the argument is not a null pointer. If there is an operation of assigning a null pointer to an element variable, an optimized code is generated assuming that the argument is a null pointer, and the address is assigned to the corresponding address variable. .

【0044】このような操作は、機械的なものであるの
で、言語処理系に自動的に処理させることができる。
Since such an operation is mechanical, it can be automatically processed by a language processing system.

【0045】次に、図5に示すように、複数のストリン
グがリンクされ、所定の文字列を検索する場合の具体例
について説明する。図6は、C++で書かれたリンクト
リストの3個のクラスString,StringLink,StringListの
定義を示している。これらのクラスは、要素として文字
列(図中、変数sで示す領域に記載されているアルファ
ベット文字abc,ef,ghia,defなど)を表すオブジェクト
を有している。リストは最初は空(例えば、図5のtop
が何も指さず、top_codeがNOSTRINGを指している状態)
である。メンバ関数addは、先頭に要素をつけ加える。
また、メンバ関数searchは、要素がリスト中にあるかど
うかを調べる。この例の場合、すべての操作が、クラス
StringListのオブジェクトのメソッド(メンバ関数)を
通して行われるので、StringListは代表的なオブジェク
トであり、StringListがコンテナオブジェクトとされ、
その他のStringLink,Stringは要素オブジェクトとされ
る。
Next, a specific example in which a plurality of strings are linked and a predetermined character string is searched as shown in FIG. 5 will be described. FIG. 6 shows the definition of three classes String, StringLink, and StringList of a linked list written in C ++. These classes have objects representing character strings (alphabet characters abc, ef, ghia, def, etc. described in an area indicated by a variable s in the figure) as elements. The list is initially empty (for example, top
Indicates nothing and top_code points to NOSTRING)
It is. The member function add adds an element to the beginning.
The member function search checks whether an element is in the list. In this case, all operations are in the class
It is performed through the methods (member functions) of the StringList object, so StringList is a representative object, StringList is a container object,
Other StringLink and String are element objects.

【0046】図4のステップS44により、要素変数の
値はコンテナオブジェクトのメソッドで生成されたオブ
ジェクト(へのポインタ)かヌルポインタしかあり得な
いため、要素変数の(指す)オブジェクトのインスタン
ス生成は、コンテナオブジェクトであるStringListです
べて把握できる。そのため、インスタンス生成時に要素
オブジェクトのメンバ関数matchをコンテナオブジェク
トのメンバ関数searchに適応させて(図8のコードは、
matchのコードとsearchのコードが混在しており、searc
hからmatchを呼び出す処理に特化したものになってい
る)、その一部とすることができる。このメンバ関数se
archについては、図7に示されている。これにより、se
archは、各要素に分散された検索コードとして、図8に
示すように実現される。すなわち、図8に示すようなコ
ードが実行時最適化により生成される。
Since the value of the element variable can be only an object (pointer) generated by the method of the container object or a null pointer by the step S44 in FIG. All can be grasped by StringList which is a container object. Therefore, at the time of instance generation, the member function match of the element object is adapted to the member function search of the container object (the code in FIG.
Match code and search code are mixed, and searc
h is specialized for calling match), but it can be part of that. This member function se
The arch is shown in FIG. This gives
The arch is realized as a search code distributed to each element as shown in FIG. That is, a code as shown in FIG. 8 is generated by the runtime optimization.

【0047】ここでは、searchの終端再帰は、完全に展
開され、次の要素(文字列)への処理の移行は、次の要
素のコードへのジャンプ命令で表される。図5に示すよ
うに、ジャンプ先は、リストのつなぎ換えに従って変更
される。なお、図8における「文字列を比較し・・・」
の部分には、メンバ関数matchを文字列について部分計
算したコードが入ることになる。
Here, the terminal recursion of search is completely expanded, and the transition of processing to the next element (character string) is represented by a jump instruction to the code of the next element. As shown in FIG. 5, the jump destination is changed according to the reconnection of the list. It should be noted that "comparing character strings ..." in FIG.
In the part, the code obtained by partially calculating the member function match on the character string is entered.

【0048】図8のコード中のメンバtop_codeとnext_c
odeは、クラスStringListとStringLinkに付け加えられ
た、先頭(top_code)または次(next_code)の要素の
コードを表す変数である。リンクトリストを変更するメ
ンバ関数(図9のadd)では、コード生成とともに、こ
れらのメンバの値(top_code,next_code)を新しく設定
する必要がある。また、クラスStringListの初期化時に
は、メンバtop_codeに、図8のNOSTRINGの番地を設定す
る必要がある。これらの設定は、対応するメンバnext,t
opと並行して行われる。図9には、この変更の前後のメ
ンバ関数addの定義が示されている。すなわち、メンバ
関数addは、この実行時最適化処理により、変更前の状
態から変更後の状態に変更される。
The members top_code and next_c in the code of FIG.
ode is a variable that represents the code of the first (top_code) or next (next_code) element added to the classes StringList and StringLink. In the member function for changing the linked list (add in FIG. 9), it is necessary to newly set the values (top_code, next_code) of these members together with the code generation. When the class StringList is initialized, it is necessary to set the address of NOSTRING in FIG. 8 to the member top_code. These settings are set in the corresponding members next, t
Performed in parallel with op. FIG. 9 shows the definition of the member function add before and after this change. That is, the member function add is changed from the state before the change to the state after the change by the runtime optimization process.

【0049】この発明による方法を評価するため、上記
した例題プログラムを、普通にコンパイルしたもの、従
来方式のプリプロセッサで処理したもの、本発明の方法
に従って書き換えたものの実行速度を比較したところ、
図10に示すようになった。測定に使ったコンピュータ
は、NEC(商号)PC-9821La10/8(Pentium(商標)100MH
z、メモリ23MBytes、2ndキャッシュなし)で、OSは、Wi
ndows95(商標)、コンパイラは、BorlandC++4.5J(商
標)のコマンドラインコンパイラ「BCC32A.EXE」(商
標)である。コンパイラオプションは、「-5-O2-vi」
(Pentium向け最適化、速度優先、インライン展開)を
使用した。
In order to evaluate the method according to the present invention, the execution speed of the above-described example program which was compiled normally, processed by the conventional preprocessor, and rewritten according to the method of the present invention were compared.
As shown in FIG. The computer used for the measurement was NEC (trade name) PC-9821La10 / 8 (Pentium (trademark) 100MHZ)
z, memory 23MBytes, without 2nd cache), OS is Wi
ndows95 (trademark) is a command line compiler of Borland C ++ 4.5J (trademark) "BCC32A.EXE" (trademark). The compiler option is "-5-O2-vi"
(Optimization for Pentium, speed priority, inline expansion) were used.

【0050】長さ10のリストを、見つかる場合とそう
でない場合、それぞれ100万回検索させ、実行時間を
タイマ割り込みで測定し、10回の平均値を求めた結果
が、図10に示すものである。この例題に関しては、従
来方式では、関数の入口と出口の処理のオーバーヘッド
などのため、ほとんど効果上がっていないが、本方法に
よれば、4倍近い速度向上が得られていることがわか
る。終端再帰の除去とメンバ関数matchのインライン展
開による性能は、matchを各インスタンスについて部分
計算することができないため、本発明による方式に及ば
ない。
When a list having a length of 10 is found and when it is not found, each is searched 1 million times, the execution time is measured by a timer interrupt, and the average value of 10 times is obtained. The result is shown in FIG. is there. With respect to this example, the conventional method has little effect due to the overhead of processing at the entry and exit of the function, but it can be seen that according to the method, the speed is improved by nearly four times. The performance due to the elimination of terminal recursion and the inline expansion of the member function "match" is inferior to the method according to the present invention because the match cannot be partially calculated for each instance.

【0051】以上のように、複数のオブジェクトにまた
がる実行時最適化の一方法として、コンテナオブジェク
トを有するオブジェクト群の最適化を自動化することが
できる。また、オブジェクト指向言語のカプセル化機能
を利用すれば、関係するクラスのメソッドを調べること
により、適用条件を判定することができる。
As described above, as a method of runtime optimization over a plurality of objects, optimization of a group of objects having container objects can be automated. Further, if the encapsulation function of the object-oriented language is used, the application condition can be determined by examining the methods of the related classes.

【0052】なお、上記したような処理を行うコンピュ
ータプログラムをユーザに伝送する伝送媒体としては、
磁気ディスク、CD-ROM、固体メモリなどの記録媒体の
他、ネットワーク、衛星などの通信媒体を利用すること
ができる。
As a transmission medium for transmitting a computer program for performing the above-described processing to a user,
In addition to recording media such as magnetic disks, CD-ROMs, and solid-state memories, communication media such as networks and satellites can be used.

【0053】[0053]

【発明の効果】以上の如く、請求項1に記載の演算方
法、請求項2に記載の演算装置、および請求項3に記載
の伝送媒体によれば、第1のオブジェクトの第1のメソ
ッド、または第1のメソッドを呼び出している第2のメ
ソッドで使用されている要素変数に対応して、その要素
のコードの番地を表す番地変数を付加し、第2のメソッ
ドの中に、第1のメソッドを1回だけインライン展開し
たものに対するコード生成系を生成し、その生成したコ
ード生成系を、第1のメソッドと第2のメソッドに分離
するようにしたので、複数のオブジェクトにまたがる実
行時最適化を、自動的にかつ効率的に、行うことが可能
となる。
As described above, according to the arithmetic method according to claim 1, the arithmetic device according to claim 2, and the transmission medium according to claim 3, the first method of the first object, Alternatively, an address variable representing the address of the code of the element is added in correspondence with the element variable used in the second method that calls the first method, and the first method is included in the second method. Generates a code generation system for a method that has been expanded inline only once, and separates the generated code generation system into a first method and a second method. Can be automatically and efficiently performed.

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

【図1】本発明の一実施の形態のプリプロセッサの処理
を説明するフローチャートである。
FIG. 1 is a flowchart illustrating processing of a preprocessor according to an embodiment of the present invention.

【図2】図1の処理を実行する処理装置の構成を示すブ
ロック図である。
FIG. 2 is a block diagram illustrating a configuration of a processing device that executes the processing of FIG. 1;

【図3】実行時最適化処理の詳細を示すフローチャート
である。
FIG. 3 is a flowchart illustrating details of a runtime optimization process.

【図4】図3のステップS22におけるメソッドrの検
索処理を説明するフローチャートである。
FIG. 4 is a flowchart illustrating a method r search process in step S22 of FIG. 3;

【図5】変数の変化を説明する図である。FIG. 5 is a diagram illustrating a change in a variable.

【図6】リンクトリストのクラス定義を説明する図であ
る。
FIG. 6 is a diagram illustrating a class definition of a linked list.

【図7】メンバ関数searchを説明する図である。FIG. 7 is a diagram illustrating a member function search.

【図8】メンバ関数searchの実現を説明する図である。FIG. 8 is a diagram illustrating the implementation of a member function search.

【図9】メンバ関数addを説明する図である。FIG. 9 is a diagram illustrating a member function add.

【図10】リスト検索時間を説明する図である。FIG. 10 is a diagram illustrating a list search time.

【図11】通常のソースプログラムをコンパイルし、実
行する場合のプロセスを示す図である。
FIG. 11 is a diagram showing a process when compiling and executing a normal source program.

【図12】実行時最適化を行うプログラムをコンパイル
し、実行する場合のプロセスを示す図である。
FIG. 12 illustrates a process for compiling and executing a program for performing run-time optimization.

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

20 ワークステーション, 20a CPU, 20
b ROM, 20cRAM, 20d IF, 21
キーボード, 22 ハードディスク装置, 23
CRTディスプレイ装置
20 workstation, 20a CPU, 20
b ROM, 20cRAM, 20d IF, 21
Keyboard, 22 hard disk drive, 23
CRT display device

【手続補正書】[Procedure amendment]

【提出日】平成10年4月17日[Submission date] April 17, 1998

【手続補正1】[Procedure amendment 1]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0015[Correction target item name] 0015

【補正方法】変更[Correction method] Change

【補正内容】[Correction contents]

【0015】本発明では、実行時最適化の対象をオブジ
ェクトのメソッド(例えば、オブジェクト指向型の言語
の1つであるC++ではメンバ関数)とする。オブジェ
クトの公開されないインスタンス変数(C++ではpr
ivateメンバ)のうち、オブジェクトの生成時を除
いてどのメソッドでも変更されないものは、オブジェク
ト指向型言語のカプセル化機能によってオブジェクトの
一生の間、その値が変化しないことが保証される。
た、公開されないインスタンス変数の値が変更されるな
ら、その場所は、そのオブジェクトのメソッド内に限定
される。
In the present invention, the object of runtime optimization is a method of an object (for example, a member function in C ++, which is one of object-oriented languages). Instance variables that are not exposed to the object (principles in C ++
Among the members (i.e., the members of the I.V.I.member) that are not changed by any method except when the object is created, the encapsulation function of the object-oriented language guarantees that their values do not change during the life of the object. Ma
Also, do not change the value of instance variables that are not
The location is limited to the method of the object
Is done.

【手続補正2】[Procedure amendment 2]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0016[Correction target item name] 0016

【補正方法】変更[Correction method] Change

【補正内容】[Correction contents]

【0016】そこで、オブジェクトのインスタンスが生
成されるとき、あるいはインスタンス変数の値が変更さ
れたとき、インスタンス変数についてメソッドを部分計
算(実行時最適化)し、その結果をマシンコードとして
オブジェクトのデータと共に格納する。そして、メソッ
ドが呼ばれた(参照された)場合は、格納されているマ
シンコードを実行することにより所望の処理を行うこと
が可能となる。
Therefore, when an instance of an object is generated or the value of an instance variable is changed.
Then, the method performs partial calculation (run-time optimization) on the instance variables and stores the result together with the object data as machine code. Then, when the method is called (referenced), the desired processing can be performed by executing the stored machine code.

【手続補正3】[Procedure amendment 3]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0017[Correction target item name] 0017

【補正方法】変更[Correction method] Change

【補正内容】[Correction contents]

【0017】このように、部分計算の結果を関数ではな
くオブジェクトに結びつけたため、マシンコードの生成
のタイミングを自動的に判定できる。
Since the result of the partial calculation is linked to the object instead of the function, the machine code generation
Timing can be automatically determined.

【手続補正4】[Procedure amendment 4]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0019[Correction target item name] 0019

【補正方法】削除[Correction method] Deleted

【手続補正5】[Procedure amendment 5]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0020[Correction target item name] 0020

【補正方法】変更[Correction method] Change

【補正内容】[Correction contents]

【0020】インスタンス生成時に行うマシンコードの
生成は、そのメソッドに特有の部分計算と考えることが
できる。従って、この部分計算を適用する(インスタン
ス生成時にマシンコードを生成する)ことにより、コン
パイルを行う際に、コード生成系を生成することができ
る。本発明ではこの方法を元に、コンテナオブジェクト
と要素オブジェクトから成るオブジェクト群の実行時最
適化を行う。個々の要素オブジェクトは実行時定数とな
るインスタンス変数を持っているとする。要素オブジェ
クト同士の関係が変化する場合、前回の発明では、要素
オブジェクトのメソッドについてしか実行時最適化を行
うことができなかった。本発明では、要素オブジェクト
の関係を変更するのは、コンテナオブジェクトのメソッ
ドだけであることを利用して、コンテナオブジェクトの
メソッドも実行時最適化を行う。
The generation of the machine code performed at the time of instance generation can be considered as a partial calculation unique to the method. Therefore, by applying this partial calculation (generating machine code at the time of instance generation), a code generation system can be generated at the time of compiling. In the present invention, based on this method, the container object
Runtime group of objects consisting of
Perform optimization. Each element object is a runtime constant.
Suppose you have an instance variable. Element object
If the relationship between the projects changes,
Perform runtime optimization only for object methods.
I couldn't do it. In the present invention, the element object
Changing the relationship of a container object
Of the container object
Methods also perform run-time optimization.

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 第1のオブジェクトと第2のオブジェク
トよりなるオブジェクト群の中から、前記第1のオブジ
ェクトを選択する選択ステップと、 前記選択ステップで選択された前記第1のオブジェクト
のメソッドのうち、終端再帰で自分自身を、前記第2の
オブジェクトを引数として呼び出している第1のメソッ
ドを検索する検索ステップと、 前記第1のメソッド、または前記第1のメソッドを呼び
出している第2のメソッドで使用されている要素変数に
対応して、その要素のコードの番地を表す番地変数を付
加する付加ステップと、 前記第2のメソッドの中に、前記第1のメソッドを1回
だけインライン展開したものに対するコード生成系を生
成する生成ステップと、 前記生成ステップで生成されたコード生成系を、前記第
1のメソッドと第2のメソッドに分離する分離ステップ
とを備えることを特徴とする演算方法。
A selecting step of selecting the first object from an object group consisting of a first object and a second object; and a method of selecting the first object from the method of the first object selected in the selecting step. Retrieving a first method calling itself by terminal recursion with the second object as an argument; and a second method calling the first method or the first method. Adding an address variable representing the address of the code of the element in correspondence with the element variable used in the above, and inline-expanding the first method only once in the second method Generating a code generation system for the object; and generating the code generation system generated in the generation step by the first method. Calculation method characterized by comprising the the separation step of separating the second method.
【請求項2】 第1のオブジェクトと第2のオブジェク
トよりなるオブジェクト群の中から、前記第1のオブジ
ェクトを選択する選択手段と、 前記選択手段で選択された前記第1のオブジェクトのメ
ソッドのうち、終端再帰で自分自身を、前記第2のオブ
ジェクトを引数として呼び出している第1のメソッドを
検索する検索手段と、 前記第1のメソッド、または前記第1のメソッドを呼び
出している第2のメソッドで使用されている要素変数に
対応して、その要素のコードの番地を表す番地変数を付
加する付加手段と、 前記第2のメソッドの中に、前記第1のメソッドを1回
だけインライン展開したものに対するコード生成系を生
成する生成手段と、 前記生成手段で生成されたコード生成系を、前記第1の
メソッドと第2のメソッドに分離する分離手段とを備え
ることを特徴とする演算装置。
2. A selecting means for selecting the first object from an object group consisting of a first object and a second object; and a method of the first object selected by the selecting means. Search means for retrieving a first method calling itself by terminal recursion with the second object as an argument; and a second method calling the first method or the first method. Adding means for adding an address variable representing the address of the code of the element in correspondence with the element variable used in the above, and the first method is inline-expanded only once in the second method Generating means for generating a code generating system for the object; separating the code generating system generated by the generating means into the first method and the second method Arithmetic apparatus characterized by comprising a separation means that.
【請求項3】 第1のオブジェクトと第2のオブジェク
トよりなるオブジェクト群の中から、前記第1のオブジ
ェクトを選択する選択ステップと、 前記選択ステップで選択された前記第1のオブジェクト
のメソッドのうち、終端再帰で自分自身を、前記第2の
オブジェクトを引数として呼び出している第1のメソッ
ドを検索する検索ステップと、 前記第1のメソッド、または前記第1のメソッドを呼び
出している第2のメソッドで使用されている要素変数に
対応して、その要素のコードの番地を表す番地変数を付
加する付加ステップと、 前記第2のメソッドの中に、前記第1のメソッドを1回
だけインライン展開したものに対するコード生成系を生
成する生成ステップと、 前記生成ステップで生成されたコード生成系を、前記第
1のメソッドと第2のメソッドに分離する分離ステップ
とを備えるコンピュータプログラムを伝送することを特
徴とする伝送媒体。
A selecting step of selecting the first object from an object group consisting of a first object and a second object; and a method of the first object selected in the selecting step. Retrieving a first method calling itself by terminal recursion with the second object as an argument; and a second method calling the first method or the first method. Adding an address variable representing the address of the code of the element in correspondence with the element variable used in the above, and inline-expanding the first method only once in the second method Generating a code generation system for the object; and generating the code generation system generated in the generation step by the first method. When the transmission medium, characterized by transmitting the computer program and a separation step of separating the second method.
JP32273697A 1997-11-25 1997-11-25 Operation method and device and transmission medium Withdrawn JPH11154095A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP32273697A JPH11154095A (en) 1997-11-25 1997-11-25 Operation method and device and transmission medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP32273697A JPH11154095A (en) 1997-11-25 1997-11-25 Operation method and device and transmission medium

Publications (1)

Publication Number Publication Date
JPH11154095A true JPH11154095A (en) 1999-06-08

Family

ID=18147062

Family Applications (1)

Application Number Title Priority Date Filing Date
JP32273697A Withdrawn JPH11154095A (en) 1997-11-25 1997-11-25 Operation method and device and transmission medium

Country Status (1)

Country Link
JP (1) JPH11154095A (en)

Similar Documents

Publication Publication Date Title
US7725883B1 (en) Program interpreter
US6286134B1 (en) Instruction selection in a multi-platform environment
JP4699580B2 (en) Method for static initialization of data processing system array, data processing method, and computer-readable storage medium storing data processing system and program for causing computer to execute control procedure thereof
US6233733B1 (en) Method for generating a Java bytecode data flow graph
US7103881B2 (en) Virtual machine to provide compiled code to processing elements embodied on a processor device
US6922827B2 (en) Iterative software development environment with prioritized build rules
KR100311585B1 (en) System and method for optimizing template object files
US5920723A (en) Compiler with inter-modular procedure optimization
EP1145120B1 (en) Generating compiled programs for interpretive runtime environments
EP1011043A2 (en) Method and apparatus for loading a java application program
KR100750834B1 (en) A method of data call stack tracing in data monitoring of JAVA byte code and a device for storing the method in compter program type
US7213237B2 (en) Intermediate code preprocessing apparatus, intermediate code execution apparatus, intermediate code execution system, and computer program product for preprocessing or executing intermediate code
EP0428560A4 (en) Machine process for translating programs in binary machine language into another binary machine language
JP2000222220A (en) Dynamically compiling time setting method, byte code executing mode selecting method and computer
US6931638B2 (en) Method and apparatus to facilitate sharing optimized instruction code in a multitasking virtual machine
US7100154B2 (en) Dynamic compiler apparatus and method that stores and uses persistent execution statistics
JPH10507016A (en) System, method and compiler preprocessor for conditionally compiling software compilation units
JPH07230386A (en) Data processor and method for calling control routine
US20010042241A1 (en) Apparatus and method for executing program using just-in time-compiler system
US7036120B2 (en) Two tier clusters for representation of objects in Java programming environments
JPH11154095A (en) Operation method and device and transmission medium
Chambers et al. Iterative type analysis and extended message splitting: Optimizing dynamically-typed object-oriented programs
Woodroffe Forth language
JPH02271430A (en) Program executing device

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20050201