# Changeset 3357 for Papers

Ignore:
Timestamp:
Jun 14, 2013, 4:32:41 PM (6 years ago)
Message:

...

File:
1 edited

### Legend:

Unmodified
 r3356 \autoref{subfig:example_input}). He compiles the program using a special compiler that first inserts in the code three label emission statements (\verb+EMIT L_i+) to mark the beginning of basic blocks statements (\verb+EMIT $L_i$+) to mark the beginning of basic blocks (\autoref{subfig:example_input}); then the compiler compiles the code to machine code (\autoref{subfig:example_oc}), that belong to the corresponding basic block. For example, the cost $k_1$ associated to $L_1$ is the number of cycles required to execute the block $I_3$ and \verb+COND l_2+, while the cost $k_2$ associated to $L_2$ counts the cycles required by the block $I_4$, \verb+GOTO l_1+ and \verb+COND l_2+. The compiler also guarantees $I_3$ and \verb+COND $l_2$+, while the cost $k_2$ associated to $L_2$ counts the cycles required by the block $I_4$, \verb+GOTO $l_1$+ and \verb+COND $l_2$+. The compiler also guarantees that every executed instruction is in the scope of some code emission label, that each scope does not contain loops (to associate a finite cost), and that \begin{subfigure}[t]{.32\linewidth} \begin{lstlisting}[moredelim={[is][\color{red}]{|}{|}}] |EMIT L_1;| |EMIT $L_1$;| $I_1$; for (i=0; i<2; i++) { |EMIT L_2;| |EMIT $L_2$;| $I_2$; } |EMIT L_3;| |EMIT $L_3$;| \end{lstlisting} \caption{The input program (black lines) with its labelling (red lines).} \begin{subfigure}[t]{.23\linewidth} \begin{lstlisting} EMIT L_1 $I_3$ l_1: COND l_2 EMIT L_2 $I_4$ GOTO l_1 l_2: EMIT L_3 EMIT $L_1$ $I_3$ $l_1$:$\!$  COND $l_2$ EMIT $L_2$ $I_4$ GOTO $l_1$ $l_2$:$\!$  EMIT $L_3$ \end{lstlisting} \caption{The output labelled object code.} $I_1$; for (i=0; i<2; i++) { cost += $k_2$; cost += $k_2$; $I_2$; }