コード書換えによる動的メソッド呼び出しの直接Devirtualization  [in Japanese] A Direct Devirtualization Technique with the Code Patching Mechanism  [in Japanese]

Access this Article

Search this Article

Author(s)

Abstract

本発表では,Java などの動的クラスロードをともなう言語において,実装が容易な動的メソッド呼び出しの直接devirtualization 手法を提案する.本手法では,コンパイル時に動的メソッド呼び出しに対して直接devirtualization されたコードとメソッドがオーバライドされた場合に実行する動的メソッド呼び出し,の2 種類のコードを生成する.最初は前者を実行し,オーバライドが起きたときにコードを書き換えて後者を実行する.本手法では,コード書換えによって直接devirtualization されたコードを無効化するので,脱最適化のような再コンパイルのための複雑な実装が不要である.一方,再コンパイルを不要にするためにコンパイル時に2 種類のコードを用意するので,制御フロー上に合流点が生成される.一般に制御フローの合流点はコンパイラの最適化を妨げるが,本発表では合流点が存在しても十分な最適化を可能にする手法を示す.さらに,本手法と他のdevirtualization 手法を組み合わせてJava のJust-In-Time コンパイラに実装し,評価を行った.その結果,devirtualizationを行わない場合に比べ,SPECjvm98 とSPECjbb2000 において0 ?181%(平均24%)性能を改善できることを示す.This presentation presents a direct devirtualization technique for a language such as Java with dynamic class loading.The implementation of this technique is easy.For a given dynamic method call,a compiler generates the inlined code of the method,together with the code of making the dynamic call.Only the inlined code is actually executed until our assumption about the devirtualizationbecomes invalidated,at which time the compiler performs code patching to make the code of dynamic call executed subsequently.This technique does not require the complicated implementation such as deoptimization to recompile the method that is active on stack.Since this technique prevents some optimizations across the merge point between the inlined code and the dynamic call,we have further more proposed optimization techniques effectively.We made some experiments to understand the effectiveness and characteristics of the devirtualization techniques in our Java Just-In-Time compiler.In summary, we improved the execution performance of SPECjvm98 and SPECjbb2000 by ranging from 0%to 181%(with the geometric mean of 24%).

This presentation presents a direct devirtualization technique for a language such as Java with dynamic class loading. The implementation of this technique is easy. For a given dynamic method call, a compiler generates the inlined code of the method, together with the code of making the dynamic call. Only the inlined code is actually executed until our assumption about the devirtualization becomes invalidated, at which time the compiler performs code patching to make the code of dynamic call executed subsequently. This technique does not require the complicated implementation such as deoptimization to recompile the method that is active on stack. Since this technique prevents some optimizations across the merge point between the inlined code and the dynamic call, we have further more proposed optimization techniques effectively. We made some experiments to understand the effectiveness and characteristics of the devirtualization techniques in our Java Just-In-Time compiler. In summary, we improved the execution performance of SPECjvm98 and SPECjbb2000 by ranging from 0% to 181% (with the geometric mean of 24%).

Journal

  • 情報処理学会論文誌プログラミング(PRO)

    情報処理学会論文誌プログラミング(PRO) 43(SIG08(PRO15)), 110-110, 2002-09-15

    Information Processing Society of Japan (IPSJ)

Codes

  • NII Article ID (NAID)
    110002726556
  • NII NACSIS-CAT ID (NCID)
    AA11464814
  • Text Lang
    JPN
  • Article Type
    Article
  • ISSN
    1882-7802
  • Data Source
    CJP  NII-ELS  IPSJ 
Page Top