-
Notifications
You must be signed in to change notification settings - Fork 0
/
Interpreters.html
376 lines (307 loc) · 10.7 KB
/
Interpreters.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Qingkai Shi's Homepage</title>
<meta name="keywords" content="Qingkai Shi, QingkaiShi, Pinpoint, Static Code Analyzer, Program Analysis and Testing">
<meta name="viewport" content="initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no">
<link rel="icon" type="image/x-icon" href="images/favicon.ico">
<link href="fontawesome/css/fontawesome.css" rel="stylesheet">
<link href="fontawesome/css/brands.css" rel="stylesheet">
<link href="fontawesome/css/solid.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jpswalsh/academicons@1/css/academicons.min.css">
<link href="style.css" rel="stylesheet">
<script src="auto.js"></script>
</head>
<body>
<div id="container"><div id="main">
<h1>Interpreters</h1>
<div id="content">
<p>The course designers and instructors deeply appreciate researchers in the
community for their inspiring works, which provide rich materials for developing
the course and advancing the research in this direction.<br />
<br />
<a href="/">Back to Homepage</a> · <a href="/Teaching.html">Previous Page</a></p>
<hr />
<br />
<div style="float:right; display:inline-block; margin:25px 15px 0 15px"><img
src="/images/interpreters.jpg" width="180px" /><br />
<!-- <strong>Fig 1. The textbook.</strong> --></div>
<p>Welcome to the course on Interpreters and Virtual Machines! This course
delves into the fascinating world of how programs are executed in another way,
focusing on interpreted execution rather than compiled execution (which should
be studied in the course known as <a href="/Compilers.html">Compilers</a>). An
interpreter or virtual machine, like the Python interpreter and the Java virtual
machine, creates a simulated environment in which programs can run, providing
benefits like platform independence and enhanced security. This course will
guide you through the architecture of interpreters and virtual machines,
including popular examples like the tree-walk interpreter and Java Virtual
Machine (JVM).By the end of this course, you’ll have a deep understanding of
how interpreters and virtual machines function and how they are used to execute
code efficiently and securely. This knowledge is essential for anyone interested
in the inner workings of programming languages, software development, or
computer architecture.</p>
<p><strong>Prerequisites</strong>: Before registering for this course, a student
must check if he has basic knowledge of compilers and the C/C++ and Java
programming languages.</p>
<h2 id="toc-lectures">Lectures</h2>
<p>The course slides are provided in the table below. If you have any questions
or suggestions, please feel free to reach out to the instructor or teaching
assistants. The course designers sincerely thank the instructors and researchers
in the community whose inspiring work has contributed valuable material for
these slides.<br />
<br />
</p>
<table id="course-isre" class="tg" style="width:100%">
<thead>
<tr>
<th class="tg-fymr">
<center>Weeks</center>
</th>
<th class="tg-fymr">Lectures</th>
<th class="tg-fymr">Materials</th>
</tr>
</thead>
<tr>
<td class="tg-0pky">
<center>1</center>
</td>
<td class="tg-0pky">Introduction to Interpreters and Virtual Machines<br />
- Basic concepts of programming languages, compilers, interpreters, and
VM<br />
</td>
<td class="tg-0pky"><br />
<a href="https://box.nju.edu.cn/f/67de746bdfe94fe3a544/">Slides-1</a></td>
</tr>
<!-- - -->
<tr>
<td class="tg-0pky" colspan="3">
<center><strong>Tree-Walk Interpreter</strong></center>
</td>
</tr>
<!-- - -->
<tr>
<td class="tg-0pky">
<center>2</center>
</td>
<td class="tg-0pky">Generating the Syntax Tree<br />
- Introduction to <a href="https://github.com/qingkaishi/minijava">the
mini Java language</a><br />
- Review of the lexical and syntax analysis</td>
<td class="tg-0pky"><br />
<a href="https://box.nju.edu.cn/f/06c930ccfb944e49b71d/">Slides-2</a><br />
<a href="https://box.nju.edu.cn/f/b594ff0957aa4ed988ea/">Slides-3</a></td>
</tr>
<tr>
<td class="tg-0pky">
<center>3</center>
</td>
<td class="tg-0pky">Expressions and Statements<br />
- Evaluating expressions / Online type checking<br />
- Evaluating statements / Scoping and shadowing<br />
- <strong>Lab 1:</strong> The first tree-walk interpreter</td>
<td class="tg-0pky"><br />
<a href="https://box.nju.edu.cn/f/6687bc86854041848fe2/">Slides-4</a><br />
<a href="https://box.nju.edu.cn/f/71eacb855b3c469fb483/">Slides-5</a><br />
<a href="https://box.nju.edu.cn/f/a6393c85656c4691aa4f/">Lab-1</a></td>
</tr>
<tr>
<td class="tg-0pky">
<center>4</center>
</td>
<td class="tg-0pky">Control Flows and Methods<br />
- Conditional execution / Loops<br />
- Method declaration / Method invocation / Method return</td>
<td class="tg-0pky"><br />
<a href="https://box.nju.edu.cn/f/13544f7030b143a5a6bf/">Slides-6</a><br />
<a href="https://box.nju.edu.cn/f/d9106b46b87c4865abd5/">Slides-7</a></td>
</tr>
<tr>
<td class="tg-0pky">
<center>5</center>
</td>
<td class="tg-0pky">Object-Oriented Programming<br />
- Arrays<br />
- <strong>Lab 2:</strong> Procedure-oriented programming<br />
- Classes</td>
<td class="tg-0pky"><br />
<a href="https://box.nju.edu.cn/f/3c27a0c888f144799ea6/">Slides-8</a><br />
<a href="#">Lab-2</a><br />
<a href="https://box.nju.edu.cn/f/301088690f8b4dc8bea4/">Slides-9</a></td>
</tr>
<tr>
<td class="tg-0pky">
<center>6</center>
</td>
<td class="tg-0pky">Inheritance and Polymorphism<br />
- Inheritance / Polymorphism<br />
- <strong>Lab 3:</strong> Object-oriented programming</td>
<td class="tg-0pky"><br />
<a href="https://box.nju.edu.cn/f/f5f8103db9be41acaeb2/">Slides-10</a><br />
<a href="#">Lab-3</a></td>
</tr>
<!-- - -->
<tr>
<td class="tg-0pky" colspan="3">
<center><strong>Java Virtual Machine</strong></center>
</td>
</tr>
<!-- - -->
<tr>
<td class="tg-0pky">
<center>7</center>
</td>
<td class="tg-0pky">Introduction to Java Virtual Machine<br />
- Java bytecode / Basic structure of OpenJDK<br />
- The First Attempt of Hacking JVM</td>
<td class="tg-0pky"><br />
<a href="#">Slides-11</a><br />
<a href="#">Slides-12</a></td>
</tr>
<tr>
<td class="tg-0pky">
<center>8</center>
</td>
<td class="tg-0pky">Object Model and Class Loader<br />
- Object and class representation in JVM<br />
- Loading, initializing, using, and unloading classes</td>
<td class="tg-0pky"><br />
<a href="#">Slides-13</a><br />
<a href="#">Slides-14</a></td>
</tr>
<tr>
<td class="tg-0pky">
<center>9</center>
</td>
<td class="tg-0pky">Template Interpreter<br />
- Architecture of the interpreter / machine code template<br />
- Code cache / interpreter generation<br />
</td>
<td class="tg-0pky"><br />
<a href="#">Slides-15</a><br />
<a href="#">Slides-16</a><br />
</td>
</tr>
<tr>
<td class="tg-0pky">
<center>10</center>
</td>
<td class="tg-0pky">Memory Management<br />
- VM memory structure / Runtime space allocation<br />
- Garbage collection and its optimization</td>
<td class="tg-0pky"><br />
<a href="#">Slides-17</a><br />
<a href="#">Slides-18</a></td>
</tr>
<tr>
<td class="tg-0pky">
<center>11</center>
</td>
<td class="tg-0pky">Dealing with Exceptions<br />
- Context of exceptions / local and remote exceptions<br />
- Stack trace / Control transference</td>
<td class="tg-0pky"><br />
<a href="#">Slides-19</a><br />
<a href="#">Slides-20</a></td>
</tr>
<tr>
<td class="tg-0pky">
<center>12</center>
</td>
<td class="tg-0pky">Linker and Native Interfaces<br />
- Verification, preparation, and resolution / Linking methods<br />
- JNI / Communications between Java and JVM<br />
- <strong>Lab 4:</strong> Reshaping the Java native interfaces</td>
<td class="tg-0pky"><br />
<a href="#">Slides-21</a><br />
<a href="#">Slides-22</a><br />
<a href="#">Lab-4</a></td>
</tr>
<tr>
<td class="tg-0pky">
<center>13</center>
</td>
<td class="tg-0pky">Threading Model<br />
- Mapping VM threads to OS threads / Synchronization components / GC
support<br />
- Optimizing synchronization / Transactions</td>
<td class="tg-0pky"><br />
<a href="#">Slides-23</a><br />
<a href="#">Slides-24</a></td>
</tr>
<tr>
<td class="tg-0pky">
<center>14</center>
</td>
<td class="tg-0pky">Just-in-Time Compilation – I<br />
- Bytecode → High-level IR (HIR) → Low-level IR (LIR)<br />
- HIR and LIR optimizations</td>
<td class="tg-0pky"><br />
<a href="#">Slides-25</a><br />
<a href="#">Slides-26</a></td>
</tr>
<tr>
<td class="tg-0pky">
<center>15</center>
</td>
<td class="tg-0pky">Just-in-Time Compilation – II<br />
- Sea-of-node IR and optimizations<br />
- GC support and deoptimizations<br />
- <strong>Lab 5:</strong> One more optimization for JVM</td>
<td class="tg-0pky"><br />
<a href="#">Slides-27</a><br />
<a href="#">Slides-28</a><br />
<a href="#">Lab-5</a></td>
</tr>
<!-- - -->
<tr>
<td class="tg-0pky" colspan="3">
<center><strong>Conclusion</strong></center>
</td>
</tr>
<!-- - -->
<tr>
<td class="tg-0pky">
<center>16</center>
</td>
<td class="tg-0pky">Concluding the Course<br />
- Review of the lectures and the labs</td>
<td class="tg-0pky"><br />
<a href="#">Slides-29</a></td>
</tr>
</table>
<div><br />
</div>
<h2 id="toc-grading-scheme">Grading Scheme</h2>
<p>Labs (50%) + Exam (50%)</p>
<h2 id="toc-teaching-assistants">Teaching Assistants</h2>
<p>(TBA)</p>
<h2 id="toc-online-discussion">Online Discussion</h2>
<p>(TBA)</p>
<h2 id="toc-office-hours">Office Hours</h2>
<p>By appointment. Feel free to email TAs or the instructors to claim a
time slot.</p>
<div><br />
</div>
<!-- by Texy2! --> </div>
</div></div>
<div id="footer-container">
<div id="footer">
Copyright 2024 Qingkai Shi. Last modified: 2024.12. <br>
<div id="edit">
<a href="./?edit=Interpreters">Edit page</a> |
<a href="./cv.php" target="_blank">Edit resume</a> |
<a href="./fileupload.php" target="_blank">Upload files</a> |
<a href="./?edit=">Create new page</a> <br>
</div>
<br>
<a href='https://clustrmaps.com/site/1a3c7' title='Visit tracker' id='tracker-link'>
<img src='images/map_v2.png' id='tracker-img'/>
</a>
<div class="vl"></div>
<img src='images/QR.jpg' height=90px id='weixin-img'/>
</div>
<style onload="complete_load()"></style>
</div>
</body>
</html>