author | Christian Urban <urbanc@in.tum.de> |
Thu, 14 Nov 2019 01:21:02 +0000 | |
changeset 686 | 05cfce0fdef7 |
parent 608 | 3db4970ad0aa |
child 687 | 8865f4f2be59 |
permissions | -rw-r--r-- |
686 | 1 |
% !TEX program = xelatex |
63 | 2 |
\documentclass[dvipsnames,14pt,t]{beamer} |
302
0fa7b4221745
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
3 |
\usepackage{../slides} |
215
828303e8e4af
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
188
diff
changeset
|
4 |
\usepackage{../langs} |
828303e8e4af
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
188
diff
changeset
|
5 |
\usepackage{../data} |
608 | 6 |
\usepackage{../graphics} |
7 |
\usepackage{../grammar} |
|
188
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
8 |
|
63 | 9 |
% beamer stuff |
451 | 10 |
\renewcommand{\slidecaption}{CFL 07, King's College London} |
63 | 11 |
\newcommand{\bl}[1]{\textcolor{blue}{#1}} |
12 |
||
13 |
\begin{document} |
|
14 |
||
15 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
302
0fa7b4221745
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
16 |
\begin{frame}[t] |
63 | 17 |
\frametitle{% |
18 |
\begin{tabular}{@ {}c@ {}} |
|
19 |
\\[-3mm] |
|
451 | 20 |
\LARGE Compilers and \\[-2mm] |
387
8aa406adfde0
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
374
diff
changeset
|
21 |
\LARGE Formal Languages (7)\\[3mm] |
63 | 22 |
\end{tabular}} |
23 |
||
24 |
\normalsize |
|
25 |
\begin{center} |
|
26 |
\begin{tabular}{ll} |
|
686 | 27 |
Email: & christian.urban at kcl.ac.uk\\ |
28 |
Office Hours: & Thursdays 12 -- 14\\ |
|
29 |
Location: & N7.07 (North Wing, Bush House)\\ |
|
30 |
Slides \& Progs: & KEATS (also homework is there)\\ |
|
63 | 31 |
\end{tabular} |
32 |
\end{center} |
|
33 |
||
302
0fa7b4221745
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
34 |
\end{frame} |
0fa7b4221745
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
215
diff
changeset
|
35 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
63 | 36 |
|
608 | 37 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
38 |
\begin{frame}[c] |
|
39 |
\frametitle{Bird's Eye View} |
|
387
8aa406adfde0
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
374
diff
changeset
|
40 |
|
608 | 41 |
\begin{center} |
42 |
\begin{tikzpicture} |
|
43 |
\node (rexp) {\bl{\bf Lexer}}; |
|
44 |
\node (nfa) [right=of rexp] {\bl{\bf Parser}}; |
|
45 |
\node (dfa) [right=of nfa] |
|
46 |
{\bl{\begin{tabular}{c}\bf Machine Code/\\\bf Java Byte Code\end{tabular}}}; |
|
47 |
\path[->, red, line width=2mm] (rexp) edge node [above=4mm, black] {\begin{tabular}{c@{\hspace{9mm}}}token\\[-1mm] |
|
48 |
sequence\end{tabular}} (nfa); |
|
49 |
\path[->, red, line width=2mm] (nfa) edge node [above=4mm, black] {\begin{tabular}{c}parse\\[-1mm] tree\end{tabular}}(dfa); |
|
50 |
\end{tikzpicture}\\ |
|
51 |
\end{center} |
|
52 |
||
53 |
\end{frame} |
|
54 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
55 |
||
63 | 56 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
57 |
\begin{frame}[c] |
|
686 | 58 |
\frametitle{CW3} |
59 |
||
60 |
Atomic parsers for tokens |
|
61 |
||
62 |
\begin{center} |
|
63 |
\bl{$\texttt{T\_Num(123)}::rest \;\Rightarrow\; \{(\texttt{T\_Num(123)}, rest)\}$} |
|
64 |
\end{center}\bigskip |
|
65 |
||
66 |
\begin{itemize} |
|
67 |
\item you consume one or more token from the\\ |
|
68 |
input (stream) |
|
69 |
\item \bl{\texttt{T\_NUM(1), T\_OP(+), T\_NUM(2)}} |
|
70 |
\end{itemize} |
|
71 |
\end{frame} |
|
72 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
73 |
||
74 |
||
75 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
76 |
\begin{frame}[c] |
|
608 | 77 |
\begin{textblock}{10}(0.5,0.5) |
78 |
\LARGE |
|
79 |
\fontspec{Hoefler Text Black} |
|
80 |
\textcolor{ProcessBlue}{JVM\\ Code} |
|
81 |
\\[12mm] |
|
82 |
||
83 |
\normalsize |
|
84 |
Jasmin\\ |
|
85 |
Krakatau\\ |
|
86 |
ASM lib |
|
87 |
\end{textblock} |
|
88 |
||
387
8aa406adfde0
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
374
diff
changeset
|
89 |
|
608 | 90 |
\fontsize{8}{10}\selectfont |
91 |
%\footnotesize |
|
92 |
\mbox{}\\[-8mm]\mbox{} |
|
93 |
||
94 |
\begin{columns} |
|
95 |
\begin{column}{2cm} |
|
96 |
\lstinputlisting[numbers=none]{../progs/appHa.j} |
|
97 |
\end{column} |
|
98 |
||
99 |
\begin{column}{2cm} |
|
100 |
\lstinputlisting[numbers=none]{../progs/appHb.j} |
|
101 |
\end{column} |
|
102 |
||
103 |
\end{columns} |
|
63 | 104 |
|
608 | 105 |
\end{frame} |
106 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
107 |
||
108 |
||
109 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
110 |
\begin{frame}[t] |
|
111 |
||
63 | 112 |
\begin{center} |
608 | 113 |
\bl{\begin{tabular}{@{}lcl@{}} |
114 |
\\[-12mm] |
|
115 |
\meta{Stmt} & $::=$ & $\texttt{skip}$\\ |
|
116 |
& $|$ & \textit{Id}\;\texttt{:=}\;\meta{AExp}\\ |
|
117 |
& $|$ & \texttt{if}\; \meta{BExp} \;\texttt{then}\; \meta{Block} \;\texttt{else}\; \meta{Block}\\ |
|
118 |
& $|$ & \texttt{while}\; \meta{BExp} \;\texttt{do}\; \meta{Block}\\ |
|
119 |
& $|$ & \texttt{read}\;\textit{Id}\\ |
|
120 |
& $|$ & \texttt{write}\;\textit{Id}\\ |
|
121 |
& $|$ & \texttt{write}\;\textit{String}\medskip\\ |
|
122 |
\meta{Stmts} & $::=$ & \meta{Stmt} \;\texttt{;}\; \meta{Stmts}\\ |
|
123 |
& $|$ & \meta{Stmt}\medskip\\ |
|
124 |
\meta{Block} & $::=$ & \texttt{\{}\,\meta{Stmts}\,\texttt{\}}\\ |
|
125 |
& $|$ & \meta{Stmt}\medskip\\ |
|
126 |
\meta{AExp} & $::=$ & \ldots\\ |
|
127 |
\meta{BExp} & $::=$ & \ldots\\ |
|
128 |
\end{tabular}} |
|
184
2e9134d25a2b
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
173
diff
changeset
|
129 |
\end{center} |
608 | 130 |
\end{frame} |
131 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
184
2e9134d25a2b
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
173
diff
changeset
|
132 |
|
608 | 133 |
|
134 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
135 |
\begin{frame}[c] |
|
136 |
\frametitle{\begin{tabular}{c}Fibonacci Numbers\end{tabular}} |
|
387
8aa406adfde0
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
374
diff
changeset
|
137 |
|
608 | 138 |
\mbox{}\\[-18mm]\mbox{} |
139 |
||
140 |
{\lstset{language=While}\fontsize{10}{12}\selectfont |
|
141 |
\texttt{\lstinputlisting{../progs/fib.while}}} |
|
387
8aa406adfde0
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
374
diff
changeset
|
142 |
|
369
43c0ed473720
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
302
diff
changeset
|
143 |
\end{frame} |
184
2e9134d25a2b
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
173
diff
changeset
|
144 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
387
8aa406adfde0
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
374
diff
changeset
|
145 |
|
184
2e9134d25a2b
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
173
diff
changeset
|
146 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
387
8aa406adfde0
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
374
diff
changeset
|
147 |
\begin{frame}[c] |
608 | 148 |
\frametitle{Interpreter} |
188
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
149 |
|
63 | 150 |
\begin{center} |
188
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
151 |
\bl{\begin{tabular}{@{}lcl@{}} |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
152 |
$\text{eval}(n, E)$ & $\dn$ & $n$\\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
153 |
$\text{eval}(x, E)$ & $\dn$ & $E(x)$ \;\;\;\textcolor{black}{lookup \bl{$x$} in \bl{$E$}}\\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
154 |
$\text{eval}(a_1 + a_2, E)$ & $\dn$ & $\text{eval}(a_1, E) + \text{eval}(a_2, E)$\\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
155 |
$\text{eval}(a_1 - a_2, E)$ & $\dn$ & $\text{eval}(a_1, E) - \text{eval}(a_2, E)$\\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
156 |
$\text{eval}(a_1 * a_2, E)$ & $\dn$ & $\text{eval}(a_1, E) * \text{eval}(a_2, E)$\bigskip\\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
157 |
$\text{eval}(a_1 = a_2, E)$ & $\dn$ & $\text{eval}(a_1, E) = \text{eval}(a_2, E)$\\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
158 |
$\text{eval}(a_1\,!\!= a_2, E)$ & $\dn$ & $\neg(\text{eval}(a_1, E) = \text{eval}(a_2, E))$\\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
159 |
$\text{eval}(a_1 < a_2, E)$ & $\dn$ & $\text{eval}(a_1, E) < \text{eval}(a_2, E)$\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
160 |
\end{tabular}} |
63 | 161 |
\end{center} |
162 |
||
608 | 163 |
\end{frame} |
63 | 164 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
608 | 165 |
|
63 | 166 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
167 |
\begin{frame}[c] |
|
608 | 168 |
\frametitle{Interpreter (2)} |
63 | 169 |
|
170 |
\begin{center} |
|
188
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
171 |
\bl{\begin{tabular}{@{}lcl@{}} |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
172 |
$\text{eval}(\text{skip}, E)$ & $\dn$ & $E$\\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
173 |
$\text{eval}(x:=a, E)$ & $\dn$ & \bl{$E(x \mapsto \text{eval}(a, E))$}\\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
174 |
\multicolumn{3}{@{}l@{}}{$\text{eval}(\text{if}\;b\;\text{then}\;cs_1\;\text{else}\;cs_2 , E) \dn$}\\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
175 |
\multicolumn{3}{@{}l@{}}{\hspace{2cm}$\text{if}\;\text{eval}(b,E)\;\text{then}\; |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
176 |
\text{eval}(cs_1,E)$}\\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
177 |
\multicolumn{3}{@{}l@{}}{\hspace{2cm}$\phantom{\text{if}\;\text{eval}(b,E)\;}\text{else}\;\text{eval}(cs_2,E)$}\\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
178 |
\multicolumn{3}{@{}l@{}}{$\text{eval}(\text{while}\;b\;\text{do}\;cs, E) \dn$}\\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
179 |
\multicolumn{3}{@{}l@{}}{\hspace{2cm}$\text{if}\;\text{eval}(b,E)$}\\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
180 |
\multicolumn{3}{@{}l@{}}{\hspace{2cm}$\text{then}\; |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
181 |
\text{eval}(\text{while}\;b\;\text{do}\;cs, \text{eval}(cs,E))$}\\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
182 |
\multicolumn{3}{@{}l@{}}{\hspace{2cm}$\text{else}\; E$}\\ |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
183 |
$\text{eval}(\text{write}\; x, E)$ & $\dn$ & $\{\;\text{println}(E(x))\; ;\;E\;\}$\\ |
63 | 184 |
\end{tabular}} |
185 |
\end{center} |
|
186 |
||
608 | 187 |
\end{frame} |
188
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
188 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
189 |
|
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
190 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
191 |
\begin{frame}[c] |
608 | 192 |
\frametitle{Test Program} |
188
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
193 |
|
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
194 |
\mbox{}\\[-18mm]\mbox{} |
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
195 |
|
608 | 196 |
{\lstset{language=While}\fontsize{10}{12}\selectfont |
188
12ef150273ce
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
187
diff
changeset
|
197 |
\texttt{\lstinputlisting{../progs/loops.while}}} |
63 | 198 |
|
608 | 199 |
\end{frame} |
63 | 200 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
201 |
||
202 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
608 | 203 |
\begin{frame}[c] |
204 |
\fontsize{7}{9}\selectfont |
|
205 |
||
206 |
||
207 |
\begin{columns} |
|
208 |
\begin{column}{7cm} |
|
209 |
\lstinputlisting[numbers=none]{../progs/appHa.j} |
|
210 |
\end{column} |
|
211 |
||
212 |
\begin{column}{7cm} |
|
213 |
\lstinputlisting[numbers=none]{../progs/appHb.j} |
|
214 |
\end{column} |
|
215 |
\end{columns} |
|
216 |
||
217 |
\end{frame} |
|
218 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
219 |
||
686 | 220 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
221 |
%\begin{frame}[t] |
|
222 |
%\frametitle{Interpreted Code} |
|
223 |
% |
|
224 |
%\begin{center} |
|
225 |
%\begin{tikzpicture} |
|
226 |
%\begin{axis}[axis x line=bottom, axis y line=left, xlabel=n, ylabel=secs, legend style=small] |
|
227 |
%\addplot+[smooth] file {interpreted.data}; |
|
228 |
%\end{axis} |
|
229 |
%\end{tikzpicture} |
|
230 |
%\end{center} |
|
231 |
% |
|
232 |
%\end{frame} |
|
233 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
234 |
% |
|
235 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
236 |
%\begin{frame}[c] |
|
237 |
%\frametitle{Java Virtual Machine} |
|
238 |
% |
|
239 |
%\begin{itemize} |
|
240 |
%\item introduced in 1995 |
|
241 |
%\item is a stack-based VM (like Postscript, CLR of .Net) |
|
242 |
%\item contains a JIT compiler |
|
243 |
%\item many languages take advantage of JVM's infrastructure (JRE) |
|
244 |
%\item is garbage collected $\Rightarrow$ no buffer overflows |
|
245 |
%\item some languages compiled to the JVM: Scala, Clojure\ldots |
|
246 |
%\end{itemize} |
|
247 |
% |
|
248 |
%\end{frame} |
|
608 | 249 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
250 |
||
251 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
252 |
\begin{frame}[t,fragile] |
|
253 |
\frametitle{Compiling AExps} |
|
254 |
||
686 | 255 |
For example \textbf{\bl{1 + ((2 * 3) + (4 - 3))}}:\medskip |
608 | 256 |
|
257 |
\begin{columns}[T] |
|
258 |
\begin{column}{.3\textwidth} |
|
259 |
\begin{center} |
|
260 |
\bl{\begin{tikzpicture} |
|
261 |
\tikzset{level distance=12mm,sibling distance=4mm} |
|
262 |
\tikzset{edge from parent/.style={draw,very thick}} |
|
263 |
\Tree [.$+$ [.$1$ ] [.$+$ [.$*$ $2$ $3$ ] [.$-$ $4$ $3$ ]]] |
|
264 |
\end{tikzpicture}} |
|
265 |
\end{center} |
|
266 |
\end{column} |
|
267 |
\begin{column}{.3\textwidth} |
|
268 |
\begin{lstlisting}[language=JVMIS,numbers=none] |
|
269 |
ldc 1 |
|
270 |
ldc 2 |
|
271 |
ldc 3 |
|
272 |
imul |
|
273 |
ldc 4 |
|
274 |
ldc 3 |
|
275 |
isub |
|
276 |
iadd |
|
277 |
iadd |
|
278 |
\end{lstlisting} |
|
279 |
\end{column} |
|
280 |
\end{columns}\bigskip |
|
281 |
||
282 |
\small |
|
283 |
Traverse tree in post-order \bl{$\Rightarrow$} code for |
|
284 |
stack-machine |
|
285 |
||
286 |
\end{frame} |
|
287 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
288 |
||
289 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
290 |
\begin{frame}[t,fragile] |
|
291 |
\frametitle{Compiling AExps} |
|
292 |
||
686 | 293 |
\liningnums{\textbf{\Large\bl{(1 + 2) + 3}}} |
608 | 294 |
|
295 |
\begin{lstlisting}[language=JVMIS,numbers=none,xleftmargin=6cm] |
|
296 |
ldc 1 |
|
297 |
ldc 2 |
|
298 |
iadd |
|
299 |
ldc 3 |
|
300 |
iadd |
|
301 |
\end{lstlisting} |
|
302 |
||
303 |
||
304 |
\end{frame} |
|
305 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
306 |
||
307 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
308 |
\begin{frame}[t,fragile] |
|
309 |
\frametitle{Compiling AExps} |
|
310 |
||
311 |
\liningnums{\textbf{\Large\bl{1 + (2 + 3)}}} |
|
312 |
||
313 |
\begin{lstlisting}[language=JVMIS,numbers=none,xleftmargin=6cm] |
|
314 |
ldc 1 |
|
315 |
ldc 2 |
|
316 |
ldc 3 |
|
317 |
iadd |
|
318 |
iadd |
|
319 |
\end{lstlisting} |
|
320 |
\bigskip\pause |
|
321 |
\vfill |
|
322 |
||
323 |
\textcolor{codepurple}{\textbf{\texttt{dadd}}}, |
|
324 |
\textcolor{codepurple}{\textbf{\texttt{fadd}}}, |
|
325 |
\textcolor{codepurple}{\textbf{\texttt{ladd}}}, \ldots |
|
326 |
||
327 |
\end{frame} |
|
328 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
329 |
||
330 |
||
331 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
332 |
\begin{frame}[t] |
|
333 |
\frametitle{Compiling AExps} |
|
334 |
||
335 |
\begin{center} |
|
336 |
\bl{\begin{tabular}{@{}lcl@{}} |
|
337 |
$\text{compile}(n)$ & $\dn$ & $\text{ldc}\;n$\\ |
|
338 |
$\text{compile}(a_1 + a_2)$ & $\dn$\\ |
|
339 |
\multicolumn{3}{l}{$\qquad\text{compile}(a_1) \;@\;\text{compile}(a_2)\;@\; \text{iadd}$}\smallskip\\ |
|
340 |
$\text{compile}(a_1 - a_2)$ & $\dn$\\ |
|
341 |
\multicolumn{3}{l}{$\qquad\text{compile}(a_1) \;@\; \text{compile}(a_2)\;@\; \text{isub}$}\smallskip\\ |
|
342 |
$\text{compile}(a_1 * a_2)$ & $\dn$\\ |
|
343 |
\multicolumn{3}{l}{$\qquad\text{compile}(a_1) \;@\; \text{compile}(a_2)\;@\; \text{imul}$}\smallskip\\ |
|
344 |
\end{tabular}} |
|
345 |
\end{center} |
|
346 |
||
347 |
\end{frame} |
|
348 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
349 |
||
350 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
351 |
\begin{frame}[t,fragile] |
|
352 |
\frametitle{\begin{tabular}{c}Compiling AExps\end{tabular}} |
|
353 |
||
354 |
\liningnums{\textbf{\Large\bl{1 $+$ 2 $*$ 3 $+$ (4 $-$ 3)}}} |
|
355 |
||
356 |
\begin{lstlisting}[language=JVMIS,numbers=none,xleftmargin=6cm] |
|
357 |
ldc 1 |
|
358 |
ldc 2 |
|
359 |
ldc 3 |
|
360 |
imul |
|
361 |
ldc 4 |
|
362 |
ldc 3 |
|
363 |
isub |
|
364 |
iadd |
|
365 |
iadd |
|
366 |
\end{lstlisting} |
|
367 |
||
368 |
\end{frame} |
|
369 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
370 |
||
371 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
372 |
\begin{frame}[c] |
|
373 |
\frametitle{Variables} |
|
374 |
\liningnums{\textbf{\Large\bl{x $:=$ 5 $+$ y $*$ 2}}}\bigskip\pause |
|
375 |
||
376 |
\begin{itemize} |
|
377 |
\item lookup: \bl{$\textcolor{codepurple}{\textbf{\texttt{iload}}}\; index$} |
|
378 |
\item store: \bl{$\textcolor{codepurple}{\textbf{\texttt{istore}}}\; index$} |
|
379 |
\end{itemize}\bigskip\pause |
|
380 |
||
381 |
while compilating we have to maintain a map between our identifiers and the |
|
382 |
Java bytecode indices |
|
383 |
||
384 |
\begin{center} |
|
385 |
\bl{$\text{compile}(a, E)$} |
|
386 |
\end{center} |
|
387 |
||
388 |
\end{frame} |
|
389 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
390 |
||
391 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
392 |
\begin{frame}[t] |
|
393 |
\frametitle{Compiling AExps} |
|
394 |
||
395 |
\begin{center} |
|
396 |
\bl{\begin{tabular}{@{}lcl@{}} |
|
397 |
$\text{compile}(n, E)$ & $\dn$ & $\text{ldc}\;n$\\ |
|
398 |
$\text{compile}(a_1 + a_2, E)$ & $\dn$\\ |
|
399 |
\multicolumn{3}{l}{$\qquad\text{compile}(a_1, E) \;@\;\text{compile}(a_2, E)\;@\; \text{iadd}$}\smallskip\\ |
|
400 |
$\text{compile}(a_1 - a_2, E)$ & $\dn$\\ |
|
401 |
\multicolumn{3}{l}{$\qquad\text{compile}(a_1, E) \;@\; \text{compile}(a_2, E)\;@\; \text{isub}$}\smallskip\\ |
|
402 |
$\text{compile}(a_1 * a_2, E)$ & $\dn$\\ |
|
403 |
\multicolumn{3}{l}{$\qquad\text{compile}(a_1, E) \;@\; \text{compile}(a_2, E)\;@\; \text{imul}$}\bigskip\\ |
|
404 |
$\text{compile}(x, E)$ & $\dn$ & $\text{iload}\;E(x)$\\ |
|
405 |
\end{tabular}} |
|
406 |
\end{center} |
|
407 |
||
408 |
\end{frame} |
|
409 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
410 |
||
411 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
412 |
\begin{frame}[c, fragile] |
|
413 |
\frametitle{Mathematical Functions} |
|
414 |
||
415 |
Compilation of some mathematical functions: |
|
416 |
||
417 |
\begin{center} |
|
418 |
\begin{tabular}{lcl} |
|
419 |
\texttt{Aop("+", a1, a2)} & $\Rightarrow$ & \texttt{...iadd}\\ |
|
420 |
\texttt{Aop("-", a1, a2)} & $\Rightarrow$ & \texttt{...isub}\\ |
|
421 |
\texttt{Aop("*", a1, a2)} & $\Rightarrow$ & \texttt{...imul}\\ |
|
422 |
\texttt{Aop("/", a1, a2)} & $\Rightarrow$ & \texttt{...idiv}\\ |
|
423 |
\texttt{Aop("\%", a1, a2)} & $\Rightarrow$ & \texttt{...irem}\\ |
|
424 |
\end{tabular} |
|
425 |
\end{center} |
|
426 |
||
427 |
\end{frame} |
|
428 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
429 |
||
430 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
431 |
\begin{frame}[c] |
|
432 |
\frametitle{Compiling Statements} |
|
433 |
||
434 |
We return a list of instructions and an environment for the |
|
435 |
variables |
|
436 |
||
437 |
\begin{center} |
|
438 |
\bl{\begin{tabular}{@{}l@{\hspace{1mm}}c@{\hspace{1mm}}l@{}} |
|
439 |
$\text{compile}(\text{skip}, E)$ & $\dn$ & $(\textit{Nil}, E)$\bigskip\\ |
|
440 |
$\text{compile}(x := a, E)$ & $\dn$\\ |
|
441 |
\multicolumn{3}{l}{$(\text{compile}(a, E) \;@\;\text{istore}\;index, E(x\mapsto index))$}\\ |
|
442 |
\end{tabular}} |
|
443 |
\end{center}\medskip |
|
444 |
||
445 |
where \bl{$index$} is \bl{$E(x)$} if it is already defined, |
|
446 |
or if it is not, then the largest index not yet seen |
|
447 |
||
448 |
\end{frame} |
|
449 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
450 |
||
451 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
452 |
\begin{frame}[c,fragile] |
|
453 |
\frametitle{Compiling Assignments} |
|
454 |
||
455 |
\liningnums{\textbf{\Large\bl{x $:=$ x $+$ 1}}} |
|
456 |
||
457 |
\begin{lstlisting}[language=JVMIS,numbers=none,xleftmargin=6cm] |
|
458 |
iload /*@\bl{$n_x$}@*/ |
|
459 |
ldc 1 |
|
460 |
iadd |
|
461 |
istore /*@\bl{$n_x$}@*/ |
|
462 |
\end{lstlisting}\medskip |
|
463 |
||
464 |
where \bl{$n_x$} is the index corresponding to the variable~\bl{$x$} |
|
465 |
||
466 |
\end{frame} |
|
467 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
468 |
||
469 |
||
470 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
471 |
\begin{frame}[t] |
|
472 |
\frametitle{Compiling Ifs} |
|
473 |
||
474 |
{\Large\bl{$\text{if}\;b\;\text{then}\;cs_1\;\text{else}\;cs_2$}}\bigskip\bigskip |
|
475 |
||
476 |
\onslide<2->{Case }\only<2>{{\bf True}:}\only<3>{{\bf False}:} |
|
477 |
||
478 |
\begin{center} |
|
479 |
\begin{tikzpicture}[node distance=2mm and 4mm, |
|
480 |
block/.style={rectangle, minimum size=1cm, draw=black, line width=1mm}, |
|
481 |
point/.style={rectangle, inner sep=0mm, minimum size=0mm, fill=red}, |
|
482 |
skip loop/.style={red, line width=1mm, to path={-- ++(0,-10mm) -| (\tikztotarget)}}] |
|
483 |
\node (A1) [point] {}; |
|
484 |
\node (b) [block, right=of A1] {code of \bl{$b$}}; |
|
485 |
\node (A2) [point, right=of b] {}; |
|
486 |
\node (cs1) [block, right=of A2] {code of \bl{$cs_1$}}; |
|
487 |
\node (A3) [point, right=of cs1] {}; |
|
488 |
\node (cs2) [block, right=of A3] {code of \bl{$cs_2$}}; |
|
489 |
\node (A4) [point, right=of cs2] {}; |
|
490 |
||
491 |
\only<2>{ |
|
492 |
\draw (A1) edge [->, red, line width=1mm] (b); |
|
493 |
\draw (b) edge [->, red, line width=1mm] (cs1); |
|
494 |
\draw (cs1) edge [->, red, line width=1mm] (A3); |
|
495 |
\draw (A3) edge [->,skip loop] (A4); |
|
496 |
\node [below=of cs2] {\raisebox{-5mm}{\small{}jump}};} |
|
497 |
\only<3>{ |
|
498 |
\draw (A1) edge [->, red, line width=1mm] (b); |
|
499 |
\draw (b) edge [->, red, line width=1mm] (A2); |
|
500 |
\draw (A2) edge [skip loop] (A3); |
|
501 |
\draw (A3) edge [->, red, line width=1mm] (cs2); |
|
502 |
\draw (cs2) edge [->,red, line width=1mm] (A4); |
|
503 |
\node [below=of cs1] {\raisebox{-5mm}{\small{}conditional jump}};} |
|
504 |
\end{tikzpicture} |
|
505 |
\end{center} |
|
506 |
||
507 |
\end{frame} |
|
508 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
509 |
||
510 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
511 |
\begin{frame}[t,fragile] |
|
512 |
\frametitle{Conditional Jumps} |
|
513 |
||
514 |
\begin{minipage}{1.1\textwidth} |
|
515 |
\begin{itemize} |
|
516 |
\item \textcolor{codepurple}{\textbf{\texttt{if\_icmpeq}}} \bl{$label$} |
|
517 |
if two ints are equal, then jump\medskip |
|
518 |
\item \textcolor{codepurple}{\textbf{\texttt{if\_icmpne}}} \bl{$label$} |
|
519 |
if two ints aren't equal, then jump\medskip |
|
520 |
\item \textcolor{codepurple}{\textbf{\texttt{if\_icmpge}}} \bl{$label$} |
|
521 |
if one int is greater or equal then another, then jump |
|
522 |
\item[]\ldots |
|
523 |
\end{itemize} |
|
524 |
\end{minipage}\pause |
|
525 |
||
526 |
\begin{lstlisting}[language=JVMIS,numbers=none,xleftmargin=2cm] |
|
527 |
/*@\bl{$L_1$:}@*/ |
|
528 |
if_icmpeq /*@\bl{$L_2$}@*/ |
|
529 |
iload 1 |
|
530 |
ldc 1 |
|
531 |
iadd |
|
532 |
if_icmpeq /*@\bl{$L_1$}@*/ |
|
533 |
/*@\bl{$L_2$:}@*/ |
|
534 |
\end{lstlisting} |
|
535 |
||
536 |
||
537 |
\begin{textblock}{3.5}(11,12) |
|
538 |
\only<3>{labels must be unique} |
|
539 |
\end{textblock} |
|
540 |
\end{frame} |
|
541 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
542 |
||
543 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
544 |
\begin{frame}[c,fragile] |
|
545 |
\frametitle{Compiling Ifs} |
|
546 |
||
547 |
For example |
|
548 |
||
549 |
\begin{lstlisting}[mathescape,numbers=none,language=While] |
|
550 |
if 1 = 1 then x := 2 else y := 3 |
|
551 |
\end{lstlisting} |
|
552 |
||
553 |
||
554 |
\begin{center} |
|
555 |
\begin{lstlisting}[mathescape,language=JVMIS,numbers=none] |
|
556 |
ldc 1 |
|
557 |
ldc 1 |
|
558 |
if_icmpne L_ifelse $\quad\tikz[remember picture] \node (C) {\mbox{}};$ |
|
559 |
ldc 2 |
|
560 |
istore 0 |
|
561 |
goto L_ifend $\quad\tikz[remember picture] \node (A) {\mbox{}};$ |
|
562 |
L_ifelse: $\quad\tikz[remember picture] \node[] (D) {\mbox{}};$ |
|
563 |
ldc 3 |
|
564 |
istore 1 |
|
565 |
L_ifend: $\quad\tikz[remember picture] \node[] (B) {\mbox{}};$ |
|
566 |
\end{lstlisting} |
|
567 |
\end{center} |
|
568 |
||
569 |
\begin{tikzpicture}[remember picture,overlay] |
|
570 |
\draw[->,very thick] (A) edge [->,to path={-- ++(10mm,0mm) |
|
571 |
-- ++(0mm,-17.3mm) |- (\tikztotarget)},line width=1mm] (B.east); |
|
572 |
\draw[->,very thick] (C) edge [->,to path={-- ++(10mm,0mm) |
|
573 |
-- ++(0mm,-17.3mm) |- (\tikztotarget)},line width=1mm] (D.east); |
|
574 |
\end{tikzpicture} |
|
575 |
||
576 |
\end{frame} |
|
577 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
578 |
||
579 |
||
580 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
581 |
\begin{frame}[t] |
|
582 |
\frametitle{Compiling BExps} |
|
583 |
||
584 |
{\Large\bl{$a_1 = a_2$}} |
|
585 |
||
586 |
\begin{center} |
|
587 |
\bl{\begin{tabular}{lcl} |
|
588 |
$\text{compile}(a_1 = a_2, E, lab)$ & $\dn$\\ |
|
589 |
\multicolumn{3}{l}{$\quad\text{compile}(a_1, E) \;@\;\text{compile}(a_2, E)\;@\; \text{if\_icmpne}\;lab$} |
|
590 |
\end{tabular}} |
|
591 |
\end{center} |
|
592 |
||
593 |
\end{frame} |
|
594 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
595 |
||
596 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
597 |
\begin{frame}[c, fragile] |
|
598 |
\frametitle{Boolean Expressions} |
|
599 |
||
600 |
Compilation of boolean expressions: |
|
601 |
||
602 |
\begin{center} |
|
603 |
\begin{tikzpicture}[node distance=2mm and 4mm, |
|
604 |
block/.style={rectangle, minimum size=1cm, draw=black, line width=1mm}, |
|
605 |
point/.style={rectangle, inner sep=0mm, minimum size=0mm, fill=red}, |
|
606 |
skip loop/.style={red, line width=1mm, to path={-- ++(0,-10mm) -| (\tikztotarget)}}] |
|
607 |
\node (A1) [point] {}; |
|
608 |
\node (b) [block, right=of A1] {code of \bl{$b$}}; |
|
609 |
\node (A2) [point, right=of b] {}; |
|
610 |
\node (cs1) [block, right=of A2] {code of \bl{$cs_1$}}; |
|
611 |
\node (A3) [point, right=of cs1] {}; |
|
612 |
\node (cs2) [block, right=of A3] {code of \bl{$cs_2$}}; |
|
613 |
\node (A4) [point, right=of cs2] {}; |
|
614 |
||
615 |
\only<1>{ |
|
616 |
\draw (A1) edge [->, red, line width=1mm] (b); |
|
617 |
\draw (b) edge [->, red, line width=1mm] (A2); |
|
618 |
\draw (A2) edge [skip loop] (A3); |
|
619 |
\draw (A3) edge [->, red, line width=1mm] (cs2); |
|
620 |
\draw (cs2) edge [->,red, line width=1mm] (A4); |
|
621 |
\node [below=of cs1] {\raisebox{-5mm}{\small{}conditional jump}};} |
|
622 |
\end{tikzpicture} |
|
623 |
\end{center} |
|
624 |
||
625 |
\begin{center} |
|
626 |
\begin{tabular}{lcl} |
|
627 |
\texttt{Bop("==", a1, a2)} & $\Rightarrow$ & \texttt{...if\_icmpne...}\\ |
|
628 |
\texttt{Bop("!=", a1, a2)} & $\Rightarrow$ & \texttt{...if\_icmpeq...}\\ |
|
629 |
\texttt{Bop("<", a1, a2)} & $\Rightarrow$ & \texttt{...if\_icmpge...}\\ |
|
630 |
\texttt{Bop("<=", a1, a2)} & $\Rightarrow$ & \texttt{...if\_icmpgt...}\\ |
|
631 |
\end{tabular} |
|
632 |
\end{center} |
|
633 |
||
634 |
\end{frame} |
|
635 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
636 |
||
637 |
||
638 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
639 |
\begin{frame}[t] |
|
640 |
\frametitle{Compiling Ifs} |
|
641 |
||
642 |
{\Large\bl{if $b$ then $cs_1$ else $cs_2$}} |
|
643 |
||
644 |
\begin{center} |
|
645 |
\bl{\begin{tabular}{lcl} |
|
646 |
$\text{compile}(\text{if}\;b\;\text{then}\; cs_1\;\text{else}\; cs_2, E)$ & $\dn$\\ |
|
647 |
\multicolumn{3}{l}{$\quad l_{ifelse}\;$ \textcolor{black}{(fresh label)}}\\ |
|
648 |
\multicolumn{3}{l}{$\quad l_{ifend}\;$ \textcolor{black}{(fresh label)}}\\ |
|
649 |
\multicolumn{3}{l}{$\quad (is_1, E') = \text{compile}(cs_1, E)$}\\ |
|
650 |
\multicolumn{3}{l}{$\quad (is_2, E'') = \text{compile}(cs_2, E')$}\\ |
|
651 |
\multicolumn{3}{l}{$\quad(\text{compile}(b, E, l_{ifelse})$}\\ |
|
652 |
\multicolumn{3}{l}{$\quad\phantom{(}@\;is_1$}\\ |
|
653 |
\multicolumn{3}{l}{$\quad\phantom{(}@\; \text{goto}\;l_{ifend}$}\\ |
|
654 |
\multicolumn{3}{l}{$\quad\phantom{(}@\;l_{ifelse}:$}\\ |
|
655 |
\multicolumn{3}{l}{$\quad\phantom{(}@\;is_2$}\\ |
|
656 |
\multicolumn{3}{l}{$\quad\phantom{(}@\;l_{ifend}:, E'')$}\\ |
|
657 |
\end{tabular}} |
|
658 |
\end{center} |
|
659 |
||
660 |
\end{frame} |
|
661 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
662 |
||
663 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
664 |
\begin{frame}[t] |
|
665 |
\frametitle{Compiling Whiles} |
|
666 |
||
667 |
{\Large\bl{$\text{while}\;b\;\text{do}\;cs$}}\bigskip\bigskip |
|
668 |
||
669 |
\onslide<2->{Case }\only<2>{{\bf True}:}\only<3>{{\bf False}:} |
|
670 |
||
671 |
\begin{center} |
|
672 |
\begin{tikzpicture}[node distance=2mm and 4mm, |
|
673 |
block/.style={rectangle, minimum size=1cm, draw=black, line width=1mm}, |
|
674 |
point/.style={rectangle, inner sep=0mm, minimum size=0mm, fill=red}, |
|
675 |
skip loop/.style={red, line width=1mm, to path={-- ++(0,-10mm) -| (\tikztotarget)}}] |
|
676 |
\node (A0) [point, left=of A1] {}; |
|
677 |
\node (A1) [point] {}; |
|
678 |
\node (b) [block, right=of A1] {code of \bl{$b$}}; |
|
679 |
\node (A2) [point, right=of b] {}; |
|
680 |
\node (cs1) [block, right=of A2] {code of \bl{$cs$}}; |
|
681 |
\node (A3) [point, right=of cs1] {}; |
|
682 |
\node (A4) [point, right=of A3] {}; |
|
683 |
||
684 |
\only<2>{ |
|
685 |
\draw (A0) edge [->, red, line width=1mm] (b); |
|
686 |
\draw (b) edge [->, red, line width=1mm] (cs1); |
|
687 |
\draw (cs1) edge [->, red, line width=1mm] (A3); |
|
688 |
\draw (A3) edge [->,skip loop] (A1);} |
|
689 |
\only<3>{ |
|
690 |
\draw (A0) edge [->, red, line width=1mm] (b); |
|
691 |
\draw (b) edge [->, red, line width=1mm] (A2); |
|
692 |
\draw (A2) edge [skip loop] (A3); |
|
693 |
\draw (A3) edge [->, red, line width=1mm] (A4);} |
|
694 |
\end{tikzpicture} |
|
695 |
\end{center} |
|
696 |
||
697 |
\end{frame} |
|
698 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
699 |
||
700 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
701 |
\begin{frame}[t] |
|
702 |
\frametitle{Compiling Whiles} |
|
703 |
||
704 |
{\Large\bl{while $b$ do $cs$}} |
|
705 |
||
706 |
\begin{center} |
|
707 |
\bl{\begin{tabular}{lcl} |
|
708 |
$\text{compile}(\text{while}\; b\; \text{do} \;cs, E)$ & $\dn$\\ |
|
709 |
\multicolumn{3}{l}{$\quad l_{wbegin}\;$ \textcolor{black}{(fresh label)}}\\ |
|
710 |
\multicolumn{3}{l}{$\quad l_{wend}\;$ \textcolor{black}{(fresh label)}}\\ |
|
711 |
\multicolumn{3}{l}{$\quad (is, E') = \text{compile}(cs_1, E)$}\\ |
|
712 |
\multicolumn{3}{l}{$\quad(l_{wbegin}:$}\\ |
|
713 |
\multicolumn{3}{l}{$\quad\phantom{(}@\;\text{compile}(b, E, l_{wend})$}\\ |
|
714 |
\multicolumn{3}{l}{$\quad\phantom{(}@\;is$}\\ |
|
715 |
\multicolumn{3}{l}{$\quad\phantom{(}@\; \text{goto}\;l_{wbegin}$}\\ |
|
716 |
\multicolumn{3}{l}{$\quad\phantom{(}@\;l_{wend}:, E')$}\\ |
|
717 |
\end{tabular}} |
|
718 |
\end{center} |
|
719 |
||
720 |
\end{frame} |
|
721 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
722 |
||
723 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
724 |
\begin{frame}[c,fragile] |
|
725 |
\frametitle{Compiling Whiles} |
|
726 |
||
727 |
For example |
|
728 |
||
729 |
\begin{lstlisting}[mathescape,numbers=none,language=While] |
|
730 |
while x <= 10 do x := x + 1 |
|
731 |
\end{lstlisting} |
|
732 |
||
733 |
||
734 |
\begin{center} |
|
735 |
\begin{lstlisting}[mathescape,language=JVMIS,numbers=none] |
|
736 |
L_wbegin: $\quad\tikz[remember picture] \node[] (LB) {\mbox{}};$ |
|
737 |
iload 0 |
|
738 |
ldc 10 |
|
739 |
if_icmpgt L_wend $\quad\tikz[remember picture] \node (LC) {\mbox{}};$ |
|
740 |
iload 0 |
|
741 |
ldc 1 |
|
742 |
iadd |
|
743 |
istore 0 |
|
744 |
goto L_wbegin $\quad\tikz[remember picture] \node (LA) {\mbox{}};$ |
|
745 |
L_wend: $\quad\tikz[remember picture] \node[] (LD) {\mbox{}};$ |
|
746 |
\end{lstlisting} |
|
747 |
\end{center} |
|
748 |
||
749 |
\begin{tikzpicture}[remember picture,overlay] |
|
750 |
\draw[->,very thick] (LA) edge [->,to path={-- ++(12mm,0mm) |
|
751 |
-- ++(0mm,17.3mm) |- (\tikztotarget)},line width=1mm] (LB.east); |
|
752 |
\draw[->,very thick] (LC) edge [->,to path={-- ++(12mm,0mm) |
|
753 |
-- ++(0mm,-17.3mm) |- (\tikztotarget)},line width=1mm] (LD.east); |
|
754 |
\end{tikzpicture} |
|
755 |
||
756 |
\end{frame} |
|
757 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
758 |
||
759 |
||
760 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
761 |
\begin{frame}[c,fragile] |
|
762 |
\frametitle{Compiling Writes} |
|
763 |
||
764 |
\small |
|
765 |
\begin{lstlisting}[language=JVMIS,mathescape, |
|
766 |
numbers=none,xleftmargin=-6mm] |
|
767 |
.method public static write(I)V |
|
768 |
.limit locals 1 |
|
769 |
.limit stack 2 |
|
770 |
getstatic java/lang/System/out |
|
771 |
Ljava/io/PrintStream; |
|
772 |
iload 0 |
|
773 |
invokevirtual java/io/PrintStream/println(I)V |
|
774 |
return |
|
775 |
.end method |
|
776 |
||
777 |
||
778 |
||
779 |
iload $E(x)$ |
|
780 |
invokestatic XXX/XXX/write(I)V |
|
781 |
\end{lstlisting} |
|
782 |
||
783 |
\end{frame} |
|
784 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
785 |
||
786 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
787 |
\begin{frame}[c,fragile] |
|
788 |
\frametitle{Compiling Main} |
|
789 |
||
790 |
\footnotesize |
|
791 |
\begin{lstlisting}[language=JVMIS,mathescape, |
|
792 |
numbers=none,xleftmargin=-6mm] |
|
793 |
.class public XXX.XXX |
|
794 |
.super java/lang/Object |
|
795 |
||
796 |
.method public <init>()V |
|
797 |
aload_0 |
|
798 |
invokenonvirtual java/lang/Object/<init>()V |
|
799 |
return |
|
800 |
.end method |
|
801 |
||
802 |
.method public static main([Ljava/lang/String;)V |
|
803 |
.limit locals 200 |
|
804 |
.limit stack 200 |
|
805 |
||
806 |
$\textit{\ldots{}here comes the compiled code\ldots}$ |
|
807 |
||
808 |
return |
|
809 |
.end method |
|
810 |
\end{lstlisting} |
|
811 |
||
812 |
\end{frame} |
|
813 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
814 |
||
815 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
816 |
\begin{frame}[c] |
|
686 | 817 |
\frametitle{Next Compiler Phases} |
608 | 818 |
|
819 |
\begin{itemize} |
|
820 |
\item assembly $\Rightarrow$ byte code (class file) |
|
821 |
\item labels $\Rightarrow$ absolute or relative jumps\bigskip\bigskip |
|
822 |
\item \texttt{javap} is a disassembler for class files |
|
686 | 823 |
\item jasmin and krakatau are assemblers for jvm code |
369
43c0ed473720
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
302
diff
changeset
|
824 |
\end{itemize} |
43c0ed473720
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
302
diff
changeset
|
825 |
|
686 | 826 |
\end{frame} |
608 | 827 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
828 |
||
829 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
830 |
\begin{frame}[t] |
|
686 | 831 |
\frametitle{Recall: Interpreted Code} |
832 |
||
833 |
\begin{center} |
|
834 |
\begin{tikzpicture} |
|
835 |
\begin{axis}[axis x line=bottom, axis y line=left, xlabel=n, ylabel=secs, legend style=small] |
|
836 |
\addplot+[smooth] file {interpreted.data}; |
|
837 |
\end{axis} |
|
838 |
\end{tikzpicture} |
|
839 |
\end{center} |
|
840 |
||
841 |
Loop program |
|
842 |
\end{frame} |
|
843 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
844 |
||
845 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
846 |
\begin{frame}[t] |
|
847 |
\frametitle{Compiled Code} |
|
608 | 848 |
|
849 |
\begin{center} |
|
850 |
\begin{tikzpicture} |
|
851 |
\begin{axis}[axis x line=bottom, axis y line=left, xlabel=n, ylabel=secs, legend style=small] |
|
852 |
\addplot+[smooth] file {compiled.data}; |
|
853 |
\end{axis} |
|
854 |
\end{tikzpicture} |
|
855 |
\end{center} |
|
856 |
||
686 | 857 |
\end{frame} |
608 | 858 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
859 |
||
860 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
861 |
\begin{frame}[t] |
|
686 | 862 |
\frametitle{Compiler vs.~Interpreter} |
608 | 863 |
|
864 |
\begin{center} |
|
865 |
\begin{tikzpicture} |
|
866 |
\begin{axis}[axis x line=bottom, axis y line=left, ylabel=secs, |
|
867 |
xlabel=n, |
|
868 |
enlargelimits=0.05, |
|
869 |
ybar interval=0.7, legend style=small] |
|
870 |
\addplot file {interpreted2.data}; |
|
871 |
\addplot file {compiled2.data}; |
|
872 |
%\legend{interpreted, compiled} |
|
873 |
\end{axis} |
|
874 |
\end{tikzpicture} |
|
875 |
\end{center} |
|
876 |
||
686 | 877 |
\end{frame} |
608 | 878 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
879 |
||
880 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
686 | 881 |
\begin{frame}[c] |
882 |
\frametitle{A ``Compiler'' for BF*** to C} |
|
883 |
||
884 |
\begin{center} |
|
885 |
\begin{tabular}{lcl} |
|
886 |
\bl{\texttt{>}} & $\Rightarrow$ & \texttt{ptr++}\\ |
|
887 |
\bl{\texttt{<}} & $\Rightarrow$ & \texttt{ptr--}\\ |
|
888 |
\bl{\texttt{+}} & $\Rightarrow$ & \texttt{(*ptr)++}\\ |
|
889 |
\bl{\texttt{-}} & $\Rightarrow$ & \texttt{(*ptr)--}\\ |
|
890 |
\bl{\texttt{.}} & $\Rightarrow$ & \texttt{putchar(*ptr)}\\ |
|
891 |
\bl{\texttt{,}} & $\Rightarrow$ & \texttt{*ptr = getchar()}\\ |
|
892 |
\bl{\texttt{[}} & $\Rightarrow$ & \texttt{while(*ptr)\{}\\ |
|
893 |
\bl{\texttt{]}} & $\Rightarrow$ & \texttt{\}}\medskip\\ |
|
894 |
& $\Rightarrow$ & ignore everything else\\ |
|
895 |
\end{tabular} |
|
896 |
\end{center}\bigskip |
|
897 |
||
898 |
\texttt{char field[30000]\\ char *ptr = \&field[15000]} |
|
899 |
||
900 |
\end{frame} |
|
901 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
902 |
||
903 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
904 |
\begin{frame}[c,fragile] |
|
905 |
\frametitle{BF***} |
|
906 |
||
907 |
we need some big array, say \texttt{arr} and 7 (8) instructions:\medskip |
|
908 |
||
909 |
\begin{itemize} |
|
910 |
\item \texttt{>} move \texttt{ptr++} |
|
911 |
\item \texttt{<} move \texttt{ptr-{}-} |
|
912 |
\item \texttt{+} add \texttt{arr[ptr]++} |
|
913 |
\item \texttt{-} subtract \texttt{arr[ptr]-{}-} |
|
914 |
\item \texttt{.} print out \texttt{arr[ptr]} as ASCII |
|
915 |
\item \texttt{[} if \texttt{arr[ptr] == 0} jump just after the corresponding \texttt{]}; otherwise \texttt{ptr++} |
|
916 |
\item \texttt{]} if \texttt{arr[ptr] != 0} jump just after the corresponding \texttt{[}; otherwise \texttt{ptr++} |
|
917 |
||
918 |
\end{itemize} |
|
919 |
||
920 |
\end{frame} |
|
921 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
922 |
||
923 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
924 |
\begin{frame}[c,fragile] |
|
925 |
\frametitle{Arrays in While} |
|
926 |
||
927 |
\begin{itemize} |
|
928 |
\item \texttt{new arr[15000]}\medskip |
|
929 |
\item \texttt{x := 3 + arr[3 + y]}\medskip |
|
930 |
\item \texttt{arr[42 * n] := ...} |
|
931 |
\end{itemize} |
|
932 |
||
933 |
\end{frame} |
|
934 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
935 |
||
936 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
937 |
\begin{frame}[c,fragile] |
|
938 |
\frametitle{New Arrays} |
|
939 |
||
940 |
\begin{lstlisting}[mathescape,numbers=none,language=While] |
|
941 |
new arr[number] |
|
942 |
\end{lstlisting}\bigskip\bigskip |
|
943 |
||
944 |
\begin{lstlisting}[mathescape,numbers=none,language=JVMIS] |
|
945 |
ldc number |
|
946 |
newarray int |
|
947 |
astore loc_var |
|
948 |
\end{lstlisting} |
|
949 |
||
950 |
||
951 |
\end{frame} |
|
952 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
953 |
||
954 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
955 |
\begin{frame}[c,fragile] |
|
956 |
\frametitle{Array Update} |
|
957 |
||
958 |
\begin{lstlisting}[mathescape,numbers=none,language=While] |
|
959 |
arr[...] := |
|
960 |
\end{lstlisting}\bigskip\bigskip |
|
961 |
||
962 |
\begin{lstlisting}[mathescape,numbers=none,language=JVMIS] |
|
963 |
aload loc_var |
|
964 |
index_aexp |
|
965 |
value_aexp |
|
966 |
iastore |
|
967 |
\end{lstlisting} |
|
968 |
||
969 |
||
970 |
\end{frame} |
|
971 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
972 |
||
973 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
974 |
\begin{frame}[c,fragile] |
|
975 |
\frametitle{Array Lookup in AExp} |
|
976 |
||
977 |
\begin{lstlisting}[mathescape,numbers=none,language=While] |
|
978 |
...arr[...]... |
|
979 |
\end{lstlisting}\bigskip\bigskip |
|
980 |
||
981 |
\begin{lstlisting}[mathescape,numbers=none,language=JVMIS] |
|
982 |
aload loc_var |
|
983 |
index_aexp |
|
984 |
iaload |
|
985 |
\end{lstlisting} |
|
986 |
||
987 |
||
988 |
\end{frame} |
|
989 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
990 |
||
991 |
||
992 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
608 | 993 |
\mode<presentation>{ |
994 |
\begin{frame}[c] |
|
995 |
\frametitle{Backend} |
|
996 |
||
997 |
\begin{center} |
|
998 |
\begin{tikzpicture} |
|
999 |
\node (rexp) {\bl{\bf Lexer}}; |
|
1000 |
\node (nfa) [right=of rexp] {\bl{\bf Parser}}; |
|
1001 |
\node (dfa) [right=of nfa] {\bl{\begin{tabular}{c}\bf Optimizations\end{tabular}}}; |
|
1002 |
\path[->, red, line width=2mm] (rexp) edge node [above=4mm, black] {\begin{tabular}{c@{\hspace{9mm}}}token\\[-1mm] |
|
1003 |
sequence\end{tabular}} (nfa); |
|
1004 |
\node (final) [below=of dfa] {\bl{\begin{tabular}{c}\bf Machine Code/\\\bf Byte Code\end{tabular}}}; |
|
1005 |
\path[->, red, line width=2mm] (nfa) edge node [above=4mm, black] {\begin{tabular}{c}parse\\[-1mm] tree |
|
1006 |
\end{tabular}}(dfa); |
|
1007 |
\path[->, red, line width=2mm] (dfa) edge (final); |
|
1008 |
\end{tikzpicture}\\ |
|
1009 |
\end{center} |
|
1010 |
||
1011 |
\end{frame}} |
|
369
43c0ed473720
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
302
diff
changeset
|
1012 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
43c0ed473720
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
302
diff
changeset
|
1013 |
|
608 | 1014 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1015 |
\mode<presentation>{ |
|
1016 |
\begin{frame}[t] |
|
1017 |
\frametitle{\begin{tabular}{c}What is Next\end{tabular}} |
|
1018 |
||
1019 |
\begin{itemize} |
|
1020 |
\item register spilling |
|
1021 |
\item dead code removal |
|
1022 |
\item loop optimisations |
|
1023 |
\item instruction selection |
|
1024 |
\item type checking |
|
1025 |
\item concurrency |
|
1026 |
\item fuzzy testing |
|
1027 |
\item verification\bigskip\\ |
|
1028 |
||
1029 |
\item GCC, LLVM, tracing JITs |
|
1030 |
\end{itemize} |
|
1031 |
||
1032 |
\end{frame}} |
|
1033 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
1034 |
||
184
2e9134d25a2b
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
173
diff
changeset
|
1035 |
|
63 | 1036 |
\end{document} |
1037 |
||
1038 |
%%% Local Variables: |
|
1039 |
%%% mode: latex |
|
1040 |
%%% TeX-master: t |
|
1041 |
%%% End: |
|
1042 |