577 \hspace{5mm}ldc 1\\ |
577 \hspace{5mm}ldc 1\\ |
578 \hspace{5mm}iadd\\ |
578 \hspace{5mm}iadd\\ |
579 \hspace{5mm}if\_icmpeq\;$L_1$\\ |
579 \hspace{5mm}if\_icmpeq\;$L_1$\\ |
580 $L_2$: |
580 $L_2$: |
581 \end{tabular}} |
581 \end{tabular}} |
582 \end{center}\pause |
582 \end{center} |
583 |
583 |
584 \begin{textblock}{3.5}(11,12) |
584 \begin{textblock}{3.5}(11,12) |
585 labels must be unique |
585 \only<3>{labels must be unique} |
586 \end{textblock} |
586 \end{textblock} |
587 \end{frame}} |
587 \end{frame}} |
588 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
588 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
589 |
589 |
590 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
590 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
718 \end{tabular}} |
718 \end{tabular}} |
719 \end{center} |
719 \end{center} |
720 |
720 |
721 \end{frame}} |
721 \end{frame}} |
722 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
722 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
723 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
723 |
|
724 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
725 \mode<presentation>{ |
|
726 \begin{frame}[c] |
|
727 |
|
728 \begin{center} |
|
729 \small\bl{\begin{tabular}{l} |
|
730 .class public XXX.XXX\\ |
|
731 .super java/lang/Object\\ |
|
732 \\ |
|
733 .method public <init>()V\\ |
|
734 \;\; aload\_0\\ |
|
735 \;\; invokenonvirtual java/lang/Object/<init>()V\\ |
|
736 \;\; return\\ |
|
737 .end method\\ |
|
738 \\ |
|
739 .method public static main([Ljava/lang/String;)V\\ |
|
740 \;\; .limit locals 200\\ |
|
741 \;\; .limit stack 200\\ |
|
742 \\ |
|
743 \textcolor{black}{(here comes the compiled code)}\\ |
|
744 \\ |
|
745 \;\; return\\ |
|
746 .end method\\ |
|
747 \end{tabular}} |
|
748 \end{center} |
|
749 |
|
750 \end{frame}} |
|
751 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
752 |
|
753 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
724 \mode<presentation>{ |
754 \mode<presentation>{ |
725 \begin{frame}[c] |
755 \begin{frame}[c] |
726 \frametitle{\begin{tabular}{c}Next Compiler Phases\end{tabular}} |
756 \frametitle{\begin{tabular}{c}Next Compiler Phases\end{tabular}} |
727 |
757 |
728 \begin{itemize} |
758 \begin{itemize} |
729 \item assembly $\Rightarrow$ native code |
759 \item assembly $\Rightarrow$ byte code (class file) |
730 \item labels $\Rightarrow$ absolute or relative addresses |
760 \item labels $\Rightarrow$ absolute or relative jumps\bigskip\bigskip |
731 |
761 \item \texttt{javap} is a disassembler for class files |
732 \end{itemize} |
762 \end{itemize} |
733 |
763 |
734 \end{frame}} |
764 \end{frame}} |
735 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
765 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
766 |
|
767 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
768 \mode<presentation>{ |
|
769 \begin{frame}[t] |
|
770 \frametitle{\begin{tabular}{c}Compiled Code\end{tabular}} |
|
771 |
|
772 \begin{center} |
|
773 \begin{tikzpicture} |
|
774 \begin{axis}[axis x line=bottom, axis y line=left, xlabel=n, ylabel=secs, legend style=small] |
|
775 \addplot+[smooth] file {compiled.data}; |
|
776 \end{axis} |
|
777 \end{tikzpicture} |
|
778 \end{center} |
|
779 |
|
780 \end{frame}} |
|
781 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
736 |
782 |
737 |
783 |
738 |
784 |
739 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
785 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
740 \mode<presentation>{ |
786 \mode<presentation>{ |
758 \begin{frame}[t] |
804 \begin{frame}[t] |
759 \frametitle{\begin{tabular}{c}Compiled vs.~Interpreted Code\end{tabular}} |
805 \frametitle{\begin{tabular}{c}Compiled vs.~Interpreted Code\end{tabular}} |
760 |
806 |
761 \begin{center} |
807 \begin{center} |
762 \begin{tikzpicture} |
808 \begin{tikzpicture} |
763 \begin{axis}[ylabel=secs, |
809 \begin{axis}[axis x line=bottom, axis y line=left, ylabel=secs, |
764 xlabel=n, |
810 xlabel=n, |
765 enlargelimits=0.05, |
811 enlargelimits=0.05, |
766 ybar interval=0.7, legend style=small] |
812 ybar interval=0.7, legend style=small] |
767 \addplot file {interpreted2.data}; |
813 \addplot file {interpreted2.data}; |
768 \addplot file {compiled2.data}; |
814 \addplot file {compiled2.data}; |