# HG changeset patch # User Christian Urban # Date 1354086035 0 # Node ID 06c3ec0b452ef567a00d73b160554b962c42cc10 # Parent ffac240147e2a955fdba1cf01ec9466ae4534f9c updated diff -r ffac240147e2 -r 06c3ec0b452e compile.scala --- a/compile.scala Wed Nov 28 00:06:03 2012 +0000 +++ b/compile.scala Wed Nov 28 07:00:35 2012 +0000 @@ -311,8 +311,8 @@ println(n + " " + time_needed(2, ("java " + class_name + "/" + class_name).!!)) } -//List(1, 5000, 10000, 50000, 100000, 250000, 500000, 750000, 1000000).map(compile_test(_)) -List(1, 200, 400, 600, 800, 1000, 1200, 1400, 1600).map(compile_test(_)) +List(1, 5000, 10000, 50000, 100000, 250000, 500000, 750000, 1000000).map(compile_test(_)) + // javabyte code assmbler diff -r ffac240147e2 -r 06c3ec0b452e slides09.pdf Binary file slides09.pdf has changed diff -r ffac240147e2 -r 06c3ec0b452e slides09.tex --- a/slides09.tex Wed Nov 28 00:06:03 2012 +0000 +++ b/slides09.tex Wed Nov 28 07:00:35 2012 +0000 @@ -579,10 +579,10 @@ \hspace{5mm}if\_icmpeq\;$L_1$\\ $L_2$: \end{tabular}} -\end{center}\pause +\end{center} \begin{textblock}{3.5}(11,12) -labels must be unique +\only<3>{labels must be unique} \end{textblock} \end{frame}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -720,20 +720,66 @@ \end{frame}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\mode{ +\begin{frame}[c] + +\begin{center} +\small\bl{\begin{tabular}{l} +.class public XXX.XXX\\ +.super java/lang/Object\\ +\\ +.method public ()V\\ +\;\; aload\_0\\ +\;\; invokenonvirtual java/lang/Object/()V\\ + \;\; return\\ +.end method\\ +\\ +.method public static main([Ljava/lang/String;)V\\ +\;\; .limit locals 200\\ +\;\; .limit stack 200\\ +\\ + \textcolor{black}{(here comes the compiled code)}\\ +\\ +\;\; return\\ +.end method\\ +\end{tabular}} +\end{center} + +\end{frame}} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \mode{ \begin{frame}[c] \frametitle{\begin{tabular}{c}Next Compiler Phases\end{tabular}} \begin{itemize} -\item assembly $\Rightarrow$ native code -\item labels $\Rightarrow$ absolute or relative addresses - +\item assembly $\Rightarrow$ byte code (class file) +\item labels $\Rightarrow$ absolute or relative jumps\bigskip\bigskip +\item \texttt{javap} is a disassembler for class files \end{itemize} \end{frame}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\mode{ +\begin{frame}[t] +\frametitle{\begin{tabular}{c}Compiled Code\end{tabular}} + +\begin{center} +\begin{tikzpicture} +\begin{axis}[axis x line=bottom, axis y line=left, xlabel=n, ylabel=secs, legend style=small] +\addplot+[smooth] file {compiled.data}; +\end{axis} +\end{tikzpicture} +\end{center} + +\end{frame}} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -760,11 +806,13 @@ \begin{center} \begin{tikzpicture} -\begin{axis}[ylabel=secs, - xlabel=n, enlargelimits=0.05, ybar interval=0.7, legend style=small] +\begin{axis}[axis x line=bottom, axis y line=left, ylabel=secs, + xlabel=n, + enlargelimits=0.05, + ybar interval=0.7, legend style=small] \addplot file {interpreted2.data}; \addplot file {compiled2.data}; -%\legend{interpreted, compiled} +%\legend{interpreted, compiled} \end{axis} \end{tikzpicture} \end{center}