comparison 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
comparison
equal deleted inserted replaced
43:fc5259b6167e 44:8c7be076e6e6
1 今日の進捗 1 今日の進捗
2 2
3 # MoarVMのJIT
4 * [Docs](https://github.com/MoarVM/MoarVM/tree/master/docs)を見る
3 5
6 # Lego
7 * MoarMVのJITはLegoと呼ばれているらしい
8
9 # DynASM
10 * Dynamic Assemler
11 * http://luajit.org/dynasm.html
12 * [luajit](http://luajit.org/)プロジェクトで作られているもの
13 * MoarVMには `3rdparty`ディレクトリ以下に展開されている
14 * x86アーキテクチャのJITコンパイル用のアセンブラのようなものらしい
15 * luaが`dasc`と呼ばれるCに近いアセンブラをCを出力する前に実行
16 * Cのヘッダーの `#include` している部分を機械語にランタイムで翻訳
17 * [GitHubのcommit](https://github.com/MoarVM/MoarVM/commit/372d0582ab90d4ddfc43553bbebe4e553a42278d)
18
19 # DynASM
20
21
22 - To get you started, here is a simple code snippet to be pre-processed. The lines starting with '|' (the pipe symbol) are for DynASM:
23
24 ```
25 if (ptr != NULL) {
26 | mov eax, foo+17
27 | mov edx, [eax+esi*2+0x20]
28 | add ebx, [ecx+bar(ptr, 9)]
29 }
30 ```
31
32 - After pre-processing you get:
33
34 ```
35 if (ptr != NULL) {
36 dasm_put(Dst, 123, foo+17, bar(ptr, 9));
37 }
38 ```
39
40