Mercurial > hg > Members > anatofuz > slides
diff slides/2018/05/14/memo.txt @ 44:8c7be076e6e6
auto-Update generated slides by script
author | Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 15 May 2018 19:22:22 +0900 |
parents | fc5259b6167e |
children |
line wrap: on
line diff
--- a/slides/2018/05/14/memo.txt Mon May 14 15:36:32 2018 +0900 +++ b/slides/2018/05/14/memo.txt Tue May 15 19:22:22 2018 +0900 @@ -1,3 +1,40 @@ 今日の進捗 +# MoarVMのJIT +* [Docs](https://github.com/MoarVM/MoarVM/tree/master/docs)を見る +# Lego +* MoarMVのJITはLegoと呼ばれているらしい + +# DynASM +* Dynamic Assemler + * http://luajit.org/dynasm.html +* [luajit](http://luajit.org/)プロジェクトで作られているもの +* MoarVMには `3rdparty`ディレクトリ以下に展開されている +* x86アーキテクチャのJITコンパイル用のアセンブラのようなものらしい + * luaが`dasc`と呼ばれるCに近いアセンブラをCを出力する前に実行 + * Cのヘッダーの `#include` している部分を機械語にランタイムで翻訳 +* [GitHubのcommit](https://github.com/MoarVM/MoarVM/commit/372d0582ab90d4ddfc43553bbebe4e553a42278d) + +# DynASM + + +- To get you started, here is a simple code snippet to be pre-processed. The lines starting with '|' (the pipe symbol) are for DynASM: + +``` + if (ptr != NULL) { + | mov eax, foo+17 + | mov edx, [eax+esi*2+0x20] + | add ebx, [ecx+bar(ptr, 9)] + } +``` + +- After pre-processing you get: + +``` + if (ptr != NULL) { + dasm_put(Dst, 123, foo+17, bar(ptr, 9)); + } +``` + +