next up previous contents
Next: Translation of a multiarray Up: Compilation Strategies for HPJava Previous: Pre-translation   Contents


Basic Translation Scheme

After the pre-translator converts an HPJava program to a suitable restricted form, the translator will start its actual functionality. This section will introduce basic, but unoptimized translation strategies that the current HPJava translator adopts. Prior to describing the actual translation strategies, we will introduce some translation functions. The detailed and specific definitions for each will be described in the following subsections. A function, $ {\bf T}\left[{e}\right]$, on expression terms returns the result of translating an expression $ e$, assuming that the expression is not a multiarray. Translation functions for multiarray-expressions are more complicated. In the previous section, we defined a subset of composite multiarray-valued expressions. The remaining non-composite multiarray-valued expressions are: The composite expressions only appear in restricted contexts and do not have translation functions in their own right (instead they are effectively handled as part of the translation of a top-level assignment statements). For non-composite multiarray-valued expressions there are $ 2 + R$ separate parts of the evaluation: $ {\bf T}_{\mbox{\small dat}}\left[{e}\right]$, $ {\bf T}_{\mbox{\small bas}}\left[{e}\right]$ and $ {\bf T}_{0}\left[{e}\right]$, ..., $ {\bf T}_{R-1}\left[{e}\right]$, where $ R$ is the rank of the array. The interpretation of these separate terms will be given in the following sections. Finally the translation function for statements, $ {\bf T}\left[{S}\left\vert{p}\right.\right]$, translates the statement or block $ S$ in the context of $ p$ as active process group. In the scheme given below for translation of statements we will just use the name apg to refer to the effective active process group. Hence a schema of the form

$\displaystyle \begin{minipage}[t]{\linewidth}\small\begin{tabbing}
\textbf{SOU...
...
\\
\textbf{TRANSLATION:} \\
\verb$ $$S'$
\end{tabbing}
\end{minipage}
$

should be read more precisely as

$\displaystyle \begin{minipage}[t]{\linewidth}\small\begin{tabbing}
\textbf{SOU...
...apg}}\right.\right] \quad \equiv \quad S'$\ \\
\end{tabbing}
\end{minipage}
$

Here we will describe important translation schemata. The full version of translation scheme for HPJava in [9] involves perhaps a couple of dozen such schemata of varying complexity.

Subsections
next up previous contents
Next: Translation of a multiarray Up: Compilation Strategies for HPJava Previous: Pre-translation   Contents
Bryan Carpenter 2004-06-09