Foundations: start subsection on basic block definition
This commit is contained in:
parent
f82ec7f5f6
commit
baebd14466
1 changed files with 41 additions and 0 deletions
|
@ -427,3 +427,44 @@ for large values of $n$ in this manuscript whenever it is clear that this value
|
||||||
is a measure.
|
is a measure.
|
||||||
|
|
||||||
\subsubsection{Basic block of an assembly-level program}
|
\subsubsection{Basic block of an assembly-level program}
|
||||||
|
|
||||||
|
Code analyzers are meant to analyze sections of straight-line code, that is,
|
||||||
|
portions of code which do not contain control flow. As such, it is convenient
|
||||||
|
to split the program into \emph{basic blocks}, that is, portions of
|
||||||
|
straight-line code linked to other basic blocks to reflect control flow. We
|
||||||
|
define this notion here formally, to use it soundly in the following chapters
|
||||||
|
of this manuscript.
|
||||||
|
|
||||||
|
\begin{notation}
|
||||||
|
For the purposes of this section,
|
||||||
|
\begin{itemize}
|
||||||
|
\item we formalize a segment of assembly code as a sequence of
|
||||||
|
instructions;
|
||||||
|
\item we confuse an instruction with its address.
|
||||||
|
\end{itemize}
|
||||||
|
|
||||||
|
\smallskip{}
|
||||||
|
|
||||||
|
An instruction is said to be a \emph{flow-altering instruction} if this
|
||||||
|
address may alter the normal control flow of the program. This is typically
|
||||||
|
true of jumps (conditional or unconditional), function calls, function
|
||||||
|
returns, \ldots
|
||||||
|
|
||||||
|
\smallskip{}
|
||||||
|
|
||||||
|
An address is said to be a \emph{jump site} if any flow-altering
|
||||||
|
instruction in the considered sequence may alter control to this address
|
||||||
|
(and this address is not the natural flow of the program, \eg{} in the case
|
||||||
|
of a conditional jump).
|
||||||
|
\end{notation}
|
||||||
|
|
||||||
|
\begin{definition}[Basic block decomposition]
|
||||||
|
\todo{}
|
||||||
|
\end{definition}
|
||||||
|
|
||||||
|
\begin{remark}
|
||||||
|
This definition gives a direct algorithm to split a segment of assembly
|
||||||
|
code into basic blocks, as long as we have access to a semantics of the
|
||||||
|
considered assembly that indicates whether an instruction is flow-altering,
|
||||||
|
and if so, what are its possible jump sites.
|
||||||
|
\end{remark}
|
||||||
|
|
Loading…
Reference in a new issue