L-Closure:高性能・高信頼プログラミング言語の実装向け言語機構

Bibliographic Information

Other Title
  • L Closure コウセイノウ コウシンライ プログラミング ゲンゴ ノ ジッソウ ムケ ゲンゴ キコウ
  • L-Closures: A Language Mechanism for Implementing Efficient and Safe Programming Languages

Search this article

Abstract

本研究では,実行中のプログラムがその実行スタックの内容を合法的に見たり変更したりするための“L-closure” という新しい言語機構を提案する.L-closureは入れ子関数定義を評価すると生成される軽量lexical closureであり,lexical closureは生成時環境におけるlexicalスコープの変数にアクセスできるため,その間接的な呼び出しにより合法的なスタックアクセスの手段を提供する.L-closureが追加された中間言語を高水準コンパイラで採用することにより,ごみ集め,チェックポインティング,マルチスレッディングや負荷分散といった高水準サービスがすっきりと効率良く実装可能となる.L-closureがアクセスする各変数では,共有のための場所のほかに,レジスタ割当て候補として私用の場所も用いる.共有の場所との値の一致をとるための処理や,L-closureの初期化処理は実際にL-closureが呼び出されるまで遅延される.多くの高水準サービスはL-closureを頻繁に生成するもののめったに(たとえばごみ集めにおけるルートスキャンのために)呼び出さないので,総合的なオーバヘッドは大幅に削減可能となる.GNU C コンパイラ(GCC)は入れ子関数をもともとサポートしており,L-closureを実装するためのGCCの拡張は比較的低コストで可能であった.本論文ではその実装の詳細を述べる.また,L-closureの低い生成・維持コストを示す評価結果について,変換ベースL-closure実装についての追加評価結果とともに述べる.

We propose a new language mechanism called “L-closures” for a running program to legitimately inspect/modify the contents of its execution stack. L-closures are lightweight lexical closures created by evaluating nested function definitions. A lexical closure can access the lexically-scoped variables in the creation-time environment and indirect calls to it provide legitimate stack access. By using an intermediate language extended with L-closures in high-level compilers, we can implement high-level services such as garbage collection, checkpointing,multithreading and load balancing elegantly and efficiently. Each variable accessed by an L-closure uses a private location as a register allocation candidate other than a shared location. Operations to keep coherency with shared locations as well as operations to initialize L-closures are delayed until an L-closure is actually invoked. Because most high-level services create L-closures very frequently but call them infrequently (e.g., to scan roots in garbage collection), the total overhead can be reduced significantly. Since the GNU C compiler provides nested functions, we enhanced GCC at relatively low implementation costs. We present the implementation details. We also present the results of performance measurements which exhibit quite low costs of creating and maintaining L-closures, with additional experimental results on our transformation-based implementation of L-closures.

Journal

Citations (1)*help

See more

References(27)*help

See more

Related Projects

See more

Details 詳細情報について

Report a problem

Back to top