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