annotate Slide/prosym.html @ 16:b802c7ffb249

add Slide
author mir3636
date Wed, 17 Jan 2018 13:26:35 +0900
parents
children 016ee461da2a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
1 <!DOCTYPE html>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
2 <html>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
3 <head>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
4 <meta http-equiv="content-type" content="text/html;charset=utf-8">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
5 <title>Code Gear と Data Gear を持つ Gears OS の設計</title>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
6
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
7 <meta name="generator" content="Slide Show (S9) v2.5.0 on Ruby 2.4.0 (2016-12-24) [x86_64-darwin16]">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
8 <meta name="author" content="Mitsuki Miyagi, Shinji Kono" >
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
9
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
10 <!-- style sheet links -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
11 <link rel="stylesheet" href="s6/themes/projection.css" media="screen,projection">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
12 <link rel="stylesheet" href="s6/themes/screen.css" media="screen">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
13 <link rel="stylesheet" href="s6/themes/print.css" media="print">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
14 <link rel="stylesheet" href="s6/themes/blank.css" media="screen,projection">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
15
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
16 <!-- JS -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
17 <script src="s6/js/jquery-1.11.3.min.js"></script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
18 <script src="s6/js/jquery.slideshow.js"></script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
19 <script src="s6/js/jquery.slideshow.counter.js"></script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
20 <script src="s6/js/jquery.slideshow.controls.js"></script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
21 <script src="s6/js/jquery.slideshow.footer.js"></script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
22 <script src="s6/js/jquery.slideshow.autoplay.js"></script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
23
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
24 <!-- prettify -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
25 <link rel="stylesheet" href="scripts/prettify.css">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
26 <script src="scripts/prettify.js"></script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
27
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
28 <script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
29 $(document).ready( function() {
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
30 Slideshow.init();
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
31
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
32 $('code').each(function(_, el) {
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
33 if (!el.classList.contains('noprettyprint')) {
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
34 el.classList.add('prettyprint');
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
35 }
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
36 });
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
37 prettyPrint();
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
38 } );
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
39
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
40
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
41 </script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
42
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
43 <!-- Better Browser Banner for Microsoft Internet Explorer (IE) -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
44 <!--[if IE]>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
45 <script src="s6/js/jquery.microsoft.js"></script>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
46 <![endif]-->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
47
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
48
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
49
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
50 </head>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
51 <body>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
52
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
53 <div class="layout">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
54 <div id="header"></div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
55 <div id="footer">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
56 <div align="right">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
57 <img src="s6/images/logo.svg" width="200px">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
58 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
59 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
60 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
61
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
62 <div class="presentation">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
63
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
64 <div class='slide cover'>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
65 <table width="90%" height="90%" border="0" align="center">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
66 <tr>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
67 <td>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
68 <div align="center">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
69 <h1><font color="#808db5">Code Gear と Data Gear を持つ Gears OS の設計</font></h1>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
70 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
71 </td>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
72 </tr>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
73 <tr>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
74 <td>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
75 <div align="left">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
76 Mitsuki Miyagi, Shinji Kono
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
77 琉球大学
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
78 <hr style="color:#ffcc00;background-color:#ffcc00;text-align:left;border:none;width:100%;height:0.2em;">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
79 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
80 </td>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
81 </tr>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
82 </table>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
83 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
84
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
85 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
86 <!-- === begin markdown block ===
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
87
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
88 generated by markdown/1.2.0 on Ruby 2.4.0 (2016-12-24) [x86_64-darwin16]
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
89 on 2018-01-16 18:50:54 +0900 with Markdown engine kramdown (1.13.2)
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
90 using options {}
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
91 -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
92
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
93 <!-- _S9SLIDE_ -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
94 <h1 id="os-">OS の拡張性と信頼性の両立</h1>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
95
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
96 <p>さまざまなコンピュータの信頼性の基本はメモリなどの資源管理を行う OS である。
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
97 時代とともに進歩するハードウェア、サービスに対応して OS 自体が拡張される必要がある。
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
98 その信頼性を保証するには、従来の テストとデバッグでは不十分であり、テストしきれない部分が残ってしまう。
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
99 これに対処するため には、証明を用いる方法とプログラムの可能な実行をすべて数え上げるモデル検査を用いる方法がある。
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
100 検証は一度ですむものではなく、アプリケーションやサービス、デバイスが新しくなることに検証をやり直す必要がある。
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
101 このため信頼性と拡張性を両立させることが重要である。
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
102 &lt;!–プログラムからデータを分離して扱うデータベースには、
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
103 プログラム中のデータ構造とRDBの表構造のずれにより、<u>インピーダンスミスマッチ</u>という問題がある。</p>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
104
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
105 <p>データベースのレコードをプログラム中のオブジェクトとして使える<u>OR Mapper</u>や、
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
106 データベース自体も、表に特化したKey Value Storeや、Jsonなどの不定形のデータ構造を格納するように機能拡張されてきている。</p>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
107
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
108 <p>しかし、プログラム中のデータは複雑な構造をメモリ上に構築しており、これらの方法でもまだギャップがある。–&gt;</p>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
109
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
110
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
111 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
112 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
113 <!-- _S9SLIDE_ -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
114 <h1 id="section">メタ計算の重要性</h1>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
115 <ul lang="Code_Gear">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
116 <li>プログラムを記述する際、ノーマルな処理の他に、メモリ管理やスレッド管理、CPU や GPU の資源管理等、記述しなければならない処理が存在する。これらの計算をメタ計算と呼ぶ。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
117 <li>メタ計算はノーマルな計算から切り離して記述したい。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
118 <li>そのためには処理を細かく分割する必要があるが、関数やクラスなどの単位は容易に分割できない。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
119 <li>そこで当研究室ではメタ計算を柔軟に記述するためのプログラミング言語の単位として Code Gear、Data Gear という単位を提案している。
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
120 # Continuation based C (CbC)</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
121 <li>Continuation based C (CbC) はこの Code Gear 単位を用いたプログラミング言語として開発している。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
122 <li>CbC では Code Gear は __code という型を持つ関数の構文で定義される。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
123 <li>Code Gear は戻り値を持たないので、関数とは異なり return 文は存在しない。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
124 <li>goto の後に Code Gear 名と引数を並べて、次の Code Gear の遷移を記述する。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
125 <li>この goto の行き先を継続と呼び、このときの a+b が次の Code Gear への出力となる。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
126 </ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
127 <pre><code>__code cs0(int a, int b){
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
128 goto cs1(a+b);
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
129 }
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
130
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
131 __code cs1(int c){
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
132 goto cs2(c);
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
133 }
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
134 </code></pre>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
135 <p># Gears OS
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
136 - Gears OS は Code Gear、 Data Gear の単位を用いて開発されており、CbC で記述されている。
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
137 - 並列実行するための Task を、実行する Code Gear 、実行に必要な Input Data Gear 、Output Data Gear の組で表現する。
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
138 - またGears OS ではメタ計算を Meta Code Gear、Meta Data Gear で表現する。
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
139 - Meta Code Gear はノーマルの Code Gear の直後に遷移され、メタ計算を実行する。
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
140 - Meta Code Gear で OS の機能であるメモリ管理やスレッド管理を行う。</p>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
141
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
142
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
143 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
144 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
145 <!-- _S9SLIDE_ -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
146 <h1 id="gears-os-">Gears OS の構成</h1>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
147
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
148
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
149 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
150 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
151 <!-- _S9SLIDE_ -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
152 <h1 id="cbc--gears-os-">CbC による Gears OS 記述の問題点</h1>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
153 <ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
154 <li>Gears OS を CbC で実装する上でメタ計算の記述が煩雑であることがわかった。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
155 <li>本研究ではこれらのメタ計算を自動生成することにより Gears OS を記述する上においてより良い構文をユーザーに提供することにした。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
156 <li>そのためのプロトタイプとして perl スクリプトを作成した。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
157 </ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
158
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
159
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
160 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
161 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
162 <!-- _S9SLIDE_ -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
163 <h1 id="context">Context</h1>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
164 <ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
165 <li>Gears OS には Context と呼ばれる接続可能な Code Gear、Data Gear のリスト、Temporal Data Gear のためのメモリ空間等を持っている Meta Data Gear がある。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
166 <li>Gears OSは必要なCode Gear、Data Gearに参照したい場合、このContext を通す必要がある。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
167 </ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
168
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
169 <p><img src="./fig/context.svg" alt="message" width="550" /></p>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
170
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
171
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
172 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
173 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
174 <!-- _S9SLIDE_ -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
175 <h1 id="interface">Interface</h1>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
176 <ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
177 <li>interface を記述することでデータ構造のapiと Data Gear を結びつけることが出来、呼び出しが容易になった。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
178 <li>create は関数呼び出しで呼び出され、interface と impliment の初期化と Code Gear のポインタの設定を行う。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
179 </ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
180
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
181 <pre lang="impl"><code>Stack* createSingleLinkedStack(struct Context* context) {
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
182 struct Stack* stack = new Stack();
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
183 struct SingleLinkedStack* singleLinkedStack = new SingleLinkedStack();
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
184 stack-&gt;stack = (union Data*)singleLinkedStack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
185 singleLinkedStack-&gt;top = NULL;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
186 stack-&gt;push = C_pushSingleLinkedStack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
187 stack-&gt;pop = C_popSingleLinkedStack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
188 stack-&gt;pop2 = C_pop2SingleLinkedStack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
189 stack-&gt;get = C_getSingleLinkedStack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
190 stack-&gt;get2 = C_get2SingleLinkedStack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
191 stack-&gt;isEmpty = C_isEmptySingleLinkedStack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
192 stack-&gt;clear = C_clearSingleLinkedStack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
193 return stack;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
194 }
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
195 </code></pre>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
196 <!--
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
197
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
198 <div style="text-align: center;">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
199  <img src="./images/multiComponent.pdf" alt="message" width="600">
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
200 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
201
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
202 -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
203
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
204
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
205 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
206 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
207 <!-- _S9SLIDE_ -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
208 <h1 id="contextstub-code-gear-">Context、stub Code Gear の自動生成</h1>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
209 <ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
210 <li>Gears OS ではノーマルレベルの計算の他に Context や stub などのメタ計算を記述する必要がある。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
211 <li>現在の CbC で Gears OS を記述すると、このメタ計算の記述も行わなくてはならず、これには多くの労力を要する。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
212 <li>この記述を助けるために Context を生成する generate_context と stub Code Gear を生成する generate_stub を perl スクリプトで作成した。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
213 </ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
214
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
215
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
216 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
217 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
218 <!-- _S9SLIDE_ -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
219 <h1 id="meta-">Meta の生成</h1>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
220
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
221 <ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
222 <li>Code Gear が必要とする Data Gear を取り出す際に Context を通す必要がある。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
223 <li>しかし、メタであるContext をノーマルレベルの Code Gear から直接アクセスするのはよろしくない。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
224 <li>そこで Context から必要なデータを取り出して Code Gear に接続する、メタレベルの stub Code Gear を定義し、これを介して間接的に必要な Data Gear にアクセスする。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
225 </ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
226
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
227 <pre lang="stub"><code>__code clearSingleLinkedStack(struct Context *context,struct SingleLinkedStack* stack,enum Code next) {
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
228 stack-&gt;top = NULL;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
229 goto meta(context, next);
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
230 }
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
231
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
232 __code clearSingleLinkedStack_stub(struct Context* context) {
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
233 SingleLinkedStack* stack = (SingleLinkedStack*)GearImpl(context, Stack, stack);
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
234 enum Code next = Gearef(context, Stack)-&gt;next;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
235 goto clearSingleLinkedStack(context, stack, next);
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
236 }
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
237 </code></pre>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
238
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
239
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
240 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
241 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
242 <!-- _S9SLIDE_ -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
243 <h1 id="stub-code-gear-">stub Code Gear の生成</h1>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
244 <ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
245 <li>stub Code Gear は Code Gear 間の継続に挟まれ、Code Gear が必要な Data Gear を Context から取り出す処理を行うものである。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
246 <li>stub Code Gear は Code Gear 毎に記述する必要があり、そのCode Gear の引数を見て取り出す Data Gear を選択する。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
247 <li>generate_stub は指定された cbc ファイルの __code型である Code Gear を取得。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
248 <li>引数と interface を照らし合わせ、Gearef または GearImpl を決定する。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
249 <li>cbc ファイルのから、生成した stub Code Gear を加えて、c ファイルを生成する。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
250 </ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
251
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
252 <pre lang="stub"><code>__code clearSingleLinkedStack(struct Context *context,struct SingleLinkedStack* stack,enum Code next) {
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
253 stack-&gt;top = NULL;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
254 goto meta(context, next);
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
255 }
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
256
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
257 __code clearSingleLinkedStack_stub(struct Context* context) {
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
258 SingleLinkedStack* stack = (SingleLinkedStack*)GearImpl(context, Stack, stack);
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
259 enum Code next = Gearef(context, Stack)-&gt;next;
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
260 goto clearSingleLinkedStack(context, stack, next);
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
261 }
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
262 </code></pre>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
263
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
264
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
265 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
266 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
267 <!-- _S9SLIDE_ -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
268 <h1 id="context-">Context の生成</h1>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
269
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
270 <ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
271 <li>Context は Meta Data Gear に相当し、Code Gear や Data Gear を管理している。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
272 <li>generate_context は context.h から Data Gear、c ファイルから Code Gear を取得。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
273 <li>取得した Code/Data Gear の enum の定義は enumCode.h、enumData.h に生成される。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
274 <li>Code/Data Gear の名前とポインタの対応は この enum と関数ポインタによって表現される。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
275 <li>generate_context は取得した Code/Data Gear から Context の生成を行うコードを生成する。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
276 <li>Context には Allocation で生成した Data Gear へのポインタも格納されているが、Data Gear の Allocation を行うコードは dataGearInit.c に生成される。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
277 <li>これらを自動生成することで Gears OS の記述量を約半分にすることができます。
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
278 <img src="./fig/generate_context.svg" alt="message" width="800" /></li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
279 </ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
280
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
281
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
282 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
283 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
284 <!-- _S9SLIDE_ -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
285 <h1 id="section-1">比較</h1>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
286
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
287
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
288 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
289 <div class='slide '>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
290 <!-- _S9SLIDE_ -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
291 <h1 id="section-2">今後の課題</h1>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
292 <ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
293 <li>本研究では interface の記述、CbC ファイルから Gears OS の記述に必要な Context と stub の生成を行う perl スクリプトの生成を行なった。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
294 <li>これにより Gears OS のコードの煩雑さは改善され、ユーザーは Context への接続を意識する必要がなくなった。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
295 <li>今後の課題は Code Gear からメタ計算を行う meta Code Gear を生成できるようにし、ユーザーがメタレベルの処理を意識せずにコードを記述できるようにする。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
296 <li>また、今回 perl スクリプトによって Context や stub の生成を行なったが、LLVM/clang 上で実装しコンパイラで直接 CbC を実行できるようにすることを目的とする。</li>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
297 </ul>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
298
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
299 <!--
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
300 # ChildrenとAttribute
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
301
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
302 # Eitherクラス
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
303
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
304 # Jungleのサンプルコード
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
305 # Jungleの木の編集
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
306
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
307 # NodePath
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
308
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
309 # ノードの追加
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
310
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
311 # 移動、ルートノードの追加、コミット
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
312
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
313 # Jungleのサンプルコード
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
314
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
315 # 検索APIの実装
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
316
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
317 # 関数findを用いた検索APIのサンプルコード
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
318
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
319 # JungleでのIndexの実装
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
320
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
321 # Indexの実装
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
322
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
323 # Indexの実装
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
324
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
325 # HTML Rendering Engine
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
326
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
327 # 構造
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
328 # ContentTree
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
329 # Nodeが持つAttribute
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
330 # LayoutTree
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
331 # LayoutTreeの主な要素
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
332 # useにおけるタグ対応表
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
333 # multiComponent
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
334 # 設計
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
335 # コードとギャップのある格納
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
336
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
337 # コードとギャップのない格納
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
338
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
339 # 性能評価
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
340
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
341 # まとめ
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
342 -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
343 <p><a href="プロシン発表時間 セッション4 1/7 8:50 - 10:10"></a></p>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
344 <!-- === end markdown block === -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
345 </div>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
346
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
347
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
348 </div><!-- presentation -->
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
349 </body>
b802c7ffb249 add Slide
mir3636
parents:
diff changeset
350 </html>