%
% FIXME: - Add something about size limits on the constant pool
%          how we worked around that and the performance impact
%          of -o lessconstants
%        - Add something about encoding data sections as string constants
%          and the UTF8 non-7-bit-ascii penalty 
%

\documentclass[twocolumn]{article}
\usepackage{amssymb,amsmath,epsfig}
\setcounter{page}{1}
\sloppy         % better line breaks

\def\twoauthors#1#2#3#4{\gdef\@address{}
   \gdef\@name{}}

\usepackage{palatino}
\usepackage{parskip}
\bibliographystyle{alpha}

\title{\textbf{\textsf{
Running Legacy C/C++ Libraries in a Pure Java Environment
}}}
\date{}
\author{\begin{tabular}{@{}c@{}}
        {\em {Adam Megacz}} \\ \\
        {The XWT Foundation}\relax
   \end{tabular}\hskip 1in\begin{tabular}{@{}c@{}}
        {\em {Brian Alliet}} \\ \\
        {{\it Affiliation Goes Here}}\relax
\end{tabular}}
\begin{document}

\maketitle

\begin{abstract}
Abstract
\end{abstract}

\section{Introduction}

\subsection{Why would you want to do this?}

\begin{itemize}
\item applets
\item untrusting servlet containers (mass hosting)
\item unsure of deployment architecture
\item JNI not available (ie J2ME)
\item simplicity
\item security against buffer overflows
\item True WORA
\end{itemize}


\section{Existing Work: Source-to-Source Translation}

\section{Mips2Java: Binary-to-Binary Translation}

\subsection{Why MIPS?}

\subsection{Interpreter}

\subsection{Compiler}

\subsection{Advantages (over src2src)}
\begin{itemize}

\item You get to use a {\it real} C/C++ compiler that's been tested
      for over a decade; it won't choke on flaky code.

\item You can keep your existing build scripts and source layout (just
      swap in the new compiler)

\item Zero post-translation tweaking means that you can change the
      library (fix bugs, fix security holes, upgrade) without having
      to remember what tweaks you made last time.

\end{itemize}


\subsection{Virtualization}
\begin{itemize}
\item libc
\item stdin/stdout
\item arvg, argc
\item syscalls
\end{itemize}


\section{Performance}

\subsection{Charts}

(Note that none of these libraries have pure-Java equivalents.)

\begin{itemize}
\item libjpeg
\item libfreetype
\item libmspack
\end{itemize}

\subsection{Optimizations}

\begin{itemize}
\item trampoline
\item optimal method size
\item -msingle-float
\item -mmemcpy
\item fastmem
\item local vars for registers (useless)
\item -fno-rename-registers
\item -ffast-math
\item -fno-trapping-math
\item -fsingle-precision-constant
\item -mfused-madd
\item -freg-struct-return
\item -freduce-all-givs
\item -fno-peephole
\item -fno-peephole2
\item -fmove-all-movables
\item -fno-sched-spec-load
\item -fno-sched-spec
\item -fno-schedule-insns
\item -fno-schedule-insns2
\item -fno-delayed-branch
\item -fno-function-cse
\item -ffunction-sections
\item -fdata-sections
\item array bounds checking
\item -falign-functions=n
\item -falign-labels=n
\item -falign-loops=n
\item -falign-jumps=n
\item -fno-function-cse
\end{itemize}

\section{Future Directions}

\section{Conclusion}

\section{References}


\end{document}

