JP3889227B2 - Program execution device, program execution method, recording medium, and control program - Google Patents

Program execution device, program execution method, recording medium, and control program Download PDF

Info

Publication number
JP3889227B2
JP3889227B2 JP2001010875A JP2001010875A JP3889227B2 JP 3889227 B2 JP3889227 B2 JP 3889227B2 JP 2001010875 A JP2001010875 A JP 2001010875A JP 2001010875 A JP2001010875 A JP 2001010875A JP 3889227 B2 JP3889227 B2 JP 3889227B2
Authority
JP
Japan
Prior art keywords
program
machine language
execution
translation
stored
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.)
Expired - Fee Related
Application number
JP2001010875A
Other languages
Japanese (ja)
Other versions
JP2001273151A (en
Inventor
晃 坪井
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2001010875A priority Critical patent/JP3889227B2/en
Publication of JP2001273151A publication Critical patent/JP2001273151A/en
Application granted granted Critical
Publication of JP3889227B2 publication Critical patent/JP3889227B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、高水準のプログラミング言語で記述されているプログラムを演算処理システムで実行させる技術に関し、特に、ジャスト・イン・タイム・コンパイラ方式により、原始プログラムを特定の演算処理システムのプラットホームで直接実行可能な機械語に翻訳して該機械語を実行させる技術に関する。
【0002】
【従来の技術】
異なる演算処理システムのプラットホーム上で同一のプログラムを動作させようとする多くの試みが以前から行なわれている。プログラミング言語Java(Javaは、サン・マイクロシステムズ・インコーポレイテッドの登録商標)はその回答のひとつである。Javaはプラットホーム独立を実現し、異種のプラットホーム間での可搬性に優れている。
【0003】
Javaで記述されたプログラムのソースコードは、構文解析などの処理が施され、バイトコードと呼ばれるバイナリファイルに変換されて配布されるのが一般的である。Javaバイトコードは演算処理システムのプラットホームに独立である汎用的な命令コードであり、Java VM(バーチャル・マシン)と呼ばれるJavaの実行系で解釈され実行されるコードである。Java VMに相当する環境を各々の演算処理システムが備えることによって、異なる演算処理システム上で同一のJavaバイトコードの実行が可能となる。
【0004】
以下、Javaバイトコードを演算処理システム上で実行させる技術について説明する。
Javaインタプリタは、Javaバイトコードを命令毎に逐次解釈(インタプリト)し、演算処理システムにその命令に対応する処理を行なわせるものである。Javaインタプリタは、Javaバイトコードで記述されたプログラムをそのまま解釈して処理できることが大きな利点ではあるが、命令解釈のための時間を要するために処理速度が遅いという短所がある。
【0005】
Javaバイトコードで記述されたプログラムの実行速度を向上させる手法として、処理させる演算処理システムで直接実行可能な機械語であるネイティブコードにJavaバイトコードを予め翻訳(コンパイル)しておく手法があり、このためのツールをネイティブ・コンパイラという。Javaバイトコードのネイティブコード化によりプログラムの実行速度は格段に向上するが、Javaの大きな利点である異種のプラットホーム間での可搬性が損なわれるという問題があり、更に、プログラムの変更によりJavaバイトコードが更新される度に、演算処理システムのオペレータがネイティブコードへの翻訳作業をシステムに行なわせるように指示しなければならない煩わしさもある。
【0006】
Javaの有する利点である異種のプラットホーム間での可搬性を維持しつつ、Javaインタプリタの抱える処理速度の問題を改善するためにジャスト・イン・タイム・コンパイラ(以下、「JITコンパイラ」という)が提案されている。
【0007】
JITコンパイラは、Javaバイトコードを実行する際に、そのバイトコードで用いられている関数 (Javaにおけるメソッド)を単位としてネイティブコードに翻訳しながら演算処理システムに逐次実行させる。ここで、翻訳されたネイティブコードをメインメモリに保持しておくようにする。Javaバイトコードの翻訳を進めていくうちに、既にネイティブコードに翻訳されている関数が出現したときは、その関数についての再度の翻訳は行なわずに、メインメモリに保持されているネイティブコードをそのまま演算処理システムに直接実行させるようにして翻訳処理に要する処理時間を削減する。一般的にプログラム全体の実行速度を低下させる大きな影響を与えている関数は繰り返し呼び出されていることが多々あるので、この手法を用いることによりJavaバイトコードの実行速度を向上させることができる。
【0008】
また、JITコンパイラは、インタプリタによる解釈処理では困難なJavaバイトコードで記述されている命令の最適化も行なうので、この最適化によっても処理速度が高速化される。しかも、ネイティブ・コンパイラでは必要となる、演算処理システムに対するオペレータによる煩雑な操作はJITコンパイラでは不要である。
【0009】
なお、JITコンパイラは、Javaバイトコードの実行に使用するものが特に広く普及しているが、他のプログラミング言語で記述されたプログラムや、プログラムに対して構文解析や最適化の処理が施されて得られる中間言語で記述されているプログラム(本明細書では、これらのプログラムを総称して「原始プログラム」と称することとする)を、特定のプラットホームが直接解釈できるネイティブコードに翻訳しながらそのプラットホーム上で実行させるように構成することも可能である。
【0010】
【発明が解決しようとする課題】
前述したように、JITコンパイラは、Javaの有する大きな利点である異種のプラットホーム間での可搬性を維持しつつ実行速度の問題を改善することが可能であり、更にオペレータによる操作作業の負担がネイティブ・コンパイラよりも少ない利点を有している。しかしながら、原始プログラムの実行開始時にネイティブコードへの翻訳処理が必ず行なわれるため、JITコンパイラを用いて行なう原始プログラムの実行では、その原始プログラムに記述されている処理が実際に開始されるまでにある程度のタイムラグが生じてしまう問題を有していた。
【0011】
以上の問題を鑑み、JITコンパイラを用いて原始プログラムを実行させるときの実行開始時の性能を向上させることが本発明が解決しようとする課題である。
【0012】
【課題を解決するための手段】
図1は本発明の基本構成図である。本発明に係る装置であるプログラム実行装置10は、機械語を実行する実行手段16を有し、ジャスト・イン・タイム・コンパイラ方式により、原始プログラム1を実行手段16で直接実行可能な機械語に翻訳して実行する装置を前提とする。
【0013】
本発明の第一の態様の装置では、プログラム実行装置10に、原始プログラム1に記述される関数の翻訳であって実行手段16で実行可能な機械語を該関数ごとに記憶する、電源電圧が消失しても記憶内容が保持される記憶手段11と、原始プログラム1を実行手段16で実行可能な機械語に翻訳する翻訳手段12と、翻訳手段12により翻訳された機械語を記憶手段11に記憶させる記憶制御手段13と、原始プログラム1で用いられている関数の翻訳である機械語が記憶手段11に記憶されているか否かの判定を行なう判定手段14と、判定手段14による判定結果に応じて、翻訳手段12の翻訳する機械語、または記憶手段11に記憶されている機械語、のどちらかを実行手段16に直接実行させる実行制御手段15とを有するように構成することによって前述した課題を解決する。
【0014】
この構成においては、記憶手段11としては、例えばハードディスク装置やフラッシュEEPROM(一括消去型電気的消去及び書き込み可能読み出し専用半導体メモリ)などを用いることができる。
【0015】
上記の構成では、記憶手段11が原始プログラム1に記述される関数の翻訳である機械語を記憶する。原始プログラム1で用いられている関数の翻訳である機械語が記憶手段11に記憶されていると判定手段14が判定すれば、実行制御手段15は翻訳手段12によるその関数の翻訳を待たずに、記憶手段11に記憶されているその関数の機械語を直接実行させるように実行手段16を制御するので、プログラム実行装置10は前述したJITコンパイラに相当する動作が行なわれる。従って、上記の構成によれば、JITコンパイラの有する前述した利点をそのまま有している。
【0016】
しかも、上記の構成における記憶手段11は、電源電圧が消失してもその記憶内容が保持される。従って、例えばオペレータが一日の仕事を終えてプログラム実行装置10の電源を切り、その翌日に仕事を再開するような場合、前日までに同一の原始プログラム1を一度でも実行していれば、記憶手段11に記憶されている、原始プログラム1に記述されている関数の翻訳である機械語をその日の最初の実行から利用することができるので、プログラム実行装置10はプログラムの翻訳処理に起因する実行開始時のタイムラグを生じさせずに原始プログラム1を実行させることができる。
【0017】
なお、上述した構成において、記憶手段11には、原始プログラム1で用いられることのあり得る関数の翻訳である機械語が予め記憶されているように構成しても良い。この構成では、プログラム実行装置10上での原始プログラム1の初めての実行の際に原始プログラム1に記述されている関数の翻訳である機械語が既に記憶されている場合があり、このような場合には原始プログラム1に記述されている関数の翻訳である機械語を記憶手段11から得ることができるので、プログラムの翻訳処理に起因する実行開始時のタイムラグを短縮することができる。
【0018】
また、上述した構成において、記憶手段11の記憶内容を複写して記憶する半導体メモリを更に有し、実行制御手段15は、記憶手段11に記憶されている機械語を実行手段16に実行させる代わりに、その半導体メモリに記憶されている、記憶手段11に記憶されている記憶内容の複写である機械語を実行手段16に実行させるように構成しても良い。例えば記憶手段11としてハードディスク装置を用いている場合などでは、ハードディスク装置から機械語を読み出すよりも、そのハードディスク装置と同一の記憶内容が複写されている半導体メモリから機械語を読み出す方が、機械語の検索・読み出しが高速に行なえるので、プログラム装置10による原始プログラム1の翻訳・実行の処理時間を更に短縮することができる。
【0019】
また、本発明の第二の態様の装置では、プログラム実行装置10に、原始プログラム1に記述される関数の翻訳であって実行手段16で実行可能な機械語を該関数ごとに記憶し、原始プログラム1の実行終了後も記憶内容を保持する記憶手段11と、原始プログラム1を実行手段16で実行可能な機械語に翻訳する翻訳手段12と、翻訳手段12により翻訳された機械語を、翻訳手段12により翻訳される原始プログラム1が更新された日時に対応付けて、記憶手段11に記憶させる記憶制御手段13と、原始プログラム1の更新された日時と、記憶手段11に記憶されている前記機械語に対応付けられている更新日時とが一致するか否かを判定する判定手段14と、判定手段14による判定結果に応じて、翻訳手段12の翻訳する機械語、または記憶手段11に記憶されている機械語、のどちらかを実行手段16に直接実行させる実行制御手段15とを有するように構成することによって前述した課題を解決する。
【0020】
上記の構成は、原始プログラム1が格納されているプログラムファイルを読み込む読込手段を更に有し、記憶制御手段13は、原始プログラム1が格納されているプログラムファイルに示されている該プログラムファイルの更新日時を前記機械語に対応付ける原始プログラム1の更新された日時とみなして、記憶手段11に該機械語を記憶させ、判定手段14は、そのプログラムファイルに示されている該プログラムファイルの更新日時と、前記機械語に対応させて記憶手段11に記憶されている更新日時とが一致するか否かを判定するように構成してもよい。
【0021】
上記の構成では、前述した本発明の第一の態様の装置と同様に、JITコンパイラの有する利点をそのまま有している。
更に、上記の構成では、原始プログラム1の実行終了後も記憶内容を保持しているので、同一の原始プログラム1を再度実行させる場合には、実行制御手段15は翻訳手段12による原始プログラム1の翻訳を待たずに、記憶手段11に記憶されているその関数の機械語を実行手段16に直接実行させることにより、プログラムの翻訳処理に起因する実行開始時のタイムラグを生じさせずに原始プログラム1を実行させることができる。ただし、この場合、後に実行される原始プログラム1と先に実行されたものとが、原始プログラムのバージョンアップによる修正等により、同一でないことがあり得る。そこで、記憶制御手段13が、翻訳手段12により翻訳された機械語と、翻訳手段12により翻訳される原始プログラム1が更新された日時とを対応付けて記憶手段11に記憶させ、判定手段14が、原始プログラム1の更新された日時と、機械語に対応付けて記憶手段11に記憶されている更新日時とが一致するか否かを判定する。そしてこの判定の結果、両者が一致しないのであれば、原始プログラム1で用いられている関数の翻訳である機械語が記憶手段11に記憶されていても、実行制御手段15は翻訳手段12により新たに翻訳された機械語を実行手段16に実行させる。こうすることによって、原始プログラム1に変更が加えられても、その変更に応じて正しく原始プログラム1を実行させることができる。
【0022】
なお、上記の構成においては、記憶手段11として、ハードディスク装置やフラッシュEEPROMなどの、電源電圧が消失しても記憶内容が保持されるものに限らず、他の読み書き可能な記憶媒体を使用することもできる。
【0023】
なお、上述した本発明の第一または第二の態様の装置において、原始プログラム1は、Javaのバイト・コードで記述されていてもよい。この場合、原始プログラム1に記述される関数とはJavaにおけるメソッドに相当する。
【0024】
また、本発明に係るプログラム実行方法は、ジャスト・イン・タイム・コンパイラ方式により、原始プログラムを特定の演算処理システムのプラットホームで直接実行可能な機械語に翻訳して該機械語を実行させる方法を前提とする。
【0025】
そして、本発明の第一の態様のプログラム実行方法では、前記原始プログラムの翻訳である前記機械語を、該原始プログラムに記述されている関数ごとに、電源電圧が消失しても記憶内容が保持される記憶部に記憶させ、前記原始プログラムに記述されている関数の翻訳である前記機械語が前記記憶部に記憶されているか否かの判定を行ない、前記判定結果に応じて、前記原始プログラムを翻訳して得る機械語、または前記記憶部に記憶されている機械語、のどちらかを特定の演算処理システムのプラットホームで直接実行させることによって前述した課題を解決する。そして、このプログラム実行方法によっても前述した本発明の第一の態様の装置と同様な作用・効果を奏する。
【0026】
また、本発明の第二の態様のプログラム実行方法では、前記原始プログラムの翻訳である前記機械語を、該原始プログラムに記述されている関数ごとに、該機械語の翻訳前の原始プログラムが更新された日時に対応付けて記憶し、前記原始プログラムの更新された日時と、記憶されている前記機械語に対応付けられている更新日時とが一致するか否かの判定を行ない、前記判定結果に応じて、前記原始プログラムを翻訳して得る機械語、または記憶されている機械語、のどちらかを特定の演算処理システムのプラットホームで直接実行させることによって前述した課題を解決する。そして、このプログラム実行方法によっても前述した本発明の第二の態様の装置と同様な作用・効果を奏する。
【0027】
なお、上述した本発明の各構成により行なわれる機能と同様の制御をコンピュータに行なわせる制御プログラムをコンピュータに実行させることによって、あるいは、その制御プログラムを記録したコンピュータ読み取り可能な記録媒体から、その制御プログラムをコンピュータに読み取らせて実行させることによっても、前述した課題を解決することができ、この構成によっても前述したプログラム実行装置と同様な作用・効果を奏する。
【0028】
【発明の実施の形態】
以下、本発明の実施の形態を図面に基づいて説明する。なお、ここでは、Javaのバイトコードを翻訳して実行するプログラム実行装置において本発明を実施する例について説明する。
【0029】
図2は本発明を実施するプログラム実行装置の全体構成を示す図である。同図に示すように、このプログラム実行装置(以下、「本装置」という)20は、入力部21、CPU22、出力部23、I/F部24、半導体メモリ25、ハードディスク装置26を有し、バス27を介して相互に接続されている。
【0030】
入力部21は、キーボード装置や、マウス等のポインティングデバイスなどを有し、本装置のオペレータからの各種指示の入力を取得する。また、フロッピーディスクや光磁気ディスク、磁気テープなどの記録媒体からデータを読み出すためのデータ読み出し装置を有するようにしてもよい。
【0031】
CPU22は半導体メモリ25に記憶された制御プログラムに従って本装置20全体の動作を制御する中央演算処理装置であり、機械語を直接実行する。
出力部23は、ディスプレイ装置やプリンタなどを有し、本装置20で行なった処理の結果等をオペレータに提示するものである。
【0032】
I/F部24は、本装置20を他の装置やネットワークに接続するためのインターフェースのための処理を司るものである。
半導体メモリ25は、本装置20全体の制御処理をCPU22に行なわせるための制御プログラムを予め記憶しておいたり、ハードディスク装置26の記憶内容を複写して記憶したり、あるいはCPU22により実行される処理のためのワークエリアとして用いられるものであり、ROM(リード・オンリ・メモリ)25−1及びRAM(ランダム・アクセス・メモリ)25−2を有している。
【0033】
ハードディスク装置26は、本装置20へ供給される電源電圧が消失しても記憶内容が保持されるデータ記憶装置である。
次に図3について説明する。図3は、本装置20における翻訳・実行処理の全体の流れを図で示したものである。
【0034】
プログラムソースモジュール41は、本装置20に翻訳・実行を行なわせるソフトウェアモジュールであり、本実施の形態ではJavaのバイトコードによって記述されている。プログラムソースモジュール41は、前述した記録媒体に格納されているプログラムファイルとして提供されたものを入力部21のデータ読み取り装置で読み取ることにより、あるいは、他の装置やネットワークからプログラムファイルとして送付されたものをI/F部24が受け取ることにより、本装置20に取り込まれる。
【0035】
本装置20に入力されたプログラムソースモジュール41は、JITコンパイラ30により翻訳・実行される。JITコンパイラ30は、CPU22が本装置20全体の制御プログラムを実行することにより実現される。
【0036】
JITコンパイラ30によって行なわれる処理の内容を機能別に分けると、プログラムロード部31、高速化判定部32、コンパイル(翻訳)部33、ファイルロード部34、プログラム実行部35の各機能ブロックに大別される。
【0037】
プログラムロード部31は、本装置20に取り込まれたプログラムファイルからプログラムソースモジュール41を取り出して、RAM25−2におけるCPU22がワークメモリとして使用している領域(ワークエリア)に格納する。
【0038】
高速化判定部32は、プログラムソースモジュール41の構文分析を行ない、そこに記述されているメソッドの定義の翻訳に相当するネイティブコード(コンパイル済み格納モジュール43)が、ハードディスク装置26に記憶されているか否かを、後述する管理簿42を参照することにより判定する。本実施の形態では、管理簿42はハードディスク装置26に記憶されている。
【0039】
コンパイル部33は、上述したメソッドの定義の翻訳に相当するコンパイル済み格納モジュール43がハードディスク装置26に記憶されていないと高速化判定部32が判定したときに、そのメソッドの定義の翻訳を行ない、その結果得られたCPU22で直接実行可能なネイティブコードを、RAM25−2における前述したワークエリアにコンパイル済み実行モジュール44として格納すると共に、コンパイル済み格納モジュール43としてハードディスク装置26に記憶させる。更に、管理簿42におけるその記憶させたコンパイル済み格納モジュール43についての管理情報を更新する。
【0040】
ファイルロード部34は、上述したメソッドの定義の翻訳に相当するコンパイル済み格納モジュール43がハードディスク装置26に記憶されていると高速化判定部32が判定したときに、そのコンパイル済み格納モジュール43をハードディスク装置26からロードし(読み出し)、RAM25−2のワークエリアにコンパイル済み実行モジュール44として格納する。
【0041】
プログラム実行部35は、コンパイル部33もしくはファイルロード部34によってRAM25−2のワークエリアに格納されたコンパイル済み実行モジュール44をCPU22で直接実行する。
【0042】
JITコンパイラ30は、これらの高速化判定部32、コンパイル(翻訳)部33、ファイルロード部34、プログラム実行部35の各機能ブロックで示される処理を繰り返し実行することによって、プログラムソースモジュール41を実行させる。
【0043】
次に管理簿42について説明する。図4は管理簿42の一例を表として示す図である。管理簿42は、ハードディスク装置26に記憶されているコンパイル済み格納モジュール43についての管理情報が記録されるものである。
【0044】
図4に示す表において、左側の欄には、ハードディスク装置26に記憶させたコンパイル済み格納モジュール43に対応する、そのコンパイル済み格納モジュール43が翻訳である翻訳前のメソッド定義のメソッド名が記録される。そして、同図に示す表の右側の欄には、左側の欄のメソッド名に対応するメソッド定義が記述されていたプログラムソースモジュール41の更新日時が記録される。この更新日時には、本実施の形態では、プログラムソースモジュール41が格納されていたプログラムファイルの管理情報として示されている更新日時を用いる。高速化判定部32では、プログラムロード部31がRAM25−2のワークエリアに格納したプログラムソースモジュール41を分析する。そして、そこに記述されているメソッド定義のメソッド名が管理簿42に記録されており、且つそのプログラムソースモジュール41の更新日時が管理簿42のそのメソッド名に対応する更新日時と一致するか否かを判定する。この判定結果が真であれば、そのメソッドの定義の翻訳に相当するコンパイル済み格納モジュール43がハードディスク装置26に記憶されていると判定する。
【0045】
次に図5について説明する。図5は、ROM25−1に格納されている、本装置20全体の制御プログラムをCPU22が実行することにより行なわれる制御処理のうち、本発明に関係する、プログラムソースモジュール41の翻訳・実行を行なう処理であるJITコンパイル処理の第一の例の処理内容をフローチャートで示した図である。以下、同図に沿ってCPU22が行なうJITコンパイル処理について説明する。
【0046】
まず、CPU22は本装置20に取り込まれたプログラムファイルからプログラムソースモジュール41を取り出し、RAM25−2のワークエリアに格納する(S101)。この処理は図3におけるプログラムロード部31の機能に相当する。
【0047】
続いて、CPU22は、RAM25−2のワークエリアに格納されているプログラムソースモジュール41の構文分析を行ない、そこに記述されているメソッドの定義をひとつ抽出する(S102)。ここで、CPU22は管理簿42を参照し(S103)、抽出されたメソッド定義のメソッド名が管理簿42の記録内容に含まれているか否かを判定する(S104)。この判定処理の結果がYesならばS105に進み、NoならばS107に進む。
【0048】
抽出されたメソッド定義のメソッド名が管理簿42の記録内容に含まれているのであれば、CPU22は、プログラムソースモジュール41が格納されていたプログラムファイルの管理情報を調べ、プログラムソースモジュール41の更新日時を取得する(S105)。そして、このプログラムソースモジュール41の更新日時と、抽出されたメソッド定義のメソッド名の記録に対応付けられて管理簿42に記録されている更新日時とが一致するか否かを判定する(S106)。この判定処理の結果がYesならばS111に進み、NoならばS107に進む。
【0049】
以上のS102からS106にかけて示されている処理は図3における高速化判定部32の機能に相当する。
前述したS104またはS106のどちらかの判定処理でその結果がNoであったときには、CPU22は、S102に示した処理で抽出されたメソッド定義のコンパイルを実行し(S107)、その結果得られた、CPU22で直接実行可能なネイティブコードをRAM25−2のワークエリアにコンパイル済み実行モジュール44として格納し(S108)、更にそのネイティブコードをハードディスク装置26にコンパイル済み格納モジュール43として記憶させる(S109)。このネイティブコードの記憶は、プログラムソースモジュール41の翻訳・実行が終了し、CPU22がこの図5に示したJITコンパイル処理の実行を一旦終了してもハードディスク装置26に保持されている。
【0050】
その後、CPU22は管理簿42を更新し、前述したS102でコンパイルしたメソッド定義のメソッド名と、そのメソッド定義が記述されていたプログラムソースモジュール41を格納していたプログラムファイルの管理情報に示されている更新日時とを対応付けて記録し(S110)、その後はS112に進む。
【0051】
これらのS107からS110にかけて示されている処理は図3におけるコンパイル部33の機能に相当する。
一方、前述したS106の判定処理でその結果がYesであったときには、CPU22は、S102に示した処理で抽出されたメソッド定義の翻訳であるネイティブコードをハードディスク装置26から読み出し、読み出したそのネイティブコードをRAM25−2のワークエリアにコンパイル済み実行モジュール44として格納する(S111)。この処理は図3におけるファイルロード部34の機能に相当する。
【0052】
その後、CPU22はRAM25−2のワークエリアにコンパイル済み実行モジュール44として格納されているネイティブコードを直接実行する(S112)。この処理は図3におけるプログラム実行部35の機能に相当する。
【0053】
コンパイル済み実行モジュール44を実行した後には、CPU22は、RAM25−2のワークエリアに格納されているプログラムソースモジュール41の実行処理を終了したか否かを判定する(S113)。この判定処理の結果がYesならば今回のJITコンパイル処理を終了する。一方、この判定処理の結果がNoならばS102へ戻り、プログラムソースモジュール41に次の実行順として記述されているメソッド定義について上述した処理を繰り返す。
【0054】
以上までの処理が図5に示されているJITコンパイル処理である。
次に、本発明を実施するプログラム実行装置の第二の例について説明する。
この第二の例では、図2におけるハードディスク装置26に、プログラムソースモジュール41で記述されることがあり得るメソッド定義の翻訳であるネイティブコードを予め格納しておくようにするものである。こうすることにより、そのプログラムソースモジュール41のプログラム実行装置10上での初めての実行の際でも、プログラムソースモジュール41に記述されているメソッド定義の翻訳であるネイティブコードをハードディスク装置26から得ることのできる場合があるので、メソッドの翻訳処理に起因する実行開始時のタイムラグを短縮することができる。
【0055】
本発明を実施するプログラム実行装置の第二の例の全体構成は図2に示したものと同様であるが、図2に示す構成要素のうち、ハードディスク装置26の記憶内容が前述した第一の例と異なっている。図6は、本発明を実施するプログラム実行装置の第二の例におけるハードディスク装置の記憶内容を示す図であり、ハードディスク装置26には、第一の例と同様のコンパイル済み格納モジュール43が記憶されるのに加え、プログラムソースモジュール41で記述されることがあり得るメソッド定義の翻訳であるコンパイル済み標準モジュール51が予め記憶されている。このような、その翻訳であるネイティブコードがコンパイル済み標準モジュール51としてハードディスク装置26に記憶されるメソッド定義としては、例えば、Javaの標準のクラスライブラリであるjavaパッケージに含まれるクラスに属するメソッド定義などの、任意のJava実行系で使用できることが保証されているメソッド定義が適用可能である。
【0056】
次に図7について説明する。図7は本発明を実施するプログラム実行装置の第二の例における管理簿42の例を表で示したものであり、ハードディスク装置26の記憶内容が図6に示した内容である場合に対応するものである。図7を、前述した本発明の第一の実施例における管理簿42の記録内容を示した図4と比較すると分かるように、図7においては、コンパイル済み格納モジュール43についての管理情報が管理簿42に記録される他に、コンパイル済み標準モジュール51についての管理情報が管理簿に予め記録されている。コンパイル済み標準モジュール51についての管理情報としては、そのコンパイル済み標準モジュール51が翻訳である翻訳前のメソッド定義のメソッド名が管理簿42に記録されている。
【0057】
次に、本発明を実施するプログラム実行装置の第二の例におけるCPU22により実行されるJITコンパイル処理の処理内容について、図8に示すフローチャートを参照しながら説明する。
【0058】
まず、図8におけるS201からS204にかけて示されている処理は、図5にフローチャートで示したJITコンパイル処理の第一の例におけるS101からS104にかけて示した処理と全く同一のものであり、その説明は省略する。
【0059】
S205において、CPU22は、S202で抽出されたメソッド定義のメソッド名が管理簿42のコンパイル済み標準モジュール51についての管理情報として記録されているか否かを判定する。この判定処理の結果がYesならばS212に進み、NoならばS206に進む。
【0060】
図8におけるS205以降の、S206からS214にかけて示されている処理も、図5にフローチャートで示したJITコンパイル処理の第一の例におけるS105からS113にかけて示した処理と全く同一のものである。
【0061】
次に、本発明を実施するプログラム実行装置の第三の例について説明する。
この第三の例では、プログラム実行装置に電源を投入して起動させたときに、ハードディスク装置26の記憶内容をRAM25−2に複写して格納する。そして、CPU22によって行なわれるJITコンパイル処理では、ハードディスク装置26の記憶内容に基づいて翻訳・実行の処理を進めるのではなく、ハードディスク装置26の記憶内容の複写であるRAM25−2の格納データに従ってその処理を進める。一般的に、記憶内容の読み出しは半導体メモリからの方がハードディスク装置よりも高速に行なえるので、こうすることにより、プログラム装置10によるプログラムソースモジュール41の翻訳・実行の処理時間を更に短縮することができる。
【0062】
本発明を実施するプログラム実行装置の第三の例の全体構成は図2に第一の例として示したものと同様であるが、図9に示すように、RAM25−2の記憶領域に、CPU22による処理の実行のために一時的に使用されるワークエリア61の領域の他に、ハードディスク装置26の記憶内容が複写されて格納されるキャッシュエリア62の領域を設けるようにする。そして、このキャッシュエリア62の領域は、CPU22が後述するJITコンパイル処理の実行を終了してもその記憶内容をクリアせずに保持するようにし、次にJITコンパイル処理を改めて実行しても、その処理においてその記憶内容が利用できるようにする。
【0063】
また、管理簿42の記録内容も図4に示したものと同様のものでよい。但し、前述した第一の例では管理簿42はハードディスク装置26に記憶されていたが、この第三の例では、ハードディスク装置26の管理簿42についての記録内容もRAM25−2に複写され、CPU22はRAM25−2上の管理簿42を参照して処理を行なうものとする。
【0064】
本発明を実施するプログラム実行装置の第三の例における、装置全体の制御処理の処理内容を図10にフローチャートで示す。この処理は、本装置20に電源を投入するとその直後にCPU22により直ちに実行される処理である。
【0065】
本装置に電源が投入されると、まず、CPU22は初期化処理を実行する(S301)。初期化処理はCPU22自身の有する各種のレジスタを初期化したり、RAM25−2の初期化などを行なう処理である。
【0066】
続いて、CPU22はハードディスク装置26の記憶内容をRAM25−2のキャッシュエリア62に複写する(S302)。
その後、CPU22は、本装置20の入力部21、出力部23、I/F部24の制御等を含む各種の制御処理を実行し(S303)、その後にJITコンパイル処理を実行する(S304)。この処理を終えた後にはS303へ戻り、以降の処理が繰り返される。
【0067】
次に図11について説明する。図11は、図10にS304として示されているJITコンパイル処理の処理内容を示すフローチャートである。
まず、図11におけるS311からS319にかけて示されている処理は、図5にフローチャートで示したJITコンパイル処理の第一の例におけるS101からS109にかけて示した処理と同様のものである。但し、S313において、CPU22は、RAM25−2のキャッシュエリア62に格納されている、ハードディスク装置26の複写である管理簿42を参照する。
【0068】
S320において、S317でのコンパイルにより得られたネイティブコードをRAM25−2のキャッシュエリア62にも格納し、このネイティブコードをS319において記憶させたハードディスク装置26の記憶内容とキャッシュエリア62の記憶内容とを一致させる。
【0069】
その後、CPU22は、ハードディスク装置26及びキャッシュエリア62双方の管理簿42を同様に更新し、S312でコンパイルしたメソッド定義のメソッド名と、そのメソッド定義が記述されていたプログラムソースモジュール41を格納していたプログラムファイルの管理情報に示されている更新日時とを対応付けて記録し(S321)、その後はS323に進む。
【0070】
一方、S316の判定処理でその結果がYesであったときには、CPU22は、S312に示した処理で抽出されたメソッド定義の翻訳であるネイティブコードをRAM25−2のキャッシュエリア62から読み出し、読み出したそのネイティブコードをRAM25−2のワークエリアにコンパイル済み実行モジュール44として格納する(S322)。
【0071】
図11におけるS322以降の、S323及びS324に示されている処理は、図5にフローチャートで示したJITコンパイル処理の第一の例におけるS112及びS113に示した処理と全く同一のものであり、説明は省略する。
【0072】
なお、前述した第二の例、すなわちハードディスク装置26に、プログラムソースモジュール41で記述されることがあり得るメソッド定義の翻訳であるネイティブコードを予め格納しておくようにしたプログラム実行装置で、この第三の例のように、ハードディスク装置26の記憶内容をRAM25−2に複写してJITコンパイル処理を実行することも可能である。
【0073】
なお、上述した本発明の各実施形態において説明したJITコンパイル処理を汎用的なコンピュータで実施させることも可能である。そのためには、本発明の各実施形態において説明した、図5、図8、あるいは図11のJITコンパイル処理に相当する処理をコンピュータに行なわせる制御プログラムをそのコンピュータで読み取り可能な記録媒体(記憶媒体)に予め記憶させておき、その記録媒体から読み出したその制御プログラムを読み出させてそのコンピュータのメインメモリに一旦格納させた後に、そのコンピュータの有する中央処理装置に格納されたこのプログラムを読み出させて実行させるように構成すればよい。
【0074】
上述した制御プログラムを格納し、且つそれをコンピュータで読み取ることの可能な記録媒体の例を図12に示す。このような記録媒体としては、例えば、コンピュータ71の本体に内蔵若しくは外付けされる半導体メモリやハードディスク装置などのメモリ72、CD−ROM、DVD−ROM、MO(光磁気ディスク)、フロッピーディスクなどといった可搬型記憶媒体73、あるいはコンピュータ71と回線74で接続されていてコンピュータ71がプログラムをダウンロードすることの可能なプログラムサーバ75の記憶装置76などがあるが、これらのいずれであってもよい。
【0075】
【発明の効果】
以上詳細に説明したように、本発明は、ジャスト・イン・タイム・コンパイラ方式により、原始プログラムを特定の演算処理システムのプラットホームで直接実行可能な機械語に翻訳して該機械語を実行させるときに、前記原始プログラムの翻訳である前記機械語を、該原始プログラムに記述されている関数ごとに、電源電圧が消失しても記憶内容が保持される記憶部に記憶させ、前記原始プログラムに記述されている関数の翻訳である前記機械語が前記記憶部に記憶されているか否かの判定を行ない、前記判定結果に応じて、前記原始プログラムを翻訳して得る機械語、または前記記憶部に記憶されている機械語、のどちらかを特定の演算処理システムのプラットホームで直接実行させるように構成する。そして、この構成により、電源を切った後に同一の原始プログラムを再度実行させるような場合には、プログラムの翻訳処理に起因する実行開始時のタイムラグを生じさせずに原始プログラムを実行させることができる。
【0076】
あるいは、本発明は、ジャスト・イン・タイム・コンパイラ方式により、原始プログラムを特定の演算処理システムのプラットホームで直接実行可能な機械語に翻訳して該機械語を実行させるときに、前記原始プログラムの翻訳である前記機械語を、該原始プログラムに記述されている関数ごとに、該機械語の翻訳前の原始プログラムが更新された日時に対応付けて記憶し、前記原始プログラムの更新された日時と、記憶されている前記機械語に対応付けられている更新日時とが一致するか否かの判定を行ない、前記判定結果に応じて、前記原始プログラムを翻訳して得る機械語、または記憶されている機械語、のどちらかを特定の演算処理システムのプラットホームで直接実行させるように構成する。そして、この構成により、原始プログラムに変更が加えられても、プログラムの翻訳処理に起因する実行開始時のタイムラグを生じさせずに、且つ、その変更に応じて正しく原始プログラムを実行させることができる。
【0077】
以上のように、本発明のいずれの構成によっても、JITコンパイラを用いて原始プログラムを実行させるときの実行開始時の性能を向上させることができるという効果を奏する。
【図面の簡単な説明】
【図1】本発明の基本構成図である。
【図2】本発明を実施するプログラム実行装置の全体構成を示す図である。
【図3】本発明を実施するプログラム実行装置における翻訳・実行処理の全体の流れを示した図である。
【図4】管理簿の一例を表で示した図である。
【図5】JITコンパイル処理の第一の例の処理内容をフローチャートで示した図である。
【図6】本発明を実施するプログラム実行装置の第二の例におけるハードディスク装置の記憶内容を示す図である。
【図7】プログラム実行装置の第二の例における管理簿の例を表で示した図である。
【図8】JITコンパイル処理の第二の例の処理内容をフローチャートで示した図である。
【図9】本発明を実施するプログラム実行装置の第三の例におけるRAMの記憶内容を示す図である。
【図10】本発明を実施するプログラム実行装置の第三の例における装置全体の制御処理の処理内容を示すフローチャートである。
【図11】図10におけるJITコンパイル処理の処理内容を示すフローチャートである。
【図12】記憶させた制御プログラムをコンピュータで読み取ることの可能な記録媒体の例を示す図である。
【符号の説明】
1 原始プログラム
10、20 プログラム実行装置
11 記憶手段
12 翻訳手段
13 記憶制御手段
14 判定手段
15 実行制御手段
16 実行手段
21 入力部
22 CPU
23 出力部
24 I/F部
25 半導体メモリ
25−1 ROM
25−2 RAM
26 ハードディスク装置
27 バス
30 JITコンパイラ
31 プログラムロード部
32 高速化判定部
33 コンパイル部
34 ファイルロード部
35 プログラム実行部
41 プログラムソースモジュール
42 管理簿
43 コンパイル済み格納モジュール
44 コンパイル済み実行モジュール
51 コンパイル済み標準モジュール
61 ワークエリア
62 キャッシュエリア
71 コンピュータ
72 メモリ
73 可搬型記憶媒体
74 回線
75 プログラムサーバ
76 記憶装置
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a technique for executing a program written in a high-level programming language on an arithmetic processing system, and in particular, directly executing a source program on a specific arithmetic processing system platform by a just-in-time compiler method. The present invention relates to a technique for translating into a possible machine language and executing the machine language.
[0002]
[Prior art]
Many attempts have been made to run the same program on different computing system platforms. The programming language Java (Java is a registered trademark of Sun Microsystems, Inc.) is one of the answers. Java realizes platform independence and is excellent in portability between different platforms.
[0003]
Generally, the source code of a program written in Java is subjected to processing such as syntax analysis, converted into a binary file called bytecode, and distributed. The Java bytecode is a general-purpose instruction code that is independent of the platform of the arithmetic processing system, and is a code that is interpreted and executed by a Java execution system called a Java VM (virtual machine). By providing each computing processing system with an environment corresponding to Java VM, it is possible to execute the same Java bytecode on different computing systems.
[0004]
Hereinafter, a technique for executing a Java bytecode on the arithmetic processing system will be described.
The Java interpreter sequentially interprets (interprets) the Java byte code for each instruction, and causes the arithmetic processing system to perform processing corresponding to the instruction. The Java interpreter has a great advantage that it can interpret and process a program written in Java bytecode as it is, but it has a disadvantage in that the processing speed is slow because it takes time for instruction interpretation.
[0005]
As a technique for improving the execution speed of a program described in Java bytecode, there is a technique in which Java bytecode is pre-translated (compiled) into native code that is a machine language that can be directly executed by the processing system to be processed. A tool for this is called a native compiler. Although the execution speed of a program is remarkably improved by converting Java bytecode to native code, there is a problem that portability between different platforms, which is a great advantage of Java, is impaired, and further, the change of the program causes Java bytecode to be changed. Each time is updated, there is also the trouble that the operator of the arithmetic processing system must instruct the system to perform the translation work into the native code.
[0006]
A just-in-time compiler (hereinafter referred to as “JIT compiler”) has been proposed to improve the processing speed of the Java interpreter while maintaining portability between different platforms, which is an advantage of Java. Has been.
[0007]
When executing the Java bytecode, the JIT compiler causes the arithmetic processing system to sequentially execute the function (method in Java) used in the bytecode while translating it into native code. Here, the translated native code is stored in the main memory. If a function that has already been translated into native code appears while proceeding with the translation of the Java bytecode, the native code held in the main memory is left as it is without being translated again. The processing time required for translation processing is reduced by causing the arithmetic processing system to directly execute the processing. In general, a function that has a great influence on reducing the execution speed of the entire program is often called repeatedly, so that using this technique can improve the execution speed of Java bytecode.
[0008]
The JIT compiler also optimizes instructions written in Java bytecode, which is difficult to interpret with an interpreter, and this optimization also increases the processing speed. Moreover, the complicated operation by the operator for the arithmetic processing system, which is necessary for the native compiler, is not necessary for the JIT compiler.
[0009]
Note that JIT compilers that are used to execute Java bytecodes are particularly widespread, but programs written in other programming languages and programs that have been parsed and optimized are processed. The obtained program written in an intermediate language (in this specification, these programs will be collectively referred to as “source program”) is translated into native code that can be directly interpreted by a specific platform, and the platform It can also be configured to execute above.
[0010]
[Problems to be solved by the invention]
As described above, the JIT compiler can improve the problem of execution speed while maintaining portability between different platforms, which is a great advantage of Java, and the burden of operation work by the operator is native. • Has fewer advantages than the compiler. However, since the native code is always translated into the source program at the start of execution, the execution of the source program using the JIT compiler requires some processing until the processing described in the source program is actually started. There was a problem that the time lag would occur.
[0011]
In view of the above problems, it is an object of the present invention to improve the performance at the start of execution when a source program is executed using a JIT compiler.
[0012]
[Means for Solving the Problems]
FIG. 1 is a basic configuration diagram of the present invention. A program execution apparatus 10 which is an apparatus according to the present invention has an execution means 16 for executing a machine language, and converts the source program 1 into a machine language that can be directly executed by the execution means 16 by a just-in-time compiler method. Assume a device that translates and executes.
[0013]
In the apparatus according to the first aspect of the present invention, the program execution apparatus 10 stores a machine language that is a translation of a function described in the source program 1 and that can be executed by the execution means 16 for each function. The storage means 11 that retains the stored contents even if it disappears, the translation means 12 that translates the source program 1 into a machine language that can be executed by the execution means 16, and the machine language translated by the translation means 12 in the storage means 11 The storage control means 13 to be stored, the determination means 14 for determining whether or not the machine language that is the translation of the function used in the source program 1 is stored in the storage means 11, and the determination result by the determination means 14 Accordingly, an execution control unit 15 that directly causes the execution unit 16 to execute either the machine language translated by the translation unit 12 or the machine language stored in the storage unit 11 is provided. To solve the problems described above by forming.
[0014]
In this configuration, for example, a hard disk device or a flash EEPROM (batch erase type electrical erasure and writable read-only semiconductor memory) can be used as the storage unit 11.
[0015]
In the above configuration, the storage unit 11 stores a machine language that is a translation of a function described in the source program 1. If the determination unit 14 determines that the machine language that is the translation of the function used in the source program 1 is stored in the storage unit 11, the execution control unit 15 does not wait for the translation unit 12 to translate the function. Since the execution means 16 is controlled so that the machine language of the function stored in the storage means 11 is directly executed, the program execution apparatus 10 performs an operation corresponding to the above-described JIT compiler. Therefore, according to the above configuration, the above-described advantages of the JIT compiler are maintained.
[0016]
Moreover, the storage means 11 in the above configuration retains the stored contents even when the power supply voltage disappears. Therefore, for example, when the operator turns off the program execution device 10 after completing a day's work and resumes work on the next day, the memory is stored if the same original program 1 is executed even once by the previous day. Since the machine language that is the translation of the function described in the source program 1 and stored in the means 11 can be used from the first execution of the day, the program execution device 10 executes the execution resulting from the program translation process. The primitive program 1 can be executed without causing a time lag at the start.
[0017]
In the configuration described above, the storage unit 11 may be configured such that a machine language that is a translation of a function that can be used in the source program 1 is stored in advance. In this configuration, a machine language that is a translation of a function described in the source program 1 may already be stored when the source program 1 is executed on the program execution device 10 for the first time. Since the machine language that is the translation of the function described in the source program 1 can be obtained from the storage means 11, the time lag at the start of execution caused by the program translation process can be shortened.
[0018]
Further, in the configuration described above, a semiconductor memory for copying and storing the storage contents of the storage unit 11 is further provided, and the execution control unit 15 is an alternative to causing the execution unit 16 to execute the machine language stored in the storage unit 11. In addition, the execution unit 16 may be configured to execute a machine language that is stored in the semiconductor memory and is a copy of the storage content stored in the storage unit 11. For example, when a hard disk device is used as the storage unit 11, it is preferable to read a machine language from a semiconductor memory in which the same storage content as the hard disk device is copied, rather than reading a machine language from the hard disk device. Therefore, the processing time for the translation / execution of the source program 1 by the program device 10 can be further shortened.
[0019]
In the apparatus according to the second aspect of the present invention, a machine language that is a translation of a function described in the source program 1 and that can be executed by the execution means 16 is stored for each function in the program execution device 10. The storage means 11 that retains the stored contents even after the execution of the program 1 is completed, the translation means 12 that translates the source program 1 into a machine language that can be executed by the execution means 16, and the machine language translated by the translation means 12 The storage control means 13 to be stored in the storage means 11 in association with the date and time when the source program 1 translated by the means 12 is updated, the date and time when the source program 1 was updated, and the storage means 11 A determination unit 14 for determining whether or not the update date and time associated with the machine language matches, and a machine language to be translated by the translation unit 12 according to a determination result by the determination unit 14; Others to solve the problems described above with the structure described and a execution control unit 15 to execute directly machine language stored in the storage unit 11, either the execution unit 16.
[0020]
The above configuration further includes a reading unit that reads a program file in which the source program 1 is stored, and the storage control unit 13 updates the program file indicated in the program file in which the source program 1 is stored. The date and time is regarded as the updated date and time of the source program 1 associated with the machine language, the machine language is stored in the storage unit 11, and the determination unit 14 includes the update date and time of the program file indicated in the program file. Further, it may be configured to determine whether or not the update date and time stored in the storage unit 11 is matched with the machine language.
[0021]
The above configuration has the advantages of the JIT compiler as it is, as in the above-described apparatus according to the first aspect of the present invention.
Further, in the above configuration, the stored contents are retained even after the execution of the source program 1 is completed. Therefore, when the same source program 1 is executed again, the execution control unit 15 causes the translation unit 12 to execute the source program 1 By causing the execution unit 16 to directly execute the machine language of the function stored in the storage unit 11 without waiting for translation, the source program 1 can be executed without causing a time lag at the start of execution due to the translation process of the program. Can be executed. However, in this case, the source program 1 to be executed later and the one executed first may not be the same due to correction by upgrading the source program. Therefore, the storage control unit 13 stores the machine language translated by the translation unit 12 and the date and time when the source program 1 translated by the translation unit 12 is updated in the storage unit 11, and the determination unit 14 Then, it is determined whether or not the updated date and time of the original program 1 matches the updated date and time stored in the storage unit 11 in association with the machine language. If the result of this determination is that they do not match, the execution control means 15 is newly updated by the translation means 12 even if the machine language that is the translation of the function used in the source program 1 is stored in the storage means 11. The execution unit 16 executes the machine language translated into By doing so, even if a change is made to the source program 1, the source program 1 can be executed correctly in accordance with the change.
[0022]
In the above-described configuration, the storage unit 11 is not limited to a storage device such as a hard disk device or a flash EEPROM that retains stored contents even when the power supply voltage is lost, and uses other readable / writable storage media. You can also.
[0023]
In the apparatus according to the first or second aspect of the present invention described above, the source program 1 may be described in Java bytecode. In this case, the function described in the source program 1 corresponds to a method in Java.
[0024]
Further, the program execution method according to the present invention is a method of executing a machine language by translating a source program into a machine language that can be directly executed on a platform of a specific arithmetic processing system by a just-in-time compiler method. Assumption.
[0025]
In the program execution method according to the first aspect of the present invention, the machine language that is the translation of the source program is stored for each function described in the source program even if the power supply voltage is lost. Is stored in the storage unit, and it is determined whether or not the machine language, which is a translation of the function described in the source program, is stored in the storage unit, and according to the determination result, the source program The above-described problem is solved by causing a machine language obtained by translating the machine language or a machine language stored in the storage unit to be directly executed on a platform of a specific arithmetic processing system. This program execution method also provides the same operations and effects as those of the apparatus according to the first aspect of the present invention described above.
[0026]
In the program execution method according to the second aspect of the present invention, the machine program that is the translation of the source program is updated by the source program before the machine language translation for each function described in the source program. Stored in association with the stored date and time, and determines whether or not the updated date and time of the source program matches the stored update date and time associated with the machine language, and the determination result Accordingly, the machine problems obtained by translating the source program or the stored machine language are directly executed on the platform of a specific arithmetic processing system to solve the above-described problem. This program execution method also provides the same operations and effects as those of the apparatus according to the second aspect of the present invention described above.
[0027]
The control is performed by causing the computer to execute a control program that causes the computer to perform the same control as the function performed by each configuration of the present invention described above, or from a computer-readable recording medium that records the control program. By causing the computer to read and execute the program, the above-described problems can be solved, and this configuration also provides the same operations and effects as the above-described program execution device.
[0028]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings. Here, an example in which the present invention is implemented in a program execution apparatus that translates and executes Java bytecodes will be described.
[0029]
FIG. 2 is a diagram showing the overall configuration of a program execution device for implementing the present invention. As shown in the figure, the program execution device (hereinafter referred to as “this device”) 20 includes an input unit 21, a CPU 22, an output unit 23, an I / F unit 24, a semiconductor memory 25, and a hard disk device 26. They are connected to each other via a bus 27.
[0030]
The input unit 21 includes a keyboard device, a pointing device such as a mouse, and the like, and acquires input of various instructions from an operator of the device. A data reading device for reading data from a recording medium such as a floppy disk, a magneto-optical disk, or a magnetic tape may be provided.
[0031]
The CPU 22 is a central processing unit that controls the operation of the entire apparatus 20 according to a control program stored in the semiconductor memory 25, and directly executes the machine language.
The output unit 23 includes a display device, a printer, and the like, and presents the results of processing performed by the device 20 to the operator.
[0032]
The I / F unit 24 manages processing for an interface for connecting the device 20 to another device or a network.
The semiconductor memory 25 stores in advance a control program for causing the CPU 22 to perform control processing of the entire apparatus 20, copies and stores the storage contents of the hard disk device 26, or processing executed by the CPU 22. And a ROM (Read Only Memory) 25-1 and a RAM (Random Access Memory) 25-2.
[0033]
The hard disk device 26 is a data storage device that retains stored contents even when the power supply voltage supplied to the device 20 disappears.
Next, FIG. 3 will be described. FIG. 3 is a diagram illustrating the overall flow of the translation / execution process in the apparatus 20.
[0034]
The program source module 41 is a software module that causes the apparatus 20 to perform translation and execution, and is described in Java bytecode in this embodiment. The program source module 41 is a program file stored as a program file stored in the above-described recording medium, read by a data reading device of the input unit 21, or sent as a program file from another device or network Is received by the I / F unit 24 and is taken into the apparatus 20.
[0035]
The program source module 41 input to the apparatus 20 is translated and executed by the JIT compiler 30. The JIT compiler 30 is realized by the CPU 22 executing a control program for the entire apparatus 20.
[0036]
The contents of processing performed by the JIT compiler 30 are divided into functional blocks of a program loading unit 31, a speed-up determination unit 32, a compile (translation) unit 33, a file loading unit 34, and a program execution unit 35. The
[0037]
The program load unit 31 extracts the program source module 41 from the program file taken into the apparatus 20 and stores it in an area (work area) used as a work memory by the CPU 22 in the RAM 25-2.
[0038]
The acceleration determination unit 32 performs a syntax analysis of the program source module 41, and whether native code (compiled storage module 43) corresponding to the translation of the method definition described therein is stored in the hard disk device 26. It is determined by referring to a management book 42 described later. In the present embodiment, the management book 42 is stored in the hard disk device 26.
[0039]
When the acceleration determination unit 32 determines that the compiled storage module 43 corresponding to the above-described method definition translation is not stored in the hard disk device 26, the compiling unit 33 translates the method definition. As a result, the native code that can be directly executed by the CPU 22 is stored as the compiled execution module 44 in the above-described work area in the RAM 25-2 and is stored in the hard disk device 26 as the compiled storage module 43. Further, the management information on the stored compiled storage module 43 in the management list 42 is updated.
[0040]
When the acceleration determination unit 32 determines that the compiled storage module 43 corresponding to the translation of the method definition described above is stored in the hard disk device 26, the file loading unit 34 stores the compiled storage module 43 in the hard disk It is loaded (read out) from the device 26 and stored as a compiled execution module 44 in the work area of the RAM 25-2.
[0041]
The program execution unit 35 directly executes the compiled execution module 44 stored in the work area of the RAM 25-2 by the compiling unit 33 or the file loading unit 34 on the CPU 22.
[0042]
The JIT compiler 30 executes the program source module 41 by repeatedly executing the processes indicated by the functional blocks of the acceleration determination unit 32, the compile (translation) unit 33, the file load unit 34, and the program execution unit 35. Let
[0043]
Next, the management book 42 will be described. FIG. 4 is a diagram showing an example of the management list 42 as a table. The management list 42 records management information about the compiled storage module 43 stored in the hard disk device 26.
[0044]
In the table shown in FIG. 4, in the left column, a method name of a method definition before translation corresponding to the compiled storage module 43 stored in the hard disk device 26 and whose compiled storage module 43 is a translation is recorded. The The update date and time of the program source module 41 in which the method definition corresponding to the method name in the left column is described is recorded in the right column of the table shown in FIG. In this embodiment, the update date and time indicated as the management information of the program file in which the program source module 41 is stored is used as the update date and time. In the acceleration determination unit 32, the program load unit 31 analyzes the program source module 41 stored in the work area of the RAM 25-2. Then, the method name of the method definition described therein is recorded in the management book 42, and whether the update date / time of the program source module 41 matches the update date / time corresponding to the method name in the management book 42 or not. Determine whether. If the determination result is true, it is determined that the compiled storage module 43 corresponding to the translation of the method definition is stored in the hard disk device 26.
[0045]
Next, FIG. 5 will be described. FIG. 5 shows the translation / execution of the program source module 41 related to the present invention in the control processing performed by the CPU 22 executing the control program for the entire apparatus 20 stored in the ROM 25-1. It is the figure which showed the processing content of the 1st example of the JIT compilation process which is a process with the flowchart. The JIT compilation process performed by the CPU 22 will be described below with reference to FIG.
[0046]
First, the CPU 22 extracts the program source module 41 from the program file taken into the apparatus 20 and stores it in the work area of the RAM 25-2 (S101). This processing corresponds to the function of the program load unit 31 in FIG.
[0047]
Subsequently, the CPU 22 analyzes the syntax of the program source module 41 stored in the work area of the RAM 25-2, and extracts one method definition described therein (S102). Here, the CPU 22 refers to the management book 42 (S103), and determines whether or not the method name of the extracted method definition is included in the recorded contents of the management book 42 (S104). If the result of this determination process is Yes, the process proceeds to S105, and if No, the process proceeds to S107.
[0048]
If the method name of the extracted method definition is included in the recorded contents of the management list 42, the CPU 22 checks the management information of the program file in which the program source module 41 is stored, and updates the program source module 41. The date and time are acquired (S105). Then, it is determined whether or not the update date and time of the program source module 41 matches the update date and time recorded in the management book 42 in association with the extracted method name record of the method definition (S106). . If the result of this determination process is Yes, the process proceeds to S111, and if No, the process proceeds to S107.
[0049]
The processing shown from S102 to S106 above corresponds to the function of the speed-up determination unit 32 in FIG.
When the result of the determination process in S104 or S106 is No, the CPU 22 compiles the method definition extracted in the process shown in S102 (S107), and the result obtained is as follows. The native code that can be directly executed by the CPU 22 is stored as a compiled execution module 44 in the work area of the RAM 25-2 (S108), and the native code is stored in the hard disk device 26 as a compiled storage module 43 (S109). The storage of the native code is held in the hard disk device 26 even after the translation / execution of the program source module 41 is finished and the CPU 22 once finishes the execution of the JIT compilation process shown in FIG.
[0050]
Thereafter, the CPU 22 updates the management list 42 and is indicated in the management information of the program file storing the method name of the method definition compiled in S102 and the program source module 41 in which the method definition is described. Are recorded in association with each other (S110), and thereafter, the process proceeds to S112.
[0051]
The processing shown from S107 to S110 corresponds to the function of the compiling unit 33 in FIG.
On the other hand, if the result of the determination process in S106 is Yes, the CPU 22 reads out the native code that is the translation of the method definition extracted in the process shown in S102 from the hard disk device 26, and the read native code Is stored in the work area of the RAM 25-2 as the compiled execution module 44 (S111). This process corresponds to the function of the file loading unit 34 in FIG.
[0052]
Thereafter, the CPU 22 directly executes the native code stored as the compiled execution module 44 in the work area of the RAM 25-2 (S112). This process corresponds to the function of the program execution unit 35 in FIG.
[0053]
After executing the compiled execution module 44, the CPU 22 determines whether or not the execution processing of the program source module 41 stored in the work area of the RAM 25-2 has ended (S113). If the result of this determination process is Yes, the current JIT compilation process is terminated. On the other hand, if the result of this determination process is No, the process returns to S102, and the above-described process is repeated for the method definition described in the program source module 41 as the next execution order.
[0054]
The above processing is the JIT compilation processing shown in FIG.
Next, a second example of a program execution device that implements the present invention will be described.
In this second example, a native code, which is a translation of a method definition that may be described by the program source module 41, is stored in advance in the hard disk device 26 in FIG. In this way, even when the program source module 41 is executed for the first time on the program execution device 10, native code that is a translation of the method definition described in the program source module 41 can be obtained from the hard disk device 26. In some cases, the time lag at the start of execution due to the method translation process can be shortened.
[0055]
The overall configuration of the second example of the program execution device for carrying out the present invention is the same as that shown in FIG. 2, but the storage contents of the hard disk device 26 among the components shown in FIG. It is different from the example. FIG. 6 is a diagram showing the storage contents of the hard disk device in the second example of the program execution device for carrying out the present invention. The hard disk device 26 stores the compiled storage module 43 similar to the first example. In addition, a compiled standard module 51 that is a translation of a method definition that may be described by the program source module 41 is stored in advance. As such a method definition in which the native code that is the translation is stored in the hard disk device 26 as the compiled standard module 51, for example, a method definition belonging to a class included in a Java package that is a standard class library of Java, etc. A method definition that is guaranteed to be usable in any Java execution system is applicable.
[0056]
Next, FIG. 7 will be described. FIG. 7 is a table showing an example of the management list 42 in the second example of the program execution apparatus for carrying out the present invention, and corresponds to the case where the storage contents of the hard disk device 26 are the contents shown in FIG. Is. As can be seen by comparing FIG. 7 with FIG. 4 showing the recorded contents of the management book 42 in the first embodiment of the present invention, the management information for the compiled storage module 43 is shown in FIG. In addition to being recorded in 42, management information for the compiled standard module 51 is recorded in advance in the management list. As the management information for the compiled standard module 51, the method name of the method definition before translation in which the compiled standard module 51 is translated is recorded in the management list 42.
[0057]
Next, the processing content of the JIT compilation processing executed by the CPU 22 in the second example of the program execution apparatus for carrying out the present invention will be described with reference to the flowchart shown in FIG.
[0058]
First, the processing shown from S201 to S204 in FIG. 8 is exactly the same as the processing shown from S101 to S104 in the first example of the JIT compilation processing shown in the flowchart of FIG. Omitted.
[0059]
In S <b> 205, the CPU 22 determines whether or not the method name of the method definition extracted in S <b> 202 is recorded as management information for the compiled standard module 51 in the management book 42. If the result of this determination process is Yes, the process proceeds to S212, and if No, the process proceeds to S206.
[0060]
The processes shown from S206 to S214 after S205 in FIG. 8 are also exactly the same as the processes shown from S105 to S113 in the first example of the JIT compilation process shown in the flowchart of FIG.
[0061]
Next, a third example of the program execution device for carrying out the present invention will be described.
In this third example, when the program execution device is turned on and activated, the storage contents of the hard disk device 26 are copied and stored in the RAM 25-2. In the JIT compilation process performed by the CPU 22, the translation / execution process does not proceed based on the stored contents of the hard disk device 26, but the process is performed according to the stored data in the RAM 25-2 that is a copy of the stored contents of the hard disk device 26. To proceed. In general, the stored contents can be read from the semiconductor memory at a higher speed than the hard disk device, so that the processing time for the program source module 41 to be translated and executed by the program device 10 can be further shortened. Can do.
[0062]
The overall configuration of the third example of the program execution apparatus for carrying out the present invention is the same as that shown in FIG. 2 as the first example. However, as shown in FIG. In addition to the work area 61 area temporarily used for the execution of the above process, an area of the cache area 62 in which the stored contents of the hard disk device 26 are copied and stored is provided. Even if the CPU 22 finishes execution of the JIT compilation process described later, the cache area 62 retains the stored contents without clearing, and even if the JIT compilation process is executed again, The stored contents are made available for processing.
[0063]
The recorded contents of the management book 42 may be the same as that shown in FIG. However, in the first example described above, the management book 42 is stored in the hard disk device 26. However, in this third example, the recorded contents of the management book 42 of the hard disk device 26 are also copied to the RAM 25-2, and the CPU 22 Suppose that processing is performed with reference to the management book 42 on the RAM 25-2.
[0064]
FIG. 10 is a flowchart showing the contents of control processing of the entire apparatus in the third example of the program execution apparatus for implementing the present invention. This processing is immediately executed by the CPU 22 immediately after the apparatus 20 is turned on.
[0065]
When the apparatus is turned on, first, the CPU 22 executes an initialization process (S301). The initialization process is a process for initializing various registers of the CPU 22 itself, initializing the RAM 25-2, and the like.
[0066]
Subsequently, the CPU 22 copies the stored contents of the hard disk device 26 to the cache area 62 of the RAM 25-2 (S302).
Thereafter, the CPU 22 executes various control processes including control of the input unit 21, output unit 23, and I / F unit 24 of the apparatus 20 (S303), and then executes JIT compilation processing (S304). After this process is completed, the process returns to S303 and the subsequent processes are repeated.
[0067]
Next, FIG. 11 will be described. FIG. 11 is a flowchart showing the contents of the JIT compilation process shown as S304 in FIG.
First, the processing shown from S311 to S319 in FIG. 11 is the same as the processing shown from S101 to S109 in the first example of the JIT compilation processing shown in the flowchart of FIG. However, in S313, the CPU 22 refers to the management book 42, which is a copy of the hard disk device 26, stored in the cache area 62 of the RAM 25-2.
[0068]
In S320, the native code obtained by the compilation in S317 is also stored in the cache area 62 of the RAM 25-2, and the storage content of the hard disk device 26 and the storage content of the cache area 62 in which this native code is stored in S319 are stored. Match.
[0069]
Thereafter, the CPU 22 similarly updates the management list 42 of both the hard disk device 26 and the cache area 62, and stores the method name of the method definition compiled in S312 and the program source module 41 in which the method definition is described. The update date and time indicated in the management information of the program file is recorded in association with each other (S321), and then the process proceeds to S323.
[0070]
On the other hand, if the result of the determination process in S316 is Yes, the CPU 22 reads the native code that is the translation of the method definition extracted in the process shown in S312 from the cache area 62 of the RAM 25-2, and reads the read The native code is stored as a compiled execution module 44 in the work area of the RAM 25-2 (S322).
[0071]
The processing shown in S323 and S324 after S322 in FIG. 11 is exactly the same as the processing shown in S112 and S113 in the first example of the JIT compilation processing shown in the flowchart in FIG. Is omitted.
[0072]
In the second example described above, that is, a program execution device in which a native code that is a translation of a method definition that may be described by the program source module 41 is stored in advance in the hard disk device 26. As in the third example, it is possible to copy the storage contents of the hard disk device 26 to the RAM 25-2 and execute JIT compilation processing.
[0073]
It should be noted that the JIT compilation process described in each embodiment of the present invention described above can be performed by a general-purpose computer. For this purpose, a computer-readable recording medium (storage medium) that causes a computer to perform processing equivalent to the JIT compilation processing of FIG. 5, FIG. 8, or FIG. 11 described in each embodiment of the present invention. ), The control program read from the recording medium is read out, temporarily stored in the main memory of the computer, and then the program stored in the central processing unit of the computer is read out. What is necessary is just to comprise so that it may be made to execute.
[0074]
FIG. 12 shows an example of a recording medium that stores the above-described control program and that can be read by a computer. As such a recording medium, for example, a memory 72 such as a semiconductor memory or a hard disk device incorporated in or attached to the main body of the computer 71, a CD-ROM, a DVD-ROM, an MO (magneto-optical disk), a floppy disk, etc. There is a portable storage medium 73 or a storage device 76 of a program server 75 connected to the computer 71 via a line 74 and capable of downloading a program by the computer 71, and any of these may be used.
[0075]
【The invention's effect】
As described in detail above, the present invention uses a just-in-time compiler method to translate a source program into a machine language that can be directly executed on a platform of a specific arithmetic processing system and execute the machine language. The machine language, which is a translation of the source program, is stored for each function described in the source program in a storage unit that retains the stored contents even if the power supply voltage is lost, and is described in the source program. Whether or not the machine language that is a translation of the function being stored is stored in the storage unit, and depending on the determination result, the machine language obtained by translating the source program, or the storage unit One of the stored machine languages is directly executed on a platform of a specific processing system. With this configuration, when the same source program is executed again after the power is turned off, the source program can be executed without causing a time lag at the start of execution due to the program translation process. .
[0076]
Alternatively, according to the present invention, when a source program is translated into a machine language that can be directly executed on a platform of a specific arithmetic processing system by the just-in-time compiler method, the machine language is executed. For each function described in the source program, the machine language that is a translation is stored in association with the date and time when the source program before translation of the machine language was updated, and the date and time when the source program was updated A determination is made as to whether or not the update date and time associated with the stored machine language matches, and a machine language obtained by translating the source program according to the determination result, or stored One of the machine languages is directly executed on the platform of a specific arithmetic processing system. With this configuration, even if a change is made to the source program, the source program can be correctly executed in accordance with the change without causing a time lag at the start of execution due to the program translation process. .
[0077]
As described above, according to any of the configurations of the present invention, it is possible to improve the performance at the start of execution when the source program is executed using the JIT compiler.
[Brief description of the drawings]
FIG. 1 is a basic configuration diagram of the present invention.
FIG. 2 is a diagram showing an overall configuration of a program execution device for implementing the present invention.
FIG. 3 is a diagram showing an overall flow of translation / execution processing in the program execution apparatus for carrying out the present invention;
FIG. 4 is a table showing an example of a management list.
FIG. 5 is a flowchart showing the processing contents of a first example of JIT compilation processing.
FIG. 6 is a diagram showing storage contents of a hard disk device in a second example of a program execution device for carrying out the present invention.
FIG. 7 is a table showing an example of a management list in a second example of the program execution device.
FIG. 8 is a flowchart showing the processing contents of a second example of JIT compilation processing.
FIG. 9 is a diagram showing the contents stored in a RAM in a third example of the program execution device for carrying out the present invention.
FIG. 10 is a flowchart showing the contents of control processing of the entire apparatus in a third example of the program execution apparatus for carrying out the present invention.
11 is a flowchart showing the processing contents of the JIT compilation processing in FIG.
FIG. 12 is a diagram illustrating an example of a recording medium in which a stored control program can be read by a computer.
[Explanation of symbols]
1 Primitive program
10, 20 Program execution device
11 Storage means
12 Translation means
13 Memory control means
14 judgment means
15 Execution control means
16 Execution means
21 Input section
22 CPU
23 Output section
24 I / F section
25 Semiconductor memory
25-1 ROM
25-2 RAM
26 Hard disk devices
27 Bus
30 JIT compiler
31 Program load section
32 High-speed judgment unit
33 Compilation section
34 File loading section
35 Program execution part
41 Program source module
42 Management book
43 Compiled storage module
44 Compiled execution modules
51 Compiled standard modules
61 Work area
62 Cache Area
71 computer
72 memory
73 Portable storage media
74 lines
75 Program server
76 storage devices

Claims (6)

機械語を実行する実行手段を有し、ジャスト・イン・タイム・コンパイラ方式により、原始プログラムを該実行手段で直接実行可能な機械語に翻訳して実行するプログラム実行装置であって、
前記原始プログラムに記述される関数の翻訳であって前記実行手段で実行可能な機械語を該関数ごとに記憶し、該原始プログラムの実行終了後も記憶内容を保持する記憶手段と、
演算処理装置に所定の制御プログラムを実行させることによって、前記原始プログラムに記述されている関数を前記実行手段で実行可能な機械語に翻訳する翻訳手段と、
前記翻訳手段により翻訳された機械語を、該機械語の翻訳前の関数と該関数が記述されていた原始プログラムが更新された日時に対応付けて、前記記憶手段に記憶させる記憶制御手段と、
前記原始プログラムで用いられている関数の翻訳である機械語が前記記憶手段に記憶されており、且つ、該原始プログラムの更新された日時と記憶手段に記憶されている機械語に対応付けられている更新日時とが一致するか否か判定を、前記対応付けに基づいて該関数毎に行なう判定手段と、
前記判定手段による判定結果に応じて、前記翻訳手段の翻訳する機械語、または前記記憶手段に記憶されている機械語、のどちらかを前記関数の翻訳として選択し、選択された機械語を、前記原始プログラムで示されている該関数の実行順に即した順序で前記実行手段に直接実行させる実行制御手段と、
を有することを特徴とするプログラム実行装置。
A program execution device having execution means for executing a machine language, which translates and executes a source program into a machine language that can be directly executed by the execution means by a just-in-time compiler method;
A storage unit that stores a machine language that is a translation of a function described in the source program and that can be executed by the execution unit for each function, and that retains the storage content even after the execution of the source program is completed;
Translation means for translating a function described in the source program into a machine language executable by the execution means by causing the arithmetic processing unit to execute a predetermined control program ;
Storage control means for storing the machine language translated by the translation means in the storage means in association with the function before translation of the machine language and the date and time when the source program in which the function was described was updated ,
Wherein and machine language is stored in the storage means is a translation function that is used in the source program, and, the correspondence to the machine language stored in the updated date and time and the storage means of the source program Determination means for determining whether or not the update date and time being matched matches each function based on the association ;
Depending on the determination result by the determination means, either the machine language to be translated by the translation means or the machine language stored in the storage means is selected as the translation of the function, and the selected machine language is Execution control means for causing the execution means to directly execute in an order corresponding to the execution order of the functions indicated in the source program ;
A program execution device characterized by comprising:
前記記憶手段には、前記原始プログラムで用いられることのあり得る関数の翻訳である機械語が予め記憶されていることを特徴とする請求項1に記載のプログラム実行装置。  2. The program execution apparatus according to claim 1, wherein the storage unit stores in advance a machine language that is a translation of a function that can be used in the source program. 前記記憶手段の記憶内容を複写して記憶する半導体メモリを更に有し、
前記実行制御手段は、前記記憶手段に記憶されている機械語を前記実行手段に実行させる代わりに、前記半導体メモリに記憶されている、該記憶手段に記憶されている記憶内容の複写である機械語を該実行手段に実行させる、
ことを特徴とする請求項1に記載のプログラム実行装置。
A semiconductor memory for copying and storing the storage contents of the storage means;
Instead of causing the execution means to execute the machine language stored in the storage means, the execution control means is a machine that is a copy of the storage content stored in the storage means and stored in the semiconductor memory. Causing the execution means to execute a word;
The program execution device according to claim 1.
前記原始プログラムが格納されているプログラムファイルを読み込む読込手段を更に有し、
前記記憶制御手段は、前記プログラムファイルに示されている該プログラムファイルの更新日時を前記機械語に対応付ける該原始プログラムの更新された日時とみなして、前記記憶手段に該機械語を記憶させ、
前記判定手段は、前記プログラムファイルに示されている該プログラムファイルの更新日時と、前記機械語に対応させて前記記憶手段に記憶されている更新日時とが一致するか否かを判定する、
ことを特徴とする請求項に記載のプログラム実行装置。
A reading means for reading a program file in which the source program is stored;
The storage control means regards the update date and time of the program file indicated in the program file as the updated date and time of the source program associated with the machine language, and stores the machine language in the storage means,
The determination means determines whether or not the update date and time of the program file indicated in the program file and the update date and time stored in the storage means corresponding to the machine language match.
The program execution device according to claim 1 .
機械語を実行する演算処理装置を有し、ジャスト・イン・タイム・コンパイラ方式により、原始プログラムを該演算処理装置で直接実行可能な機械語に翻訳して該演算処理装置に実行させるプログラム実行方法であって、
演算処理装置に所定の制御プログラムを実行させることによって実現される翻訳手段が、前記原始プログラムに記述されている関数を前記演算処理装置で実行可能な機械語に翻訳し、
前記原始プログラムに記述される関数の翻訳であって前記演算処理装置で実行可能な機械語を関数ごとに記憶し、該原始プログラムの実行終了後も記憶内容を保持する記憶手段に、記憶制御手段が、前記翻訳手段により翻訳された機械語を、該機械語の翻訳前の関数と該関数が記述されていた原始プログラムが更新された日時に対応付けて記憶させ、
判定手段が、前記原始プログラムで用いられている関数の翻訳である機械語が前記記憶 手段に記憶されており、且つ、該原始プログラムの更新された日時と該記憶手段に記憶されている機械語に対応付けられている更新日時とが一致するか否かの判定を、前記対応付けに基づいて該関数毎に行ない、
実行制御手段が、前記判定手段による判定結果に応じて、前記翻訳手段の翻訳する機械語、または前記記憶手段に記憶されている機械語、のどちらかを前記関数の翻訳として選択し、選択された機械語を、前記原始プログラムで示されている該関数の実行順に即した順序で前記演算処理装置に直接実行させる、
ことを特徴とするプログラム実行方法。
A program execution method having an arithmetic processing unit for executing a machine language and translating a source program into a machine language that can be directly executed by the arithmetic processing unit by a just-in-time compiler method and executing the program on the arithmetic processing unit Because
Translation means realized by causing the arithmetic processing unit to execute a predetermined control program translates a function described in the source program into a machine language executable by the arithmetic processing unit,
A storage means for a machine language executed by the processing unit I Translation der of the function described in the source program stored in each said function, after execution of the raw starting programs for holding the stored contents, storage The control means stores the machine language translated by the translation means in association with the function before translation of the machine language and the date and time when the source program in which the function was described was updated ,
Judging means, wherein are machine language is stored in the storage means is a translation function that is used in the source program, and, the machine stored in the updated date and time and the storage means of the source program A determination as to whether or not the update date and time associated with the word matches is made for each function based on the association ,
The execution control means selects either the machine language translated by the translation means or the machine language stored in the storage means as the translation of the function according to the determination result by the determination means, and is selected. The machine language is directly executed by the arithmetic processing unit in an order corresponding to the execution order of the functions indicated in the source program .
A program execution method characterized by the above.
機械語を実行する演算処理装置を有し、ジャスト・イン・タイム・コンパイラ方式により、原始プログラムを該演算処理装置で直接実行可能な機械語に翻訳して実行するプログラム実行装置としてコンピュータを機能させるためのプログラムであって、
前記原始プログラムに記述される関数の翻訳であって前記演算処理装置で実行可能な機械語を関数ごとに記憶し、該原始プログラムの実行終了後も記憶内容を保持する記憶手段、
演算処理装置に所定の制御プログラムを実行させることによって、前記原始プログラムに記述されている関数を前記演算処理装置で実行可能な機械語に翻訳する翻訳手段、
前記翻訳手段により翻訳された機械語を、該機械語の翻訳前の関数と該関数が記述されていた原始プログラムが更新された日時に対応付けて、前記記憶手段に記憶させる記憶制御手段、
前記原始プログラムで用いられている関数の翻訳である機械語が前記記憶手段に記憶されており、且つ、該原始プログラムの更新された日時と該記憶手段に記憶されている機械語に対応付けられている更新日時とが一致するか否かの判定を、前記対応付けに基づいて該関数毎に行なう判定手段、及び
前記判定手段による判定結果に応じて、前記翻訳手段の翻訳する機械語、または前記記憶手段に記憶されている機械語、のどちらかを前記関数の翻訳として選択し、選択された機械語を、前記原始プログラムで示されている該関数の実行順に即した順序で前記演算処理装置に直接実行させる実行制御手段、
としてコンピュータを機能させるためのプログラム。
An arithmetic processing unit for executing machine language, the just-in-time compiler system, causes the computer to function as a program execution device that executes translate source program directly executable machine language by the processing unit A program for
Storage means for said machine language executed by the processing unit I Translation der of the function described in the source program stored in each said function, after the end run of the raw starting programs for holding the stored contents,
A translation means for translating a function described in the source program into a machine language executable by the arithmetic processing device by causing the arithmetic processing device to execute a predetermined control program;
The machine language translated by the translation means, in association with the date and time source program functions and the function number before the machine translation has been described has been updated, the storage control means for storing in said memory means,
Wherein and machine language is stored in the storage means is a translation function that is used in the source program, and, the correspondence to the machine language stored in the updated date and time and the storage means of the source program A determination unit that determines whether or not the update date and time being matched matches each function based on the association , and a machine language that the translation unit translates according to a determination result by the determination unit , Or the machine language stored in the storage means is selected as the translation of the function, and the selected machine language is selected in the order corresponding to the execution order of the function indicated in the source program. Execution control means for causing the processing apparatus to execute directly ,
As a program to make the computer function .
JP2001010875A 2000-01-21 2001-01-18 Program execution device, program execution method, recording medium, and control program Expired - Fee Related JP3889227B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001010875A JP3889227B2 (en) 2000-01-21 2001-01-18 Program execution device, program execution method, recording medium, and control program

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2000012599 2000-01-21
JP2000-12599 2000-01-21
JP2001010875A JP3889227B2 (en) 2000-01-21 2001-01-18 Program execution device, program execution method, recording medium, and control program

Publications (2)

Publication Number Publication Date
JP2001273151A JP2001273151A (en) 2001-10-05
JP3889227B2 true JP3889227B2 (en) 2007-03-07

Family

ID=26583909

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001010875A Expired - Fee Related JP3889227B2 (en) 2000-01-21 2001-01-18 Program execution device, program execution method, recording medium, and control program

Country Status (1)

Country Link
JP (1) JP3889227B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7506323B2 (en) 2002-06-18 2009-03-17 Panasonic Corporation Program execution processing terminal device, program execution processing method, and program
CN100346297C (en) * 2003-02-18 2007-10-31 株式会社爱可信 Native compile method, native compile preprocessing method, computer program, and server

Also Published As

Publication number Publication date
JP2001273151A (en) 2001-10-05

Similar Documents

Publication Publication Date Title
US5230049A (en) Program source code translator
US6907519B2 (en) Systems and methods for integrating emulated and native code
US5481708A (en) System and methods for optimizing object-oriented compilations
KR100503077B1 (en) A java execution device and a java execution method
JP2004280795A (en) Extreme pipeline and optimization/rearrangement technique
US7124407B1 (en) Method and apparatus for caching native code in a virtual machine interpreter
EP1049011A2 (en) Method and apparatus for handling exceptions as normal control flow
US20030033593A1 (en) Dynamic execution layer interface for explicitly or transparently executing application or system binaries
US7581216B2 (en) Preserving platform independence with native accelerators for performance critical program objects
US20030192035A1 (en) Systems and methods for implementing efficient execution transfers between successive translations of stack-based program code in a virtual machine environment
US7739674B2 (en) Method and apparatus for selectively optimizing interpreted language code
US20030110478A1 (en) Portable run-time code synthesis in a caching dynamic translator
US20010042241A1 (en) Apparatus and method for executing program using just-in time-compiler system
US6128590A (en) Method for the migration of hardware-proximate, subprogram-independent programs with portable and non-portable program parts
US5150474A (en) Method for transferring arguments between object programs by switching address modes according to mode identifying flag
JPH06309204A (en) Method and device for data processing
JP3889227B2 (en) Program execution device, program execution method, recording medium, and control program
EP1438644A2 (en) Method for fast compilation of preverified java bytecode to high quality native machine code
US20080077912A1 (en) Software development methods, systems, and storage media storing software developed thereby
AU2022226485A1 (en) Hybrid just in time load module compiler with performance optimizations
US6954926B1 (en) Label address translating device
US20240231864A9 (en) Hybrid just in time load module compiler with performance optimizations
JPH11212807A (en) Program execution method
JP3424596B2 (en) Method and apparatus for caching symbol reference information
CN116931947A (en) Method for optimizing wasm byte code, execution method, computer equipment and storage medium

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060829

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061025

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20061128

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061129

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091208

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101208

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111208

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111208

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121208

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121208

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131208

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees