view slides/2018/05/14/zip.txt @ 52:73b27e5c1d79 default tip

auto-Update generated slides by script
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Tue, 16 Apr 2019 18:58:24 +0900
parents 8c7be076e6e6
children
line wrap: on
line source

2018-05-08----
今日の進捗

- MoarVMの資料を読み解く
- CbCで実装するべき場所を考察する

----------
2018-05-14----
今日の進捗

# 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));
  }
```



----------