---
title: 自分の仮想機械を作る
tags:  #omotesandorb #rubykaigi2026  
author: [Saeki Mototsune](https://image.docswell.com/user/daily_mototsune)
site: [Docswell](https://www.docswell.com/)
thumbnail: https://bcdn.docswell.com/page/4JQYD55L7P.jpg?width=480
description: @Omotesando.rb #121 MEDLEY × mov RubyKaigi事後勉強会との共同開催
published: May 14, 26
canonical: https://image.docswell.com/s/daily_mototsune/5R8G4N-2026-05-14-201403
---
# Page. 1

![Page Image](https://bcdn.docswell.com/page/4JQYD55L7P.jpg)

自分の仮想機械を作る
@Omotesando.rb #121
MEDLEY × mov RubyKaigi事後勉強会との共同開催


# Page. 2

![Page Image](https://bcdn.docswell.com/page/K74WZ995E1.jpg)

もとつねの日常
@daily_mototsune
Ruby on Railsを中心に扱っているフリーランスエンジニア
ドメインモデリングからAWSでの運用、スクラム運営やチームビルディ
ングなどなど楽しくやらせてもらってます
普段はOmotesando.rbやGinza.rbによくいます
🍷♨✈🏎


# Page. 3

![Page Image](https://bcdn.docswell.com/page/LJ1YRKK2EG.jpg)

RubyKaigi楽しかったですね


# Page. 4

![Page Image](https://bcdn.docswell.com/page/GJWG1DD272.jpg)

お気に入りのセッションは
なんでしたか？


# Page. 5

![Page Image](https://bcdn.docswell.com/page/4EZLPGG473.jpg)

私はVM話が好物でした


# Page. 6

![Page Image](https://bcdn.docswell.com/page/Y76WMYYG7V.jpg)

and more!


# Page. 7

![Page Image](https://bcdn.docswell.com/page/G75MZGGX74.jpg)

mruby in the 8-bit world:
mruby VM for Zilog Z80
「Build your own VM」


# Page. 8

![Page Image](https://bcdn.docswell.com/page/9J29RYYQER.jpg)

は？


# Page. 9

![Page Image](https://bcdn.docswell.com/page/DEY4DGGYJM.jpg)

作るかー


# Page. 10

![Page Image](https://bcdn.docswell.com/page/VJNY6GGR78.jpg)

そもそもVMとは
-
Virtual Machine（仮想機械）
ユーザーが書いたコードを元にバイトコードが生成され、VMがバイトコードを
読んで実行する
Rubyでは1.9からYARVというスタックVMが採用されている
それ以前はtree-walking interpreter


# Page. 11

![Page Image](https://bcdn.docswell.com/page/YE9PLWWZJ3.jpg)

バイトコードを見てみる


# Page. 12

![Page Image](https://bcdn.docswell.com/page/GE8DXNRYED.jpg)

1


# Page. 13

![Page Image](https://bcdn.docswell.com/page/LELM8PK97R.jpg)

2
1


# Page. 14

![Page Image](https://bcdn.docswell.com/page/4JMY642VJW.jpg)

3
2
1


# Page. 15

![Page Image](https://bcdn.docswell.com/page/PJR9PWMW79.jpg)

2
1
.*(
3
)


# Page. 16

![Page Image](https://bcdn.docswell.com/page/PEXQ3PVVJX.jpg)

6
1


# Page. 17

![Page Image](https://bcdn.docswell.com/page/3EK9YDQ5ED.jpg)

6
1


# Page. 18

![Page Image](https://bcdn.docswell.com/page/L73W9RP175.jpg)

1
.+(
6
)


# Page. 19

![Page Image](https://bcdn.docswell.com/page/87DKGYLKJG.jpg)

7


# Page. 20

![Page Image](https://bcdn.docswell.com/page/VJPK3623E8.jpg)

なんかいけそうな気がしてきた


# Page. 21

![Page Image](https://bcdn.docswell.com/page/2EVV43DNEQ.jpg)

RubyVM::INSTRUCTION_NAMES
[&quot;nop&quot;,
&quot;getlocal&quot;,
&quot;setlocal&quot;,
&quot;getblockparam&quot;,
&quot;setblockparam&quot;,
&quot;getblockparamproxy&quot;,
&quot;getspecial&quot;,
&quot;setspecial&quot;,
&quot;getinstancevariable&quot;,
&quot;setinstancevariable&quot;,
&quot;getclassvariable&quot;,
&quot;setclassvariable&quot;,
&quot;opt_getconstant_path&quot;,
&quot;getconstant&quot;,
&quot;setconstant&quot;,
&quot;getglobal&quot;,
&quot;setglobal&quot;,
&quot;putnil&quot;,
&quot;putself&quot;,
&quot;putobject&quot;,
&quot;putspecialobject&quot;,
&quot;putstring&quot;,
&quot;putchilledstring&quot;,
&quot;concatstrings&quot;,
&quot;anytostring&quot;,
&quot;toregexp&quot;,
&quot;intern&quot;,
&quot;newarray&quot;,
&quot;pushtoarraykwsplat&quot;,
&quot;duparray&quot;,
&quot;duphash&quot;,
&quot;expandarray&quot;,
&quot;concatarray&quot;,
&quot;concattoarray&quot;,
&quot;pushtoarray&quot;,
&quot;splatarray&quot;,
&quot;splatkw&quot;,
&quot;newhash&quot;,
&quot;newrange&quot;,
&quot;pop&quot;,
&quot;dup&quot;,
&quot;dupn&quot;,
&quot;swap&quot;,
&quot;opt_reverse&quot;,
&quot;topn&quot;,
&quot;setn&quot;,
&quot;adjuststack&quot;,
&quot;defined&quot;,
&quot;definedivar&quot;,
&quot;checkmatch&quot;,
&quot;checkkeyword&quot;,
&quot;checktype&quot;,
&quot;defineclass&quot;,
&quot;definemethod&quot;,
&quot;definesmethod&quot;,
&quot;send&quot;,
&quot;sendforward&quot;,
&quot;opt_send_without_block&quot;,
&quot;opt_new&quot;,
&quot;objtostring&quot;,
&quot;opt_ary_freeze&quot;,
&quot;opt_hash_freeze&quot;,
&quot;opt_str_freeze&quot;,
&quot;opt_nil_p&quot;,
&quot;opt_str_uminus&quot;,
&quot;opt_duparray_send&quot;,
&quot;opt_newarray_send&quot;,
&quot;invokesuper&quot;,
&quot;invokesuperforward&quot;,
&quot;invokeblock&quot;,
&quot;leave&quot;,
&quot;throw&quot;,
&quot;jump&quot;,
&quot;branchif&quot;,
&quot;branchunless&quot;,
&quot;branchnil&quot;,
&quot;once&quot;,
&quot;opt_case_dispatch&quot;,
&quot;opt_plus&quot;,
&quot;opt_minus&quot;,
&quot;opt_mult&quot;,
&quot;opt_div&quot;,
&quot;opt_mod&quot;,
&quot;opt_eq&quot;,
&quot;opt_neq&quot;,
&quot;opt_lt&quot;,
&quot;opt_le&quot;,
&quot;opt_gt&quot;,
&quot;opt_ge&quot;,
&quot;opt_ltlt&quot;,
&quot;opt_and&quot;,
&quot;opt_or&quot;,
&quot;opt_aref&quot;,


# Page. 22

![Page Image](https://bcdn.docswell.com/page/57GL13Y5EL.jpg)

なんかいけなさそうな
気がしてきた


# Page. 23

![Page Image](https://bcdn.docswell.com/page/4EQYD5MLJP.jpg)

RubyVM::INSTRUCTION_NAMES
[&quot;nop&quot;,
&quot;getlocal&quot;,
&quot;setlocal&quot;,
&quot;getblockparam&quot;,
&quot;setblockparam&quot;,
&quot;getblockparamproxy&quot;,
&quot;getspecial&quot;,
&quot;setspecial&quot;,
&quot;getinstancevariable&quot;,
&quot;setinstancevariable&quot;,
&quot;getclassvariable&quot;,
&quot;setclassvariable&quot;,
&quot;opt_getconstant_path&quot;,
&quot;getconstant&quot;,
&quot;setconstant&quot;,
&quot;getglobal&quot;,
&quot;setglobal&quot;,
&quot;putnil&quot;,
&quot;putself&quot;,
&quot;putobject&quot;,
&quot;putspecialobject&quot;,
&quot;putstring&quot;,
&quot;putchilledstring&quot;,
&quot;concatstrings&quot;,
&quot;anytostring&quot;,
&quot;toregexp&quot;,
&quot;intern&quot;,
&quot;newarray&quot;,
&quot;pushtoarraykwsplat&quot;,
&quot;duparray&quot;,
&quot;duphash&quot;,
&quot;expandarray&quot;,
&quot;concatarray&quot;,
&quot;concattoarray&quot;,
&quot;pushtoarray&quot;,
&quot;splatarray&quot;,
&quot;splatkw&quot;,
&quot;newhash&quot;,
&quot;newrange&quot;,
&quot;pop&quot;,
&quot;dup&quot;,
&quot;dupn&quot;,
&quot;swap&quot;,
&quot;opt_reverse&quot;,
&quot;topn&quot;,
&quot;setn&quot;,
&quot;adjuststack&quot;,
&quot;defined&quot;,
&quot;definedivar&quot;,
&quot;checkmatch&quot;,
&quot;checkkeyword&quot;,
&quot;checktype&quot;,
&quot;defineclass&quot;,
&quot;definemethod&quot;,
&quot;definesmethod&quot;,
&quot;send&quot;,
&quot;sendforward&quot;,
&quot;opt_send_without_block&quot;,
&quot;opt_new&quot;,
&quot;objtostring&quot;,
&quot;opt_ary_freeze&quot;,
&quot;opt_hash_freeze&quot;,
&quot;opt_str_freeze&quot;,
&quot;opt_nil_p&quot;,
&quot;opt_str_uminus&quot;,
&quot;opt_duparray_send&quot;,
&quot;opt_newarray_send&quot;,
&quot;invokesuper&quot;,
&quot;invokesuperforward&quot;,
&quot;invokeblock&quot;,
&quot;leave&quot;,
&quot;throw&quot;,
&quot;jump&quot;,
&quot;branchif&quot;,
&quot;branchunless&quot;,
&quot;branchnil&quot;,
&quot;once&quot;,
&quot;opt_case_dispatch&quot;,
&quot;opt_plus&quot;,
&quot;opt_minus&quot;,
&quot;opt_mult&quot;,
&quot;opt_div&quot;,
&quot;opt_mod&quot;,
&quot;opt_eq&quot;,
&quot;opt_neq&quot;,
&quot;opt_lt&quot;,
&quot;opt_le&quot;,
&quot;opt_gt&quot;,
&quot;opt_ge&quot;,
&quot;opt_ltlt&quot;,
&quot;opt_and&quot;,
&quot;opt_or&quot;,
&quot;opt_aref&quot;,


# Page. 24

![Page Image](https://bcdn.docswell.com/page/KJ4WZ9V571.jpg)

とりあえず小さな一歩を


# Page. 25

![Page Image](https://bcdn.docswell.com/page/LE1YRK327G.jpg)



# Page. 26

![Page Image](https://bcdn.docswell.com/page/GEWG1DP2J2.jpg)



# Page. 27

![Page Image](https://bcdn.docswell.com/page/47ZLPGK4J3.jpg)



# Page. 28

![Page Image](https://bcdn.docswell.com/page/YJ6WMYQGJV.jpg)

「Build your own VM」


# Page. 29

![Page Image](https://bcdn.docswell.com/page/GJ5MZGRXJ4.jpg)

https://blog.youchan-apps.net/2026-04-17


