Added control flow graph and trace tree.

parent ca1df2da
...@@ -16,6 +16,7 @@ clean: ...@@ -16,6 +16,7 @@ clean:
compile: presentation.pdf compile: presentation.pdf
highlight: basic-example.tex highlight: basic-example.tex
$(MAKE) -C code
%.pdf: %.tex %.pdf: %.tex
pdflatex $^ pdflatex $^
......
# Sander van Veen - 6167969 - University of Amsterdam - <sandervv@gmail.com>
#
# Basic Makefile used to simplify the compilation. Running "make" (without any
# arguments) from the command line will build the report for this assignment.
#
.PHONY: all clean highlight
SHELL := /bin/bash
all: highlight
clean:
rm -vf *.tex
highlight: cfg-example.tex
cfg-example.tex: cfg-example.js
pygmentize -O style=colorful -o $@ $^
function A(x) {
y = 0; // 1
do { // 2
if( x > 42 ) {
if( y > 1000 ) { // 3
return x; // 7
}
}
else {
y++; // 4
}
}
while( ++x < 1000 ); // 5
return y; // 6
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
\usepackage[dutch]{babel} \usepackage[dutch]{babel}
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
\usepackage{beamerthemesplit} \usepackage{beamerthemesplit}
\usepackage{graphics,url,float} \usepackage{graphics,booktabs,url,float}
\definecolor{kugreen}{RGB}{110,131,163} \definecolor{kugreen}{RGB}{110,131,163}
\setbeamercovered{transparent} \setbeamercovered{transparent}
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
\subtitle{Executing typeless, dynamic languages faster} \subtitle{Executing typeless, dynamic languages faster}
\author{Sander van Veen} \author{Sander van Veen}
\institute{Universiteit van Amsterdam} \institute{Universiteit van Amsterdam}
\date{10 april 2011} \date{2 mei 2011}
\begin{document} \begin{document}
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
\begin{itemize} \begin{itemize}
\item Typeless: objecten of primitieven. \item Typeless: objecten of primitieven.
\item Dynamic: alles kan veranderen. \item Dynamic: alles kan \emph{at runtime} veranderen.
\end{itemize} \end{itemize}
JavaScript voorbeeld: JavaScript voorbeeld:
...@@ -89,20 +89,21 @@ ...@@ -89,20 +89,21 @@
Firefox gebruikt 64 bits voor alle types: Firefox gebruikt 64 bits voor alle types:
\begin{center} \begin{center}
\begin{tabular}{|l|ll|}\hline \begin{tabular}{l|ll} \toprule
JavaScript waarde & eerste 32 bits & laatste 32 bits \\ \hline JavaScript waarde & eerste 32 bits & laatste 32 bits \\ \midrule
37 & INTEGER\_TAG & 37 \\ \hline 42 & INTEGER\_TAG & 42 \\
"hi" & STRING\_TAG & 0x20506638 \\ \hline "hi" & STRING\_TAG & 0x20506638 \\
\{key: "value"\} & OBJECT\_TAG & 0x86753090 \\ \hline \{key: "value"\} & OBJECT\_TAG & 0x86753090 \\
3.1415 & 0x400921CA & 0xC083126F \\ \hline 3.1415 & 0x400921CA & 0xC083126F \\ \bottomrule
\end{tabular} \end{tabular}
\end{center} \end{center}
``NaN unboxing'' zorgt voor onderscheid TAGs en double: ``NaN unboxing'' is de techniek voor onderscheid in variabel typen:
\begin{itemize} \begin{itemize}
\item Double: sign 1 bit, exponent 11 bits en mantissa 52 bits. \item Double: sign 1 bit, exponent 11 bits en mantissa 52 bits.
\item IEEE 754: alle exponent bits 1 $\rightarrow$ float is \texttt{NaN} of $\pm \infty$. \item IEEE 754: alle exponent bits op 1 $\rightarrow$ float is \texttt{NaN}
of $\pm \infty$.
\item Dus: bij \texttt{NaN} bepalen de 14 bits na de exponent de TAG. \item Dus: bij \texttt{NaN} bepalen de 14 bits na de exponent de TAG.
\end{itemize} \end{itemize}
...@@ -122,17 +123,54 @@ ...@@ -122,17 +123,54 @@
\begin{itemize} \begin{itemize}
\pause \item Interpreter \pause \item Interpreter
\pause \item Method Just-In-Time compiler (JägerMonkey) \pause \item Method Just-In-Time compiler (JägerMonkey)
\pause \item \alert{Trace Just-In-Time compiler (TraceMonkey)} \pause \item \alert{Trace compiler (TraceMonkey)}
\end{itemize} \end{itemize}
\end{itemize} \end{itemize}
} % }}} } % }}}
\frame { \frametitle{Trace Just-In-Time compiler} % {{{
\frame { \frametitle{Control flow graph} % {{{
\begin{columns}[t]
\column{.6\textwidth}
\textbf{Code voorbeeld}
\input{code/cfg-example.tex}
\column{.4\textwidth}
\textbf{Control flow graph van A}
\includegraphics[width=6cm]{images/control-flow-graph.pdf}
\end{columns}
} % }}} } % }}}
% \includegraphics[width=10cm]{images/toetspagina-1.png} \frame { \frametitle{Trace vs Just-In-Time compiler} % {{{
\begin{columns}[t]
\column{.5\textwidth}
\textbf{Trace compiler}
\begin{itemize}
\item Eenheid is een ``loop''.
\item Benodigd: Traces opnemen.
\includegraphics[width=6cm]{images/trace-tree.pdf}
\end{itemize}
\column{.5\textwidth}
\textbf{Just-In-Time compiler}
\begin{itemize}
\item Eenheid is een ``method''.
\item Benodigd: Control flow graph.
\includegraphics[width=6cm]{images/control-flow-graph.pdf}
\end{itemize}
\end{columns}
} % }}}
\end{document} \end{document}
% vim: foldmethod=marker % vim: foldmethod=marker
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment