updated
authorChristian Urban <christian dot urban at kcl dot ac dot uk>
Wed, 28 Nov 2012 07:00:35 +0000
changeset 82 06c3ec0b452e
parent 81 ffac240147e2
child 83 bd61b03b9eaa
updated
compile.scala
slides09.pdf
slides09.tex
--- 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
Binary file slides09.pdf has changed
--- 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<presentation>{
+\begin{frame}[c]
+
+\begin{center}
+\small\bl{\begin{tabular}{l}
+.class public XXX.XXX\\
+.super java/lang/Object\\
+\\
+.method public <init>()V\\
+\;\;     aload\_0\\
+\;\;     invokenonvirtual java/lang/Object/<init>()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<presentation>{
 \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<presentation>{
+\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}