JP2001084146A - Device and method for executing byte code - Google Patents

Device and method for executing byte code

Info

Publication number
JP2001084146A
JP2001084146A JP24317699A JP24317699A JP2001084146A JP 2001084146 A JP2001084146 A JP 2001084146A JP 24317699 A JP24317699 A JP 24317699A JP 24317699 A JP24317699 A JP 24317699A JP 2001084146 A JP2001084146 A JP 2001084146A
Authority
JP
Japan
Prior art keywords
bytecode
instruction
executed
byte
interpreter
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
JP24317699A
Other languages
Japanese (ja)
Other versions
JP3524024B2 (en
Inventor
Kazunori Ogata
一則 緒方
Hideaki Komatsu
秀昭 小松
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.)
International Business Machines Corp
Original Assignee
International Business Machines 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 International Business Machines Corp filed Critical International Business Machines Corp
Priority to JP24317699A priority Critical patent/JP3524024B2/en
Publication of JP2001084146A publication Critical patent/JP2001084146A/en
Application granted granted Critical
Publication of JP3524024B2 publication Critical patent/JP3524024B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

PROBLEM TO BE SOLVED: To successively quickly execute a Java byte code or the like. SOLUTION: An interpreter 326 prepares n pieces of processing routines corresponding to n bytes included in the word of a CPU, and reuses a byte code loaded for processing a certain processing routine for the following processing routines, and minimizes the number of times that the CPU loads the byte code. Moreover, the interpreter 326 speculatively decodes the candidate of the the second byte code ahead by using the dead pipe line of the CPU for masking any overhead generated at the time of decoding the byte code.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、Javaバイトコード
を逐次、解釈して実行するJavaインタプリタなどの
バイトコード実行装置およびその方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a bytecode execution device such as a Java interpreter for sequentially interpreting and executing Java bytecodes and a method thereof.

【0002】[0002]

【従来の技術】仮想マシンのバイトコードで記述された
プログラムを実行する環境、例えばJava−VM(Jav
a Virtual Machine)等において、プログラムのバイトコ
ードを逐次解釈し、実行するインタプリタが広く用いら
れている。このようなインタプリタでは、次に実行する
バイトコードに応じた処理を行うバイトコード処理ルー
チンを決定するために、バイトコードをフェッチ・デコ
ード処理する必要がある。
2. Description of the Related Art An environment for executing a program described in byte code of a virtual machine, for example, Java-VM (Jav
a Virtual Machine) and the like, an interpreter that sequentially interprets and executes byte codes of a program is widely used. In such an interpreter, it is necessary to fetch and decode the bytecode in order to determine a bytecode processing routine that performs a process according to the bytecode to be executed next.

【0003】[インタプリタ実行速度制限要因]これらの
処理は、例えば、コンパイラ等により予めソースプログ
ラムから特定の汎用CPU(インテル社x86系プロセ
ッサ、モトローラ社およびIBM社などが製造している
PowerPC系プロセッサなど)用に作成されたオブ
ジェクトプログラムを実行する場合には必要とされない
インタプリタに固有の処理であって、これらの処理に起
因する下記の要因が、インタプリタの実行速度を制限し
てしまう。
[Interpreter execution speed limiting factors] These processes are performed by a compiler or the like in advance from a source program using a specific general-purpose CPU (Intel x86 processor, PowerPC processor manufactured by Motorola, IBM, or the like). ) Are processes unique to the interpreter that are not required when executing the object program created for (1), and the following factors resulting from these processes limit the execution speed of the interpreter.

【0004】[同一ワードの複数回ロード]インタプリタ
実行においては、計算に使うデータに加えて、バイトコ
ードをメモリからロードするために、ロード・ストア処
理の割合が高い。特に最近の汎用CPUは、ほとんどの
場合、データサイズに関わらずワード単位のメモリアク
セスを行うように構成されている。したがって、例え
ば、汎用CPUが、2つのバイトコードをフェッチする
場合には、これら2つのバイトコードが同じワードに含
まれていても、必ず同じワードを2回ロードしてしま
う。
[Loading the same word multiple times] In the execution of the interpreter, a load / store process is performed at a high rate because a bytecode is loaded from a memory in addition to data used for calculation. In particular, most recent general-purpose CPUs are configured to perform memory access in word units regardless of the data size in most cases. Therefore, for example, when the general-purpose CPU fetches two bytecodes, the same word is always loaded twice even if these two bytecodes are included in the same word.

【0005】つまり、プログラムのバイトコードは、通
常、汎用CPUのワードより短いので、同一のワードに
複数(n個)のバイトコードが含まれる可能性が高い。
このような場合であっても、汎用CPUは、同じワード
に含まれる複数(n個)のバイトコードのフェッチのた
めに、同一のワードを複数(n)回、ロードする必要か
ら、無駄なロード命令を実行しなければならないという
ことが、インタプリタの実行速度を大きく制限する。し
かも、このようなロード命令の実行は、汎用CPUに含
まれるロード・ストアパイプラインの負荷を不要に高く
するという点からも、インタプリタ実行速度の制限要因
となる。
That is, since the byte code of a program is usually shorter than the word of a general-purpose CPU, there is a high possibility that the same word contains a plurality of (n) byte codes.
Even in such a case, the general-purpose CPU needs to load the same word a plurality of (n) times to fetch a plurality (n) of bytecodes included in the same word. The need to execute instructions severely limits the execution speed of the interpreter. Moreover, such execution of the load instruction is a limiting factor of the execution speed of the interpreter also in that the load of the load / store pipeline included in the general-purpose CPU is unnecessarily increased.

【0006】[異なるワードに存在するオペランドとオ
ペコード]また、バイト単位のロードとワード単位のロ
ードはどちらも1命令であることと、バイトコードの命
令長が通常1ワードより短いこととに着目して、フェッ
チに必要なロード命令数を減らすために、ワード単位の
ロード命令により、オペランドとオペコードとを同時に
フェッチする最適化手法がある。このようにバイトコー
ドを最適化すると、異なるワードにまたがって存在する
オペランドとオペコードとをロードしようとする場合に
は、汎用CPUは、2つのワードをロードする必要があ
るので、このことが、ロード・ストアパイプラインの負
荷をさらに高め、インタプリタ実行速度を制限してしま
う。
[Operands and Opcodes Existing in Different Words] In addition, attention is paid to the fact that the loading in byte units and the loading in word units are both one instruction, and that the instruction length of the bytecode is usually shorter than one word. In order to reduce the number of load instructions required for fetching, there is an optimization method of fetching operands and opcodes simultaneously by a load instruction in word units. When the bytecode is optimized in this manner, when trying to load an operand and an opcode that exist over different words, the general-purpose CPU needs to load two words. -The load on the store pipeline is further increased, and the interpreter execution speed is limited.

【0007】[デコード処理のオーバーヘッド]また、各
バイトコードの処理において、バイトコードのデコード
処理が終わらないうちは、プログラム実行のためのジャ
ンプ先が決まらない。このようなデコード処理が終わる
までジャンプ先を決定できないという依存関係は、デコ
ード処理にオーバーヘッドを生じさせ、インタプリタ実
行速度素制限してしまう。
[Decoding Processing Overhead] In the processing of each byte code, a jump destination for program execution is not determined until the decoding processing of the byte code is completed. Such a dependency that the jump destination cannot be determined until the decoding process is completed causes overhead in the decoding process and limits the execution speed of the interpreter.

【0008】[0008]

【発明が解決しようとする課題】本発明は、上述した従
来技術の問題点に鑑みてなされたものであり、インター
プリタの実行速度を制限する要因を解決し、バイトコー
ドを高速に実行することができるバイトコード実行装置
およびその方法を提供することを目的とする。また、本
発明は、特に、仮想マシンのバイトコードの高速実行に
適したバイトコード実行装置およびその方法を提供する
ことを目的とする。
SUMMARY OF THE INVENTION The present invention has been made in view of the above-mentioned problems of the prior art, and has been made in view of the above circumstances, and has been made in view of the above circumstances. It is an object of the present invention to provide a bytecode execution device and a method thereof. Another object of the present invention is to provide a bytecode execution apparatus and a method suitable for high-speed execution of bytecode of a virtual machine.

【0009】[0009]

【課題を達成するための手段】[バイトコード実行装
置]上記目的を達成するために、バイト単位で命令長が
変化しうる複数の種類の命令を、それぞれ複数のバイト
を含むワードを処理単位とするCPUで順次、実行する
バイトコード実行装置であって、前記バイトコードを前
記ワード単位で読み出し、任意の時点で実行されている
前記命令の2つ以上後のバイトを、前記命令のオペコー
ドとして先行してデコードし、先行デコード結果とする
先行デコード手段と、前記任意の時点で実行されている
前記命令の種類に基づいて、前記任意の時点で実行され
ている前記命令の2つ以上後のバイトが、前記命令のオ
ペコードである場合には、次に、前記先行デコード結果
を実行し、これ以外の場合には、前記任意の時点で実行
されている前記命令の次のバイトをデコードして実行す
るバイトコード実行手段とを有する。
Means for Achieving the Object [Byte code execution device] In order to achieve the above object, a plurality of types of instructions whose instruction length can be changed in byte units are defined as words each including a plurality of bytes as a processing unit. A bytecode execution device for sequentially executing the bytecode by the CPU, wherein the bytecode is read in units of the word, and two or more bytes subsequent to the instruction being executed at an arbitrary time point are preceded as an operation code of the instruction. And a preceding decoding means for decoding as a result of the preceding decoding, and a byte two or more bytes later than the instruction being executed at the arbitrary time based on the type of the instruction being executed at the arbitrary time Is the operation code of the instruction, then the preceding decoding result is executed; otherwise, the instruction being executed at the arbitrary time is And a bytecode execution unit that decodes and executes the next byte.

【0010】[バイトコード実行方法]また、本発明に
かかるバイトコード実行方法は、バイト単位で命令長が
変化しうる複数の種類の命令を、それぞれ複数のバイト
を含むワードを処理単位とするCPUで順次、実行する
バイトコード実行方法であって、前記バイトコードを前
記ワード単位で読み出し、任意の時点で実行されている
前記命令の2つ以上後のバイトを、前記命令のオペコー
ドとして先行してデコードし、先行デコード結果とし、
前記任意の時点で実行されている前記命令の種類に基づ
いて、前記任意の時点で実行されている前記命令の2つ
以上後のバイトが、前記命令のオペコードである場合に
は、次に、前記先行デコード結果を実行し、これ以外の
場合には、前記任意の時点で実行されている前記命令の
次のバイトをデコードして実行する。
[Byte Code Execution Method] In addition, a byte code execution method according to the present invention provides a CPU in which a plurality of types of instructions whose instruction lengths can change in byte units are processed in units of words each including a plurality of bytes. A byte code execution method for sequentially executing the instruction, wherein the byte code is read in units of the word, and two or more bytes subsequent to the instruction being executed at an arbitrary time are preceded as an operation code of the instruction. Decode, make the preceding decode result,
Based on the type of the instruction being executed at any time, based on the type of the instruction being executed at any time, if the byte two or more bytes later is the operation code of the instruction, then: Executing the preceding decoding result; otherwise, decoding and executing the next byte of the instruction being executed at the arbitrary time.

【0011】[媒体]また、本発明にかかる媒体は、バ
イト単位で命令長が変化しうる複数の種類の命令を、そ
れぞれ複数のバイトを含むワードを処理単位とするCP
Uで順次、実行するバイトコード実行を行うプログラム
であって、前記バイトコードを前記ワード単位で読み出
し、任意の時点で実行されている前記命令の2つ以上後
のバイトを、前記命令のオペコードとして先行してデコ
ードし、先行デコード結果するステップと、前記任意の
時点で実行されている前記命令の種類に基づいて、前記
任意の時点で実行されている前記命令の2つ以上後のバ
イトが、前記命令のオペコードである場合には、次に、
前記先行デコード結果を実行し、これ以外の場合には、
前記任意の時点で実行されている前記命令の次のバイト
をデコードして実行するステップとをコンピュータに実
行させるプログラムを媒介する。
[Medium] Further, the medium according to the present invention includes a plurality of types of instructions whose instruction length can be changed in byte units, and a plurality of instructions each having a word including a plurality of bytes as a processing unit.
U is a program for performing bytecode execution sequentially, wherein the bytecode is read in units of the word, and two or more bytes subsequent to the instruction being executed at an arbitrary time are used as an operation code of the instruction. Decoding in advance and performing a preceding decoding result; and, based on a type of the instruction being executed at the arbitrary time, a byte two or more bytes after the instruction being executed at the arbitrary time is: If the instruction is the opcode, then
Execute the preceding decoding result, otherwise,
Decoding and executing the next byte of the instruction being executed at the arbitrary point in time.

【0012】[0012]

【発明の実施の形態】以下、本発明の実施形態を説明す
る。
Embodiments of the present invention will be described below.

【0013】[ロードの最適化・バイトコードの再利用]
本発明にかかるバイトコード実行方法を実現するインタ
プリタにおいては、CPUが処理単位とする1ワードに
含まれる複数(n個)のバイトそれぞれに対応して1つ
ずつ、複数(n個)のバイトコード処理ルーチンが用意
される。つまり、例えば、本発明に係るインタプリタを
実行するCPUが、32ビット(4バイト)分のデータ
を1ワードとして処理単位とする場合には、インタプリ
タに4つのバイトコード処理ルーチンが備えられ、CP
Uが64ビット(8バイト)を1ワードとして処理する
場合には、インタプリタに8つのバイトコード処理ルー
チンが備えられる。
[Load optimization / reuse of bytecode]
In an interpreter for implementing the bytecode execution method according to the present invention, a plurality of (n) bytecodes are provided, one for each of a plurality of (n) bytes included in one word as a processing unit by the CPU. A processing routine is prepared. That is, for example, when the CPU that executes the interpreter according to the present invention uses 32-bit (4 bytes) data as one word as a processing unit, the interpreter is provided with four byte code processing routines,
When U processes 64 bits (8 bytes) as one word, the interpreter is provided with eight byte code processing routines.

【0014】デコードテーブルは、ワードそれぞれに含
まれるn個のバイトそれぞれに対応して1つずつ、n種
類、設けられ、バイトコード(1つの命令分の全体で、
「オペランド」と「オペコード」とを含む)が示すオペ
コード(「バイトコード」の「機能コード」に相当)
は、このオペコードのワード内の位置(バイト)に対応
するデコードテーブル(各バイトコードごとに、オペコ
ードをそれに対応する処理ルーチンのアドレスへ変換す
る変換テーブル)の参照により、デコード(オペコード
を取り出し、デコードテーブルを参照して処理ルーチン
のアドレスを求めること)され、オペコードの処理ルー
チンのアドレスが求められる。なお、デコードテーブル
を参照せずにデコードすることも可能であるが、このよ
うな場合には、オペコードの種類と、ワードにおけるオ
ペコードの位置とに基づいて、処理ルーチンのアドレス
が求められるようにすればよい。
There are provided n types of decode tables, one for each of the n bytes included in each word, and a byte code (for one instruction as a whole,
Opcode indicated by "operand" and "opcode" (corresponds to "function code" of "bytecode")
Decodes (extracts the operation code and decodes it by referring to a decoding table (conversion table for converting the operation code into an address of a processing routine corresponding to the byte code for each byte code) corresponding to the position (byte) in the word of the operation code. The address of the processing routine of the operation code is obtained by referring to the table). It is also possible to decode without referring to the decode table, but in such a case, the address of the processing routine is determined based on the type of the operation code and the position of the operation code in the word. I just need.

【0015】さらに、CPUがバイトコードをロードす
る回数を最小限にするために、インタプリタは、ある処
理ルーチン(一連のバイトコードに含まれる処理ルーチ
ン)を処理するためにロードしたバイトコードを、それ
に続く処理ルーチンを処理するために再利用する。この
再利用のために、インタプリタは、CPUのレジスタか
ら、バッファレジスタを、出現頻度の高いバイトコード
のオペランドのワード数より1つ多い数(ワード数+
1)だけ選択し、ロードしたバイトコードを、選択した
バッファレジスタに格納する。
Further, in order to minimize the number of times the CPU loads the bytecode, the interpreter transmits the bytecode loaded for processing a certain processing routine (a processing routine included in a series of bytecodes) to the processing routine. Reuse to process subsequent processing routines. For this reuse, the interpreter sets the buffer register from the CPU register to a number (word number + word number) which is one more than the number of words of the frequently occurring bytecode operand.
Only 1) is selected and the loaded bytecode is stored in the selected buffer register.

【0016】このように、インタープリタがロード済み
のバイトコードを格納することにより、インタプリタが
ワードの最後に位置するオペコードを実行する場合であ
っても、オペランド全体がすでにバッファレジスタにロ
ードされていることになる。したがって、インタプリタ
は、処理ルーチンの先頭からオペランドの生成を開始す
ることができ、効率よくバイトコードが再利用される。
バッファレジスタにロードしたバイトコードの最後の1
ワードを使いきると、インタプリタは、次の処理ルーチ
ンの1ワード目を読み込む。このようにインタプリタが
バイトコードのロードを行うことにより、バイトコード
のフェッチのために、インタプリタにロードするワード
数を必要最小限にすることができる。
As described above, by storing the bytecode that has been loaded by the interpreter, even when the interpreter executes the opcode located at the end of the word, the entire operand has already been loaded into the buffer register. become. Therefore, the interpreter can start generating the operand from the beginning of the processing routine, and the bytecode is efficiently reused.
Last 1 of bytecode loaded in buffer register
When the word has been used up, the interpreter reads the first word of the next processing routine. By loading the bytecode by the interpreter in this way, the number of words to be loaded into the interpreter for fetching the bytecode can be minimized.

【0017】上述の通り、上で書いたように、最適な実
装のためには、バイトコード読み込みのためのコード
を、各処理ルーチンにインラインする必要がある。好適
な実装では、バイトコードをバッファレジスタに読み込
む処理を、各処理ルーチンにコピーし、その処理ルーチ
ン本来の処理と併せてマシンコードを配置することによ
り、その処理ルーチンとバイトコード読み込み処理を順
次実行した場合に比べて、CPUパイプラインのストール
を減らし、実行速度を向上することができる。
As described above, as described above, for optimal implementation, it is necessary to inline the code for reading the bytecode into each processing routine. In a preferred implementation, the processing of reading the bytecode into the buffer register is copied to each processing routine, and the processing routine and the bytecode reading processing are sequentially executed by arranging the machine code together with the original processing of the processing routine. As compared with the case where the CPU pipeline is executed, the stall of the CPU pipeline can be reduced and the execution speed can be improved.

【0018】バイトコードをバッファレジスタに読み込
む必要があるか否かは、バイトコードのオペコードのワ
ードにおける位置とバイトコードの長さとに基づいて判
断でき、また、バイトコード処理ルーチンを、オペコー
ドのワードそれぞれに対して用意することとを考慮する
と、このような最適な実装においては、バイトコードを
バッファレジスタに読み込む処理を処理ルーチンにコピ
ーする必要があるかを、処理ルーチン作成時に判断でき
る。したがって、バイトコードを読み込む必要のある処
理ルーチンのみが、バイトコード読み込み処理のための
オーバーヘッドをインタープリタの実行時に負担するよ
うに最適化できる。
Whether or not the bytecode needs to be read into the buffer register can be determined based on the position of the bytecode in the word of the opcode and the length of the bytecode. In such an optimal implementation, it is possible to determine whether it is necessary to copy the processing of reading the bytecode into the buffer register to the processing routine when creating the processing routine. Therefore, only the processing routine that needs to read the bytecode can be optimized so as to bear the overhead for the bytecode reading process when the interpreter is executed.

【0019】また、処理ルーチンは必要に応じてオペラ
ンドをバッファレジスタから取り出すが、オペランドの
バッファレジスタ内の位置はオペコードのワード中の位
置に応じて変わるので、処理ルーチンごとにオペランド
の位置を判断する必要がある。本発明にかかる方法で
は、処理ルーチンをオペコードのワード中の位置ごとに
用意し、処理ルーチン作成時にオペランドの位置を決定
できるので、インタープリタ実行時にオペランドの位置
を判断するオーバーヘッドがなくなるように実装でき
る。
The processing routine fetches the operand from the buffer register as necessary. Since the position of the operand in the buffer register changes according to the position in the word of the opcode, the position of the operand is determined for each processing routine. There is a need. In the method according to the present invention, the processing routine is prepared for each position in the word of the operation code, and the position of the operand can be determined at the time of creating the processing routine. Therefore, it is possible to implement such that the overhead of determining the position of the operand at the time of executing the interpreter is eliminated.

【0020】なお、ワードに含まれる複数(n個)のバ
イトそれぞれに対応して設けられたバイトコード処理ル
ーチンそれぞれは、対応するバイト位置に応じて最適化
を行う。したがって、各処理ルーチンは、オペランドを
取り出すためのビット操作や、次のバイトコードの読み
込みを必要とするかを、インタープリタの実行時に判断
する必要はない。
Each of the bytecode processing routines provided corresponding to a plurality of (n) bytes included in a word performs optimization according to the corresponding byte position. Therefore, there is no need for each processing routine to judge at the time of execution of the interpreter whether bit manipulation for extracting an operand or reading of the next bytecode is required.

【0021】ここの説明においては、4バイトを1ワー
ドとして処理の単位とするCPU上で、ワード境界から
始まる4個の1バイト命令A,B,C,Dを実行する場
合を具体例とする。従来のインタプリタは、これら4つ
の命令を実行するために、合計7ワード分のデータをロ
ードする必要がある。この理由は、従来のインタプリタ
は、ワードの先頭(第1バイト)に位置する命令Aを実
行する場合には、当該ワード(命令A,B,C,Dを含
むワード)をロードすればよいのに対し、命令B,C,
Dそれぞれを実行する場合には、当該ワードの第2,第
3,第4バイトから、その次のワードの第1,第2,第
3バイトまでのそれぞれ1ワード分のデータをロードす
る必要があるので、結局、2ワードずつのロードが必要
になるためである。一方、以上のようにバイトコードの
ロードを最適化し、バイトコードの再利用を図る本発明
にかかるインタプリタは、これら4個の命令を含む1ワ
ードを1回、ロードするだけでよいので、本発明にかか
るインタプリタによると、ロードの回数を7回(7ワー
ド)から1回(1ワード)に大きく減らすことができ、
さらに、CPUのロード・ストアパイプラインの負荷が
大きく軽減される。
In the following description, a specific example will be described in which four 1-byte instructions A, B, C, and D starting from a word boundary are executed on a CPU using 4 bytes as one word as a processing unit. . Conventional interpreters need to load a total of seven words of data to execute these four instructions. The reason is that the conventional interpreter only has to load the word (the word including the instructions A, B, C, and D) when executing the instruction A located at the head (first byte) of the word. For instructions B, C,
To execute each of D, it is necessary to load one word of data from the second, third, and fourth bytes of the word to the first, second, and third bytes of the next word. This is because it is necessary to load two words at a time. On the other hand, the interpreter according to the present invention that optimizes the loading of bytecode and reuses bytecode as described above only needs to load one word including these four instructions once. According to the interpreter, the number of times of loading can be greatly reduced from seven times (7 words) to one time (one word),
Further, the load on the load / store pipeline of the CPU is greatly reduced.

【0022】さらに、64ビット(8バイト)を処理単
位とするCPU上で8個の連続した命令A,B,C,
D,E,F,G,Hを実行する場合を具体例にする。こ
の場合、上述したのと同様な理由により、本発明にかか
るインタプリタを用いた場合には、これら8つの命令の
ために1ワードをロードすればよいのに対し、従来から
のインタプリタでは15ワードのロードが必要になるの
で、ロードしなければならないワード数を1/15に大
きく減らすことができる。
Further, on the CPU using 64 bits (8 bytes) as a processing unit, eight consecutive instructions A, B, C,
A case where D, E, F, G, and H are executed will be described as a specific example. In this case, for the same reason as described above, when the interpreter according to the present invention is used, it is sufficient to load one word for these eight instructions, while the conventional interpreter uses 15 words. Since a load is required, the number of words to be loaded can be greatly reduced to 1/15.

【0023】[デコードオーバーヘッドの隠蔽]本発明
にかかるインタプリタにおいて、さらに、各ワードに含
まれるバイトそれぞれに対応して設けられたバイトコー
ド処理ルーチンは、次の次(2つ後の)バイトコードの
候補を、CPUのパイプラインの空きを利用して投機的
にデコードすることにより、バイトコードのデコードの
際に生じるオーバーヘッドを隠蔽する。ここで、2つ後
のバイトコードのオペコードの候補とは、次(1つ後)
のバイトコードが、出現頻度の高い命令フォーマットで
ある場合に、その次(2つ後)のバイトコードのオペコ
ードとなるバイトとして定義される。
[Concealment of Decoding Overhead] In the interpreter according to the present invention, the bytecode processing routine provided for each byte included in each word further includes a bytecode processing routine for the next (second next) bytecode. By speculatively decoding candidates using a vacancy of the pipeline of the CPU, the overhead generated when decoding the bytecode is concealed. Here, the opcode candidate of the bytecode after two is the next (one after)
Is an instruction format with a high appearance frequency, it is defined as a byte that is an operation code of the next (two subsequent) byte code.

【0024】例えば、一般に、バイトコードには1バイ
ト命令が最も多く含まれるので、バイトコードに含まれ
る各処理ルーチンにおいて、各時点で実行されているバ
イトコードの終りから2バイト先(2つ後のバイト)
が、2つ後のバイトコードのオペコードである可能性が
最も高いと予測することができる。従って、各時点で実
行されているバイトの2つ先のバイトを、投機的にデコ
ードすることにより、CPUのパイプラインの空きを有
効利用できる。
For example, in general, a bytecode contains the largest number of 1-byte instructions. Therefore, in each processing routine included in the bytecode, the bytecode being executed at each point in time is two bytes ahead (two bytes later). Bytes)
Can be predicted to be most likely to be the opcode of the next two bytecodes. Therefore, by speculatively decoding the byte two bytes ahead of the byte being executed at each point in time, it is possible to effectively use the vacancy of the CPU pipeline.

【0025】デコードする候補の数は、例えば、出現頻
度の高い命令フォーマットの数とその出現頻度、およ
び、実行するCPUの実行ユニット構成により決まる、
各処理ルーチンでの整数パイプラインの空きサイクル数
により、実測あるいは実験などにより決定される。各バ
イトコード処理ルーチンは、そのバイトコードのフォー
マットに応じて、次のバイトコードのデコードが必要で
あるかを判断し、デコードが必要と判断した場合には、
確定したオペコードをデコードする。この場合、2つ後
のバイトコードに対する投機的デコードは無駄になる
が、出現頻度の高いフォーマットについて投機的デコー
ドを行なうので、無駄になる確率は低い。
The number of candidates to be decoded is determined by, for example, the number of instruction formats having a high frequency of appearance and their frequency of appearance, and the execution unit configuration of the CPU to be executed.
It is determined by actual measurement or experiment based on the number of empty cycles of the integer pipeline in each processing routine. Each bytecode processing routine determines whether the next bytecode needs to be decoded according to the format of the bytecode, and if it determines that decoding is necessary,
Decode the determined opcode. In this case, speculative decoding of the bytecode after the second is useless, but speculative decoding is performed on a format having a high appearance frequency, so that the probability of wasting is low.

【0026】さらに、各バイトコード処理ルーチンは、
投機的デコード処理のオーバーヘッドを最小限にするた
めに、投機的デコード結果を再利用する。このデコード
結果の再利用のためには、デコード結果を保持するレジ
スタ(以下、アドレスプールレジスタと記す)が、各ワ
ードに含まれるバイトそれぞれに対応づけて設けられ、
これらのアドレスプールレジスタには、対応するバイト
に対してオペコードの候補をデコードした結果が格納さ
れる。各処理ルーチンでは、新たにオペコードの候補と
なったバイトのみをデコードする。
Further, each byte code processing routine includes:
Reuse the speculative decoding result to minimize the overhead of the speculative decoding process. In order to reuse the decoding result, a register for holding the decoding result (hereinafter referred to as an address pool register) is provided in association with each byte included in each word,
These address pool registers store the results of decoding the opcode candidates for the corresponding bytes. In each processing routine, only the bytes that are newly candidates for the operation code are decoded.

【0027】各バイトコード処理ルーチンは、各時点で
実行されているオペコードのバイト位置に対応するアド
レスプールレジスタから、1つ後のバイトコードのデコ
ード結果を取得する。オペコードのバイト位置ごとに、
バイトコード処理ルーチンが別々に設けられているの
で、どのアドレスプールレジスタから取得するかを実行
時に判断する必要はない。
Each byte code processing routine obtains the decoding result of the next byte code from the address pool register corresponding to the byte position of the operation code executed at each time. For each byte position in the opcode,
Since the bytecode processing routines are separately provided, it is not necessary to determine which address pool register to acquire from at the time of execution.

【0028】[コンピュータネットワーク1]以下、本
発明にかかるバイトコード実行方法を応用したコンピュ
ータネットワーク1を説明する。図1は、本発明にかか
るバイトコード実行方法を応用したコンピュータネット
ワーク1の構成を示す図である。図1に示すように、コ
ンピュータネットワーク1は、サーバコンピュータ1
0、ISDN網等のデータ通信が可能な通信網20およ
びクライアントコンピュータ30から構成される。
[Computer Network 1] A computer network 1 to which the bytecode execution method according to the present invention is applied will be described below. FIG. 1 is a diagram showing a configuration of a computer network 1 to which a bytecode execution method according to the present invention is applied. As shown in FIG. 1, the computer network 1 is composed of a server computer 1
0, a communication network 20 capable of data communication such as an ISDN network, and a client computer 30.

【0029】クライアントコンピュータ30は、x86
系あるいはPowerPC系のCPU、メモリおよびこ
れらの周辺回路および等(図示せず)を含む一般的なコ
ンピュータのハードウェア300、マイクロソフト社の
WindowsあるいはIBM社のOS2といったオペ
レーティングシステム(OS)302、Java仮想マ
シン32、ハードディスク装置(HDD)、DVD装置
等の記憶装置34を含む。
The client computer 30 has the x86
General computer hardware 300 including a system or PowerPC system CPU, memory and their peripheral circuits and the like (not shown), an operating system (OS) 302 such as Microsoft's Windows or IBM's OS2, and a Java virtual machine. It includes a storage device 34 such as a machine 32, a hard disk device (HDD), and a DVD device.

【0030】Java仮想マシン32は、JITコンパ
イラ322、本発明にかかるバイトコード実行方法を適
用したバイトコードインタプリタ324、および、Ja
va仮想マシンランタイム関数320を含む。サーバコ
ンピュータ10は、クライアントコンピュータ30と同
様な構成部分(図示を省略)を含む一般的なコンピュー
タであって、記憶装置34と同様な記憶装置106およ
びJavaコンパイラ102を含む。
The Java virtual machine 32 includes a JIT compiler 322, a bytecode interpreter 324 to which the bytecode execution method according to the present invention is applied, and Java.
va virtual machine runtime function 320. The server computer 10 is a general computer including components (not shown) similar to the client computer 30, and includes a storage device 106 similar to the storage device 34 and a Java compiler 102.

【0031】[Javaコンパイラ102]サーバコン
ピュータ10において、Javaコンパイラ102は、
ユーザが作成し、記憶装置106に記憶されたJava
プログラム100を読み出してコンパイルし、クライア
ントコンピュータ30側のJava仮想マシン32によ
り実行可能なJavaバイトコード104を生成し、記
憶装置106に対して出力する。
[Java Compiler 102] In the server computer 10, the Java compiler 102
Java created by the user and stored in the storage device 106
The program 100 reads and compiles the program 100, generates a Java bytecode 104 executable by the Java virtual machine 32 on the client computer 30 side, and outputs it to the storage device 106.

【0032】[記憶装置106]記憶装置106は、ユ
ーザによる操作に応じて、作成されたJavaプログラ
ム100を記憶・管理し、Javaコンパイラ102に
対して出力する。また、106は、同様に、Javaコ
ンパイラ102から入力されたバイトコード104を記
憶・管理し、外部からの要求に応じて、記憶・管理した
バイトコード104を、通信網20を介してクライアン
トコンピュータ30に対して送信する。
[Storage Device 106] The storage device 106 stores and manages the created Java program 100 in response to an operation by the user, and outputs it to the Java compiler 102. Similarly, 106 stores and manages the bytecode 104 input from the Java compiler 102, and stores the stored and managed bytecode 104 via the communication network 20 on the client computer 30 in response to an external request. Send to

【0033】[Java仮想マシン32]Java仮想
マシン32は、通信網20および記録媒体40等を介し
てクライアントコンピュータ30に供給され、ハードウ
ェア300のメモリにロードされて、OS302上で動
作する。Java仮想マシン32は、サーバコンピュー
タ10から通信網20を介して送られてきたバイトコー
ド104、または、記録媒体40を介してえ34に供給
されたバイトコード104を実行する。
[Java Virtual Machine 32] The Java virtual machine 32 is supplied to the client computer 30 via the communication network 20 and the recording medium 40, is loaded into the memory of the hardware 300, and operates on the OS 302. The Java virtual machine 32 executes the bytecode 104 sent from the server computer 10 via the communication network 20 or the bytecode 104 supplied to the server 34 via the recording medium 40.

【0034】[Javaランタイム関数320]Jav
a仮想マシンランタイム関数は、Javaの言語仕様の
うち、バイトコードの仕様以外の部分を処理する関数群
であって、例えば、まだメモリにロードされていないバ
イトコードを、記憶装置等からメモリにロードしたり、
オブジェクトを作成するために、メモリ内の領域を確保
したりする。
[Java Runtime Function 320] Java
a A virtual machine runtime function is a group of functions for processing a part of the Java language specification other than the bytecode specification. For example, a bytecode not yet loaded into the memory is loaded from the storage device or the like into the memory. Or
Allocate an area in memory to create an object.

【0035】[JITコンパイラ322]Java仮想
マシン32において、JITコンパイラ322は、バイ
トコード104をコンパイルし、ハードウェア300の
CPUが実行可能なマシンコードの形式のバイトコード
324を生成する。生成されたマシンコード形式バイト
コード324は、ハードウェア300のCPU(図示せ
ず)により実行される。
[JIT Compiler 322] In the Java virtual machine 32, the JIT compiler 322 compiles the bytecode 104 and generates a bytecode 324 in the form of a machine code executable by the CPU of the hardware 300. The generated machine code format bytecode 324 is executed by a CPU (not shown) of the hardware 300.

【0036】[バイトコードインタプリタ326]バイ
トコードインタープリタ326は、ここまでに述べた本
発明にかかるバイトコード実行方法を実現するために必
要な構成部分を含み、バイトコード104を1命令ずつ
処理し、バイトコードごとに定義された操作を行う。ま
た、バイトコードインタープリタ326は、バイトコー
ドをHDD等の記憶装置や、通信網から読み込む、およ
び、OS302への要求など、バイトコード操作以外の
処理を、Javaランタイム関数320を介して処理す
る。
[Bytecode Interpreter 326] The bytecode interpreter 326 includes components necessary for implementing the above-described bytecode execution method according to the present invention, and processes the bytecode 104 one instruction at a time. Performs the operations defined for each bytecode. In addition, the bytecode interpreter 326 performs processing other than bytecode manipulation, such as reading the bytecode from a storage device such as an HDD or a communication network, and requesting the OS 302, via the Java runtime function 320.

【0037】具体的には、下記(1)〜(4)の処理が
実行される。 (1)Java仮想マシンランタイム関数は、Javク
ラスが持っているクラス定数表を参照して、そのバイト
コードを含むクラスの名前(「クラス名」)を取得する。 (2)クラス名を、Java実行時環境の仕様にしたが
って変換し、Javaクラスのすべての情報を含んだ
「クラスファイル」の、OS上のファイル名を取得す
る。 (3)「クラスファイル」から、バイトコード、およ
び、クラス定数表など、Javaクラスのすべての情報をメ
モリ上に読み込む。 (4)メモリ上に読み込まれた、そのクラスで実装され
ているすべてのメソッドのバイトコードの中から必要な
バイトコードのアドレスを検索し、取得する。
Specifically, the following processes (1) to (4) are executed. (1) The Java virtual machine runtime function refers to the class constant table of the Java class and acquires the name of the class including the bytecode (“class name”). (2) Convert the class name according to the specification of the Java runtime environment, and obtain the file name on the OS of the “class file” including all the information of the Java class. (3) From the "class file", read all information of the Java class, such as the bytecode and the class constant table, into the memory. (4) Search and obtain the address of the required bytecode from among the bytecodes of all the methods implemented in the class that have been read into the memory.

【0038】[バイトコードインタプリタ326の動
作]以下、図2〜図8を参照して、バイトコードインタ
プリタ326による本発明にかかるバイトコード実行処
理を中心に、コンピュータネットワーク1の動作を説明
する。図2は、図1に示したJava仮想マシン32の
バイトコードインタプリタ326の全体処理(S1)を
示すフローチャートである。図3は、図2に示したイン
タプリタ実行準備処理(S10)を示すフローチャート
である。図4は、図2に示した投機的デコードの確認処
理(S14)を示すフローチャートである。図5は、図
2に示したバイトコードの読み込み処理(S16)を示
すフローチャートである。図6は、図2に示した投機的
デコード処理(S18)を示すフローチャートである。
図7は、図2に示したメソッド呼び出し処理(S20)
を示すフローチャートである。図8は、図7に示したメ
ソッドの実行処理(S22)を示すフローチャートであ
る。
[Operation of Byte Code Interpreter 326] The operation of the computer network 1 will be described below with reference to FIGS. 2 to 8, focusing on the byte code execution processing according to the present invention by the byte code interpreter 326. FIG. 2 is a flowchart showing the overall processing (S1) of the bytecode interpreter 326 of the Java virtual machine 32 shown in FIG. FIG. 3 is a flowchart showing the interpreter execution preparation process (S10) shown in FIG. FIG. 4 is a flowchart showing the speculative decoding confirmation processing (S14) shown in FIG. FIG. 5 is a flowchart showing the bytecode reading process (S16) shown in FIG. FIG. 6 is a flowchart showing the speculative decoding process (S18) shown in FIG.
FIG. 7 is a method call process (S20) shown in FIG.
It is a flowchart which shows. FIG. 8 is a flowchart showing the execution process (S22) of the method shown in FIG.

【0039】なお、これらのこのフローチャートにおい
て、ハードウェア300のCPU(PowerPC60
4)の1ワードは4バイト構成で、アドレスプールレジ
スタは4個用意され、3個のオペコードの候補が投機的
にデコードされる。また、バッファレジスタは、2個用
意され、間接ジャンプについてはCPUアーキテクチャ
での方法を用いる。
In these flowcharts, the CPU (PowerPC 60) of the hardware 300 is used.
One word in 4) has a 4-byte configuration, four address pool registers are prepared, and three opcode candidates are speculatively decoded. Also, two buffer registers are prepared, and a method in the CPU architecture is used for the indirect jump.

【0040】図2に示すように、バイトコードインタプ
リタ326は、図3を参照して後述するインタプリタ実
行準備処理(S10)を行い、次に、ハードウェア30
0のCPUが処理単位とするワードに含まれる複数(k
個)のバイトそれぞれに対して、バイトコード処理ルー
チン(S12)を実行する。
As shown in FIG. 2, the bytecode interpreter 326 performs an interpreter execution preparation process (S10) described later with reference to FIG.
0 (CPU) 0
A byte code processing routine (S12) is executed for each of the bytes.

【0041】図3に示すように、インタプリタ実行準備
処理(S10)のステップ100(S100)におい
て、バイトコードインタプリタ326は、バイトコード
104から、最初に実行するバイトコードを含む1ワー
ドを読み込み、ハードウェア300のCPU内のレジス
タから選択したバッファレジスタに読み込む。
As shown in FIG. 3, in step 100 (S100) of the interpreter execution preparation process (S10), the bytecode interpreter 326 reads one word including the bytecode to be executed first from the bytecode 104, and The data is read into a buffer register selected from a register in the CPU of the ware 300.

【0042】本発明を適用したバイトコードインタープ
リタでは、すべての処理ルーチン(A)は、その直前に
実行した処理ルーチン(Z)が、処理ルーチンAの処理
終了後にジャンプする飛び先アドレス(の候補)を、投機
的にデコードしていることを仮定している。しかし、最
初に実行する処理ルーチン(A0)には、Zに相当する
処理ルーチン(Z0)が存在しないので、「インタープリタ
実行準備処理」では、Zが行うべき投機的デコードを
(Z0が存在するかのように)行う。
In the byte code interpreter to which the present invention is applied, all the processing routines (A) are executed by the processing routine (Z) executed immediately before the processing routine (A). Is speculatively decoded. However, since there is no processing routine (Z0) corresponding to Z in the processing routine (A0) to be executed first, in the “interpreter execution preparation processing”, the speculative decoding to be performed by Z is determined by whether (Z0 exists or not). Do).

【0043】ステップ102(S102)において、バ
イトコードインタプリタ326がS100の処理におい
て読み込んだワードに含まれるバイト(バイトコード)
の内、それぞれに対応するいずれかをデコードする。こ
こでは、最初に実行するバイトコード(あるいは、メソ
ッドの最初のバイトコード)を、確定的にデコードす
る。本発明における「バイトコードのデコード」は、そ
のバイトコードを処理する処理ルーチンのアドレスを求
めている。
In step 102 (S102), the byte (byte code) included in the word read by the byte code interpreter 326 in the process of S100
, One of them is decoded. Here, the bytecode to be executed first (or the first bytecode of the method) is deterministically decoded. In the "decoding of bytecode" in the present invention, the address of a processing routine for processing the bytecode is obtained.

【0044】ステップ104(S104)において、バ
イトコードインタプリタ326は、最初に実行するバイ
トコードの処理ルーチンへのジャンプアドレスを設定す
る。PowerPC604で間接ジャンプを行うには、
飛び先アドレスを、飛び先アドレス格納用の特定用途レ
ジスタに格納した後、間接ジャンプ命令を実行する。こ
こでは、特定用途レジスタに、飛び先アドレスを格納し
ている。
In step 104 (S104), the bytecode interpreter 326 sets a jump address to the processing routine of the bytecode to be executed first. To perform an indirect jump with PowerPC604,
After the jump address is stored in the special-purpose register for storing the jump address, an indirect jump instruction is executed. Here, the jump destination address is stored in the special purpose register.

【0045】ステップ106(S106)において、バ
イトコードインタプリタ326は、バイト単位のアドレ
スPC+1(最初に実行するバイトコードのアドレスP
Cの次のアドレス)の1バイトが、オペコードであると
仮定してデコードし、デコード結果を、ハードウェア3
00のCPU内に選択されたアドレスプールレジスタ#
(PC+1 MOD 4)に格納する。
In step 106 (S106), the bytecode interpreter 326 outputs the address PC + 1 in byte units (the address P of the bytecode to be executed first).
One byte at the address following C) is decoded assuming that it is an operation code, and
Address pool register # selected in CPU 00
(PC + 1 MOD 4).

【0046】ステップ108(S108)において、バ
イトコードインタプリタ326は、アドレスPC+2
(最初に実行するバイトコードのアドレスPCの次のア
ドレス)の1バイトが、オペコードであると仮定してデ
コードし、デコード結果を、ハードウェア300のCP
U内に選択されたアドレスプールレジスタ#(PC+2
MOD 4)に格納する。
In step 108 (S108), the bytecode interpreter 326 sets the address PC + 2
One byte of (the address next to the address PC of the bytecode to be executed first) is decoded assuming that it is an operation code.
Address pool register # (PC + 2) selected in U
MOD 4).

【0047】ステップ110(S110)において、バ
イトコードインタプリタ326は、アドレスPC+3
(最初に実行するバイトコードのアドレスPCの次のア
ドレス)の1バイトが、オペコードであると仮定してデ
コードし、デコード結果を、ハードウェア300のCP
U内に選択されたアドレスプールレジスタ#(PC+3
MOD 4)に格納する。
In step 110 (S110), the bytecode interpreter 326 sets the address PC + 3
One byte of (the address next to the address PC of the bytecode to be executed first) is decoded assuming that it is an operation code.
Address pool register # (PC + 3) selected in U
MOD 4).

【0048】ステップ112(S112)において、バ
イトコードインタプリタ326は、最初のバイトコード
処理ルーチンにジャンプし、S14(図2,4)に進
む。つまり、S110までの処理において、上記A0の
仮定を満たすことができたので、ここでA0へジャンプ
し、バイトコードの実行を開始する。
In step 112 (S112), the bytecode interpreter 326 jumps to the first bytecode processing routine, and proceeds to S14 (FIGS. 2 and 4). That is, in the processing up to S110, the above assumption of A0 has been satisfied, so that the processing jumps to A0 and starts execution of bytecode.

【0049】図2,4に示すように、ステップ14(S
14)の投機的デコードの確認処理のステップ140
(S140)において、バイトコードインタプリタ32
6は、その時点で実行されているバイトコードの命令長
が4バイト以上であるか否かを判断し、4バイト未満で
ある場合には処理を終了してS122(図2)の処理に
進み、これ以外の場合にはS142の処理に進む。
As shown in FIGS. 2 and 4, step 14 (S
Step 140 of the speculative decoding confirmation processing of 14)
In (S140), the bytecode interpreter 32
No. 6 determines whether the instruction length of the byte code being executed at that time is 4 bytes or more, and if it is less than 4 bytes, terminates the process and proceeds to the process of S122 (FIG. 2). Otherwise, the process proceeds to S142.

【0050】ステップ142(S142)において、バ
イトコードインタプリタ326は、次のバイトコードを
デコードし、S120(図2)の処理に進む。つまり、
投機的デコードが間違っていた場合に、次のバイトコー
ド(b)が確定的にデコードされ、Bのアドレスが求め
られる。
In step 142 (S142), the bytecode interpreter 326 decodes the next bytecode, and proceeds to the process of S120 (FIG. 2). That is,
If the speculative decoding is wrong, the next byte code (b) is deterministically decoded, and the address of B is obtained.

【0051】また図2を参照する。ステップ120(S
120)において、バイトコードインタプリタ326
は、次のバイトコード処理ルーチンのアドレスを設定す
る。つまり、S104においてと同様に、特定用途レジ
スタに、飛び先アドレスが格納される。
Referring also to FIG. Step 120 (S
120), the bytecode interpreter 326
Sets the address of the next bytecode processing routine. That is, the jump destination address is stored in the special purpose register as in S104.

【0052】ステップ16(S16)のバイトコード読
み込み処理のステップ160(S160)において、図
5に示すように、バイトコードインタプリタ326は、
その時点で実行されているバイトコードが、バッファレ
ジスタにロードされている1ワード分を使い切ったか否
かを判断し、使い切った場合にはS162の処理に進
み、これ以外の場合には、S122(図2)の処理に進
む。
In step 160 (S160) of the bytecode reading process in step 16 (S16), the bytecode interpreter 326, as shown in FIG.
It is determined whether the bytecode being executed at that time has used up one word loaded in the buffer register, and if it has been used up, the process proceeds to S162; otherwise, the process proceeds to S122 ( Proceed to the process of FIG. 2).

【0053】ステップ162(S162)において、バ
イトコードインタプリタ326は、次の1ワードを、バ
ッファレジスタに読み込み、S122(図2)の処理に
進む。
In step 162 (S162), the bytecode interpreter 326 reads the next one word into the buffer register, and proceeds to the process of S122 (FIG. 2).

【0054】また図2を参照する。ステップ122(S
122)において、バイトコードインタプリタ326
は、バイトコードの仕様に応じた処理を行い、また、バ
イトコード実行位置を示すプログラムカウンタを、次の
バイトコードのアドレスに設定する。
Referring again to FIG. Step 122 (S
122), the bytecode interpreter 326
Performs a process according to the specification of the bytecode, and sets a program counter indicating the bytecode execution position to the address of the next bytecode.

【0055】ステップ18(S18)の投機的デコード
処理のステップ180(S180)において、図6に示
すように、バイトコードインタプリタ326は、その時
点で実行されているバイトコードの命令調が3バイト以
上であるか否かを判断し、3バイト以上である場合には
S182の処理に進み、これ以外の場合にはS184の
処理に進む。なお、S18の処理は、実際には、S12
4の処理とS126の処理との間で行うのがもっとも効
率的である。このようにすると、分岐のときに無駄な投
機的デコードをしなくても済む。
In step 180 (S180) of the speculative decoding process in step 18 (S18), as shown in FIG. 6, the bytecode interpreter 326 determines that the instruction tone of the bytecode being executed at that time is 3 bytes or more. Is determined, and if it is 3 bytes or more, the process proceeds to S182; otherwise, the process proceeds to S184. Note that the processing in S18 is actually performed in S12
4 is most efficiently performed between the processing of S126. This eliminates the need for unnecessary speculative decoding at the time of branching.

【0056】ステップ182(S182)において、バ
イトコードインタプリタ362は、次のバイトコードの
アドレスnPCの次のアドレスnPC+1の1バイトが
オペコードであると仮定してデコードし、デコード結果
を、ハードウェア300内のレジスタから選択されたア
ドレスプールレジスタ#(nPC+1 MOD 4)に
格納する。
In step 182 (S 182), the bytecode interpreter 362 decodes one byte of the address nPC + 1 next to the address nPC of the next bytecode assuming that the byte is an operation code. Is stored in the address pool register # (nPC + 1 MOD 4) selected from the register No.

【0057】ステップ184(S184)において、バ
イトコードインタプリタ362は、その時点で実行され
ているバイトコードの命令長が2バイト以上か否かを判
断し、2バイト以上の場合にはS186の処理に進み、
これ以外の場合にはS188の処理に進む。
In step 184 (S184), the bytecode interpreter 362 determines whether or not the instruction length of the bytecode being executed at that time is 2 bytes or more. Proceed,
Otherwise, the process proceeds to S188.

【0058】ステップ186(S186)において、バ
イトコードインタプリタ326は、アドレスnPC+2
の1バイトをデコードし、デコード結果をアドレスプー
ルレジスタ#(nPC+2 MOD 4)に格納する。
In step 186 (S186), the bytecode interpreter 326 sets the address nPC + 2
Is decoded, and the decoding result is stored in the address pool register # (nPC + 2 MOD 4).

【0059】ステップ188(S188)において、バ
イトコードインタプリタ326は、アドレスnPC+2
の1バイトをデコードし、デコード結果をアドレスプー
ルレジスタ#(nPC+1 MOD 4)に格納し、S
124(図2)の処理に進む。
In step 188 (S188), the bytecode interpreter 326 sets the address nPC + 2
, And stores the decoding result in the address pool register # (nPC + 1 MOD 4).
The process proceeds to the process 124 (FIG. 2).

【0060】また図2を参照する。ステップ124(S
124)において、バイトコードインタプリタ326
は、その時点で実行しているバイトコードが、分岐しな
い命令であるか、あるいは、メソッド内への分岐命令で
あるか、メソッド呼び出し命令であるかを判断し、これ
らのいずれであるかに応じて、S126、S128ある
いはS20の処理に進む。
Referring again to FIG. Step 124 (S
124), the bytecode interpreter 326
Determines whether the bytecode being executed at that time is a non-branch instruction, a branch instruction into a method, or a method call instruction. Then, the process proceeds to S126, S128 or S20.

【0061】ステップ126(S126)において、バ
イトコードインタプリタ326は、バイトコード実行位
置を示すバイトコードインタープリタのプログラムカウ
ンタを、実行中のバイトコード次のアドレスに設定し、
次のバイトコード処理ルーチンに間接ジャンプし、S1
4の処理に戻る。
In step 126 (S126), the bytecode interpreter 326 sets the program counter of the bytecode interpreter indicating the bytecode execution position to the next address of the bytecode being executed,
Indirect jump to the next bytecode processing routine, and S1
The process returns to step 4.

【0062】ステップ128(S128)において、バ
イトコードインタプリタ326は、バイトコード実行位
置を示すプログラムカウンタを、分岐先に設定し、分岐
先の命令を実行し、S10の処理に戻る。
In step 128 (S128), the bytecode interpreter 326 sets the program counter indicating the bytecode execution position to the branch destination, executes the instruction at the branch destination, and returns to the processing of S10.

【0063】ステップ20(S20)のメソッド呼び出
し処理のS200において、図7に示すように、バイト
コードインタプリタ326は、インタプリタに実行再開
に必要なデータ(実行中のバイトコードのアドレス、ス
タックポインタ、スタックフレームのベースアドレス
等)を保持する。
In S200 of the method calling process in step 20 (S20), as shown in FIG. 7, the bytecode interpreter 326 sends the data (the address of the bytecode being executed, the stack pointer, and the stack pointer) necessary for the interpreter to resume the execution. Frame base address).

【0064】ステップ22(S22)のメソッド実行処
理のS220において、図8に示すように、バイトコー
ドインタプリタ326は、その時点で実行しているバイ
トコードが分岐命令であるか否かを判断し、分岐命令で
ない場合には、分岐命令でないとして処理を終了してS
202(図7)の処理に進み(S222)、これ以外の
場合にはS224の処理に進む。なお、この判断は、す
べての処理ルーチンで行うが、S226以外の判断は、
処理ルーチン作成時にできるので、実行時に判断するオ
ーバーヘッドは生じない。S226の判断も、処理ルー
チン本来の処理の一部なので、追加の判断を行っている
わけではない。
At step S220 of the method execution process of step 22 (S22), as shown in FIG. 8, the bytecode interpreter 326 determines whether or not the bytecode being executed at that time is a branch instruction. If the instruction is not a branch instruction, it is determined that the instruction is not a branch instruction, and the processing is terminated.
The process proceeds to the process of 202 (FIG. 7) (S222), and otherwise proceeds to the process of S224. This determination is made in all the processing routines.
Since it can be performed at the time of creating the processing routine, there is no overhead for determining at the time of execution. Since the determination in S226 is also a part of the original processing of the processing routine, no additional determination is made.

【0065】ステップ224(S224)において、バ
イトコードインタプリタ326は、その時点で実行して
いるバイトコードが、条件分岐命令であるか否かを判断
し、条件分岐命令である場合にはS226の処理に進
み、これ以外の場合にはS230の処理に進む。
In step 224 (S224), the bytecode interpreter 326 determines whether or not the bytecode being executed at that time is a conditional branch instruction. If the bytecode is a conditional branch instruction, the process of S226 is performed. Otherwise, the process proceeds to S230.

【0066】ステップ226(S226)において、バ
イトコードインタプリタ326は、S224において判
断された条件分岐命令の分岐条件が満たされているか否
かを判断し、満たされている場合にはS222の処理に
進み、これ以外の場合には、結果がメソッド内への分岐
であると判断して処理を終了し、S202(図7)の処
理に進む(S228)。
In step 226 (S226), the bytecode interpreter 326 determines whether or not the branch condition of the conditional branch instruction determined in S224 is satisfied. If so, the process proceeds to S222. Otherwise, it is determined that the result is a branch into the method, the processing is terminated, and the flow proceeds to the processing of S202 (FIG. 7) (S228).

【0067】ステップ230(S230)において、バ
イトコードインタプリタ326は、S224の処理にお
いて判断されたその時点で実行しているバイトコード
が、メソッド内への無条件分岐命令であるか否かを判断
し、無条件分岐命令である場合にはS228の処理に進
み、これ以外の場合にはS232の処理に進む。
In step 230 (S230), the bytecode interpreter 326 determines whether or not the bytecode being executed at that time determined in the process of S224 is an unconditional branch instruction into the method. If the instruction is an unconditional branch instruction, the process proceeds to S228; otherwise, the process proceeds to S232.

【0068】ステップ232(S232)において、バ
イトコードインタプリタ326は、S230の処理にお
いて判断されたその時点で実行しているバイトコード
が、call命令であるか否かを判断し、call命令
である場合には、結果がメソッド呼び出し命令であると
判断し、処理を収容してS202(図7)の処理に戻り
(S234)、これ以外の場合には、結果がリターン命
令であると判断し、処理を終了してS202(図7)の
処理に戻る(S236)。
In step 232 (S232), the bytecode interpreter 326 determines whether or not the bytecode being executed at that time determined in the process of S230 is a call instruction. , It is determined that the result is a method call instruction, the process is accommodated, and the process returns to S202 (FIG. 7) (S234). Otherwise, the result is determined to be a return instruction, and And returns to the process of S202 (FIG. 7) (S236).

【0069】ステップ202(S202)において、バ
イトコードインタプリタ326は、S200の処理にお
いて保存したデータをCPUのレジスタあるいはバイト
コードインタープリタ326が、その実行に必要なデー
タを格納するために確保した、メモリの領域にロード
し、インタプリタの実行を再開し、S10(図2)の処
理に戻る。
In step 202 (S202), the bytecode interpreter 326 stores the data saved in the process of S200 in the memory of the memory secured by the register of the CPU or the bytecode interpreter 326 for storing data necessary for the execution. The program is loaded into the area, the execution of the interpreter is resumed, and the process returns to S10 (FIG. 2).

【0070】[効果]以下、本発明をPowerPC6
04プロセッサ用Javaバイトコードインタプリタに
適用した場合を具体例として、本発明にかかるインタプ
リタの効果を示す。Javaのバイトコードは、ほぼ全
ての命令のオペランドは4バイト以下なので、バッファ
レジスタを2個用意すれば、ほぼすべてのバイトコード
のオペランドをレジスタに格納しておくことができ、各
バイトコード処理ルーチンの先頭ですぐにオペランド生
成を始められる。つまり、従来、オペコードとオペラン
ドを同時にロードする最適化をした場合と同じ効果が得
られ、しかも、ロードの回数を減らせるので、本発明は
この点で優れている。
[Effects] Hereinafter, the present invention is described by using PowerPC6
The effect of the interpreter according to the present invention will be described with a specific example in which the present invention is applied to a Java bytecode interpreter for the 04 processor. In the Java bytecode, almost all instruction operands are 4 bytes or less, so if two buffer registers are prepared, almost all bytecode operands can be stored in the registers. You can start generating operands immediately at the beginning. In other words, the same effects as those obtained by the conventional optimization in which the opcode and the operand are simultaneously loaded can be obtained, and the number of times of loading can be reduced. Therefore, the present invention is excellent in this respect.

【0071】また、Javaのバイトコードの命令長
は、実行頻度の高い方から1バイト、2バイト、3バイ
トの順になっている。PowerPC604プロセッサ
は、3個のオペコードの候補をパイプラインの空きを利
用してデコードでき、また、Javaバイトコードの場
合、実行頻度で90%以上のバイトコードが3バイト以
内なので、3個の投機的デコードできれば、90%以上
の確率で、投機的デコードの効果が得られることが分か
る。
The instruction length of the Java bytecode is 1 byte, 2 bytes, and 3 bytes in descending order of execution frequency. The PowerPC 604 processor can decode three opcode candidates using the available space in the pipeline. In the case of Java bytecode, 90% or more of the bytecodes are 90% or more in execution frequency, and three speculative. It can be seen that if decoding is possible, the effect of speculative decoding can be obtained with a probability of 90% or more.

【0072】投機的デコードの効果を検証するために、
まず、PowerPC604におけるバイトコード処理
ルーチンの最小実行マシンサイクル数について考える。
インタプリタでは、処理ルーチンの最後で行う間接ジャ
ンプによるパイプラインのストールサイクル数と、間接
ジャンプの飛び先を決定するためのデコードのサイクル
数から、その処理ルーチンの最小実行サイクル数が決ま
り、どんなに処理 の簡単な処理ルーチンでも、実行サ
イクル数をこれより少なくすることはできない。
In order to verify the effect of speculative decoding,
First, the minimum execution machine cycle number of the bytecode processing routine in the PowerPC 604 will be considered.
In the interpreter, the minimum number of execution cycles of the processing routine is determined from the number of pipeline stall cycles by the indirect jump performed at the end of the processing routine and the number of decoding cycles for determining the jump destination of the indirect jump. Even with a simple processing routine, the number of execution cycles cannot be reduced below this.

【0073】Javaバイトコードでは、実行頻度の高
いバイトコードの多くは処理の簡単なものなので、最小
実行サイクル数を減らすことにより、実行速度の高速化
が期待できる。つまり、従来のインタプリタを用いた場
合、最小実行サイクルは5サイクルであるのに対し、本
発明をJavaバイトコードインタプリタに適用した場
合、最小実行サイクル数を4サイクルに減らすことがで
きる。ここに示した1サイクルの差は、投機的デコード
によりデコードオーバーヘッドが隠蔽された結果であ
る。つまり、投機的デコードにより、バイトコードに含
まれる簡単な処理ルーチンは、最大20%高速化され
る。
In the Java bytecode, since most of the frequently executed bytecodes are simple to process, an increase in the execution speed can be expected by reducing the minimum number of execution cycles. That is, when the conventional interpreter is used, the minimum execution cycle is 5 cycles, whereas when the present invention is applied to the Java bytecode interpreter, the minimum execution cycle number can be reduced to 4 cycles. The difference of one cycle shown here is a result of concealing the decoding overhead by speculative decoding. That is, the speculative decoding speeds up a simple processing routine included in the bytecode by up to 20%.

【0074】次に、CPUのロードストアパイプライン
の負荷について考える。実行頻度の高いバイトコードの
処理ルーチンについて、処理ルーチンあたりのロード・
ストア命令の平均実行サイクル数は、従来のインタプリ
タを用いた場合には、3.82サイクルであるのに対
し、本発明にかかるインタプリタを用いた場合には、
2.43サイクルと大幅に減少する。
Next, consider the load of the load store pipeline of the CPU. For the processing routine of the frequently executed bytecode, load /
The average number of execution cycles of a store instruction is 3.82 when a conventional interpreter is used, whereas when the interpreter according to the present invention is used,
It is greatly reduced to 2.43 cycles.

【0075】なお、この平均実行サイクル数は、eSu
it(ロータス社の100%ピュアJavaの統合オフ
ィスアプリケーションで、デスクトップ環境、表計算、
ワープロ、予定表などを備えている)の実行プロファイ
ルから求めた実行頻度の高いバイトコードについて、必
要なロード・ストア命令数と、ワード境界にアラインさ
れないメモリアクセスによる平均ストールサイクルの和
に、バイトコードごとの出現確率をかけたものを積算し
て求められ、PowerPC604のロード・ストアユ
ニットの使用率が100%の場合に、各処理ルーチンで
メモリアクセスに必要なサイクル数の平均を表す。
The average number of execution cycles is eSu
it (Lotus 100% pure Java integrated office application, desktop environment, spreadsheet,
(Including word processors, schedules, etc.), the bytecode is calculated by adding the required number of load / store instructions and the average stall cycle due to memory access that is not aligned on a word boundary. The average is the number of cycles required for memory access in each processing routine when the usage rate of the load / store unit of the PowerPC 604 is 100%.

【0076】実際のプログラムでは、アウトオブオーダ
ー実行(CPUが命令を実行する際に、実行時に命令間
の依存関係を解析し、可能ならば、CPU内の実行ユニ
ットで命令を実行する順序を、プログラム中の機械語命
令の順番とは変えて実行することで、パイプラインのス
トールを防ぎ、実行速度を向上するCPUの設計手法の
一つ)を行っても、一般に、CPUのロード・ストア
ユニットの使用率が100%になることはない。したが
って、従来のインタプリタによると、実際の処理ルーチ
ンあたりのロード・ストア命令の平均実行サイクル数は
4サイクルを越えると考えられ、投機的デコードによる
最適化を行って最小実行サイクル数が4サイクルになっ
ても、ロード・ストアユニットがボトルネックとなり投
機的デコードで期待できる効果はほとんど得られない。
In an actual program, out-of-order execution (when the CPU executes an instruction, the dependence between instructions is analyzed at the time of execution, and if possible, the order in which the instruction is executed by the execution unit in the CPU is determined. Even if the execution of the machine language instructions in the program is executed in a different order to prevent the stall of the pipeline and improve the execution speed), in general, the load / store of the CPU is generally performed.
Unit utilization never reaches 100%. Therefore, according to the conventional interpreter, the average number of execution cycles of the load / store instruction per actual processing routine is considered to exceed 4 cycles, and the minimum execution cycle number becomes 4 cycles by performing optimization by speculative decoding. However, the load / store unit becomes a bottleneck, and the effect expected by speculative decoding is hardly obtained.

【0077】一方、本発明にかかるインタプリタを用い
た場合には、投機的デコードを行った場合の最小実行サ
イクルである4サイクルまで、1.577サイクル(=
4−2.43)分の余裕があるので、PowerPC6
04のロード・ストアユニットがボトルネックとなるこ
とはない。したがって、本発明にかかるインタプリタを
用いて、デコードオーバーヘッドの隠蔽と、ロード・ス
トアユニットの平均使用率の改善を同時に行うことによ
り、Javaバイトコードの実行速度を向上することが
できる。さらに具体的には、CaffeineMark
3.0ベンチマークのグラフィックを使わないベンチマ
ークにより、本発明を適用したAIX用Javaバイト
コードインタプリタは、本発明を適用しない従来のJa
vaバイトコードインタプリタよりも、平均40%、J
avaバイトコードを高速に実行することが確認され
た。
On the other hand, when the interpreter according to the present invention is used, 1.577 cycles (= 4 cycles), which is the minimum execution cycle when speculative decoding is performed, are performed.
4-2.43) Since there is a margin for PowerPC6,
The load / store unit 04 does not become a bottleneck. Therefore, the execution speed of Java bytecode can be improved by simultaneously concealing the decoding overhead and improving the average usage rate of the load / store unit by using the interpreter according to the present invention. More specifically, CafeMark
According to the benchmark that does not use the 3.0 benchmark graphic, the AIX Java bytecode interpreter to which the present invention is applied is a conventional Java bytecode interpreter to which the present invention is not applied.
40% on average than J byte code interpreter, J
It was confirmed that ava bytecode was executed at high speed.

【0078】[0078]

【発明の効果】以上述べたように、本発明に係るバイト
コード実行装置およびその方法によれば、インタープリ
タの実行速度を制限する要因を解決し、バイトコードを
高速に実行することができる。また、本発明に係るバイ
トコード実行装置およびその方法は、特に、仮想マシン
のバイトコードの高速実行に適している。
As described above, according to the bytecode execution device and method according to the present invention, it is possible to solve the factors limiting the execution speed of the interpreter and execute the bytecode at high speed. The bytecode execution device and method according to the present invention are particularly suitable for high-speed execution of bytecode of a virtual machine.

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

【図1】本発明にかかるバイトコード実行方法を応用し
たコンピュータネットワークの構成を示す図である。
FIG. 1 is a diagram showing a configuration of a computer network to which a bytecode execution method according to the present invention is applied.

【図2】図1に示したJava仮想マシンのバイトコー
ドインタプリタの全体処理(S1)を示すフローチャー
トである。
FIG. 2 is a flowchart illustrating an overall process (S1) of a bytecode interpreter of the Java virtual machine illustrated in FIG. 1;

【図3】図2に示したインタプリタ実行準備処理(S1
0)を示すフローチャートである。
FIG. 3 is a diagram illustrating an interpreter execution preparation process (S1) illustrated in FIG. 2;
It is a flowchart which shows 0).

【図4】図2に示した投機的デコードの確認処理(S1
4)を示すフローチャートである。
FIG. 4 is a flowchart showing a process of confirming speculative decoding shown in FIG. 2 (S1);
It is a flowchart which shows 4).

【図5】図2に示したバイトコードの読み込み処理(S
16)を示すフローチャートである。
FIG. 5 is a flowchart of processing for reading the bytecode shown in FIG. 2 (S
It is a flowchart which shows 16).

【図6】図2に示した投機的デコード処理(S18)を
示すフローチャートである。
FIG. 6 is a flowchart showing a speculative decoding process (S18) shown in FIG. 2;

【図7】図2に示したメソッド呼び出し処理(S20)
を示すフローチャートである。
FIG. 7 is a method call process (S20) shown in FIG. 2;
It is a flowchart which shows.

【図8】図7に示したメソッドの実行処理(S22)を
示すフローチャートである。
FIG. 8 is a flowchart showing an execution process (S22) of the method shown in FIG. 7;

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

1・・・コンピュータネットワーク 10・・・サーバコンピュータ 106・・・記憶装置 102・・・Javaコンパイラ 20・・・通信網 30・・・クライアントコンピュータ 300・・・ハードウェア 302・・・OS 32・・・Java仮想マシン 322・・・JITコンパイラ 324・・・バイトコードインタプリタ 320・・・Java仮想マシンランタイム関数 34・・・記憶装置 DESCRIPTION OF SYMBOLS 1 ... Computer network 10 ... Server computer 106 ... Storage device 102 ... Java compiler 20 ... Communication network 30 ... Client computer 300 ... Hardware 302 ... OS 32 ...・ Java virtual machine 322 ・ ・ ・ JIT compiler 324 ・ ・ ・ Bytecode interpreter 320 ・ ・ ・ Java virtual machine runtime function 34 ・ ・ ・ Storage device

───────────────────────────────────────────────────── フロントページの続き (72)発明者 緒方 一則 神奈川県大和市下鶴間1623番地14 日本ア イ・ビー・エム株式会社 東京基礎研究所 内 (72)発明者 小松 秀昭 神奈川県大和市下鶴間1623番地14 日本ア イ・ビー・エム株式会社 東京基礎研究所 内 Fターム(参考) 5B081 DD01  ──────────────────────────────────────────────────の Continued on the front page (72) Inventor Kazunori Ogata 1623-14 Shimotsuruma, Yamato-shi, Kanagawa Japan Inside the Tokyo Research Laboratory, IBM Japan, Ltd. (72) Inventor Hideaki Komatsu Shimotsuruma, Yamato-shi, Kanagawa 1623 No.14 F-term (reference) 5B081 DD01 in the Tokyo Research Laboratory, IBM Japan, Ltd.

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】バイト単位で命令長が変化しうる複数の種
類の命令を、それぞれ複数のバイトを含むワードを処理
単位とするCPUで順次、実行するバイトコード実行装
置であって、 前記バイトコードを前記ワード単位で読み出し、任意の
時点で実行されている前記命令の2つ以上後のバイト
を、前記命令のオペコードとして先行してデコードし、
先行デコード結果とする先行デコード手段と、 前記任意の時点で実行されている前記命令の種類に基づ
いて、前記任意の時点で実行されている前記命令の2つ
以上後のバイトが、前記命令のオペコードである場合に
は、次に、前記先行デコード結果を実行し、これ以外の
場合には、前記任意の時点で実行されている前記命令の
次のバイトをデコードして実行するバイトコード実行手
段とを有するバイトコード実行装置。
1. A byte code execution device for sequentially executing a plurality of types of instructions whose instruction lengths can be changed in byte units by a CPU using a word as a processing unit as a processing unit, wherein the byte code execution device includes: Is read in units of the word, and two or more bytes after the instruction executed at any time are decoded in advance as an operation code of the instruction,
A preceding decoding unit that is a result of the preceding decoding; and, based on a type of the instruction that is being executed at the arbitrary time, a byte that is at least two bytes after the instruction that is being executed at the arbitrary time is a byte of the instruction. If it is an operation code, then execute the preceding decoding result; otherwise, decode the byte next to the instruction being executed at the arbitrary time and execute it. And a bytecode execution device comprising:
【請求項2】バイト単位で命令長が変化しうる複数の種
類の命令を、それぞれ複数のバイトを含むワードを処理
単位とするCPUで順次、実行するバイトコード実行方
法であって、 前記バイトコードを前記ワード単位で読み出し、任意の
時点で実行されている前記命令の2つ以上後のバイト
を、前記命令のオペコードとして先行してデコードし、
先行デコード結果とし、 前記任意の時点で実行されている前記命令の種類に基づ
いて、前記任意の時点で実行されている前記命令の2つ
以上後のバイトが、前記命令のオペコードである場合に
は、次に、前記先行デコード結果を実行し、これ以外の
場合には、前記任意の時点で実行されている前記命令の
次のバイトをデコードして実行するバイトコード実行方
法。
2. A byte code execution method for sequentially executing a plurality of types of instructions whose instruction lengths can be changed in byte units by a CPU using a word as a processing unit as a processing unit. Is read in units of the word, and two or more bytes after the instruction executed at any time are decoded in advance as an operation code of the instruction,
As a result of the preceding decoding, based on the type of the instruction being executed at the arbitrary time, if two or more bytes subsequent to the instruction being executed at the arbitrary time are the operation code of the instruction, Then executes the preceding decode result, and otherwise, decodes and executes the next byte of the instruction being executed at the arbitrary point in time.
【請求項3】バイト単位で命令長が変化しうる複数の種
類の命令を、それぞれ複数のバイトを含むワードを処理
単位とするCPUで順次、実行するバイトコード実行を
行うプログラムであって、 前記バイトコードを前記ワード単位で読み出し、任意の
時点で実行されている前記命令の2つ以上後のバイト
を、前記命令のオペコードとして先行してデコードし、
先行デコード結果するステップと、 前記任意の時点で実行されている前記命令の種類に基づ
いて、前記任意の時点で実行されている前記命令の2つ
以上後のバイトが、前記命令のオペコードである場合に
は、次に、前記先行デコード結果を実行し、これ以外の
場合には、前記任意の時点で実行されている前記命令の
次のバイトをデコードして実行するステップとをコンピ
ュータに実行させるプログラムを媒介する媒体。
3. A program for executing bytecode execution in which a plurality of types of instructions whose instruction lengths can be changed in byte units are sequentially executed by a CPU in which a word including a plurality of bytes is used as a processing unit. Reading a bytecode in units of the word, and decoding two or more bytes after the instruction executed at any time in advance as an operation code of the instruction;
A step of performing a preceding decoding result; and, based on a type of the instruction being executed at the arbitrary time, a byte two or more bytes later than the instruction being executed at the arbitrary time is an operation code of the instruction. If so, then executing said preceding decode result; otherwise, decoding and executing the next byte of said instruction being executed at said arbitrary point in time. A medium for mediating programs.
JP24317699A 1999-08-30 1999-08-30 Bytecode execution device and method Expired - Fee Related JP3524024B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP24317699A JP3524024B2 (en) 1999-08-30 1999-08-30 Bytecode execution device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP24317699A JP3524024B2 (en) 1999-08-30 1999-08-30 Bytecode execution device and method

Publications (2)

Publication Number Publication Date
JP2001084146A true JP2001084146A (en) 2001-03-30
JP3524024B2 JP3524024B2 (en) 2004-04-26

Family

ID=17099956

Family Applications (1)

Application Number Title Priority Date Filing Date
JP24317699A Expired - Fee Related JP3524024B2 (en) 1999-08-30 1999-08-30 Bytecode execution device and method

Country Status (1)

Country Link
JP (1) JP3524024B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100818919B1 (en) * 2006-02-24 2008-04-03 삼성전자주식회사 Method for invoking method and java virtual machine using the same
US7996826B2 (en) 2004-09-25 2011-08-09 Samsung Electronics Co., Ltd. Method of executing virtual machine application program and digital broadcast receiver using the same

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7996826B2 (en) 2004-09-25 2011-08-09 Samsung Electronics Co., Ltd. Method of executing virtual machine application program and digital broadcast receiver using the same
KR100818919B1 (en) * 2006-02-24 2008-04-03 삼성전자주식회사 Method for invoking method and java virtual machine using the same

Also Published As

Publication number Publication date
JP3524024B2 (en) 2004-04-26

Similar Documents

Publication Publication Date Title
US6324686B1 (en) Just in time compiler technique
JP3499252B2 (en) Compiling device and data processing device
US9311095B2 (en) Using register last use information to perform decode time computer instruction optimization
US5448746A (en) System for comounding instructions in a byte stream prior to fetching and identifying the instructions for execution
JP3797471B2 (en) Method and apparatus for identifying divisible packets in a multi-threaded VLIW processor
US5560029A (en) Data processing system with synchronization coprocessor for multiple threads
US8200987B2 (en) Dynamic object-level code translation for improved performance of a computer processor
US5303356A (en) System for issuing instructions for parallel execution subsequent to branch into a group of member instructions with compoundability in dictation tag
US7458069B2 (en) System and method for fusing instructions
US8893079B2 (en) Methods for generating code for an architecture encoding an extended register specification
US5721854A (en) Method and apparatus for dynamic conversion of computer instructions
US5504932A (en) System for executing scalar instructions in parallel based on control bits appended by compounding decoder
US5701442A (en) Method of modifying an instruction set architecture of a computer processor to maintain backward compatibility
US7730463B2 (en) Efficient generation of SIMD code in presence of multi-threading and other false sharing conditions and in machines having memory protection support
US9697002B2 (en) Computer instructions for activating and deactivating operands
JP4841861B2 (en) Arithmetic processing device and execution method of data transfer processing
US9477474B2 (en) Optimization of instruction groups across group boundaries
WO2002008893A1 (en) A microprocessor having an instruction format containing explicit timing information
US20150227373A1 (en) Stop bits and predication for enhanced instruction stream control
US7523295B2 (en) Processor and method of grouping and executing dependent instructions in a packet
US8095775B1 (en) Instruction pointers in very long instruction words
US6467037B1 (en) Utilizing a program counter with one or more data counters for executing instructions
US7937564B1 (en) Emit vector optimization of a trace
JP3524024B2 (en) Bytecode execution device and method
EP0924603A2 (en) Compiler controlled dynamic scheduling of program instructions

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: 20040203

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040210

LAPS Cancellation because of no payment of annual fees