comparison doc/manual/manual_design.tex @ 0:3e629dc19168

initial from svn dyncall-1745
author Daniel Adler
date Thu, 19 Mar 2015 22:24:28 +0100
parents
children b47168dacba6
comparison
equal deleted inserted replaced
-1:000000000000 0:3e629dc19168
1 %//////////////////////////////////////////////////////////////////////////////
2 %
3 % Copyright (c) 2007,2009 Daniel Adler <dadler@uni-goettingen.de>,
4 % Tassilo Philipp <tphilipp@potion-studios.com>
5 %
6 % Permission to use, copy, modify, and distribute this software for any
7 % purpose with or without fee is hereby granted, provided that the above
8 % copyright notice and this permission notice appear in all copies.
9 %
10 % THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 % WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 % MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 % ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 % WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 % ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 % OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 %
18 %//////////////////////////////////////////////////////////////////////////////
19
20 \newpage
21 \section{Library Design}
22
23
24 \subsection{Design considerations}
25
26 The \product{dyncall} library encapsulates function call invocation semantics
27 that depend on the compiler, operating system and architecture.
28 The core library is driven by a function call invocation engine,
29 named \emph{CallVM}, that encapsulates a call stack to foreign functions
30 and manages the following three phases that constitute a truly dynamic function
31 call:
32
33 \begin{enumerate}
34 \item Specify the calling convention. Some run-time platforms, such as
35 Microsoft Windows on a 32-bit X86 architecture, even support multiple calling
36 conventions.
37 \item Specify the function call arguments in a specific order. The
38 interface design dictates a \emph{left to right} order for C and C++ function
39 calls in which the arguments are bound.
40 \item Specify the target function address, expected return value and
41 invoke the function call.
42 \end{enumerate}
43
44 The calling convention mode entirely depends on the way the foreign function
45 has been compiled and specifies the low-level details on how a function
46 actually expects input parameters (in memory, in registers or both) and how to
47 return its result(s).
48
49