[pypy-commit] extradoc extradoc: explain the compact bit representation

cfbolz noreply at buildbot.pypy.org
Fri Jul 20 11:03:56 CEST 2012


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: extradoc
Changeset: r4312:00d9d5bdf828
Date: 2012-07-19 08:56 +0200
http://bitbucket.org/pypy/extradoc/changeset/00d9d5bdf828/

Log:	explain the compact bit representation

diff --git a/talk/vmil2012/paper.tex b/talk/vmil2012/paper.tex
--- a/talk/vmil2012/paper.tex
+++ b/talk/vmil2012/paper.tex
@@ -228,6 +228,27 @@
 Therefore if two guards are generated from code in the same function
 the resume data of the rest of the stack can be reused.
 
+In addition to sharing as much as possible between subsequent guards
+a compact representation of the local variables of symbolic frames is used.
+Every variable in the symbolic frame is encoded using two bytes.
+Two bits are used as a tag to denote where the value of the variable
+comes from.
+The remaining 14 bits are a payload that depends on the tag bits.
+
+The possible source of information are:
+
+\begin{itemize}
+    \item For small integer constants
+        the payload contains the value of the constant.
+    \item For other constants
+        the payload contains an index into a per-loop list of constants.
+    \item For SSA variables,
+        the payload is the number of the variable.
+    \item For virtuals,
+        the payload is an index into a list of virtuals, see next section.
+\end{itemize}
+
+
 \subsection{Interaction With Optimization}
 \label{sub:optimization}
 
@@ -273,6 +294,8 @@
 in the same way that the local variables of symbolic frames are described.
 The fields of the virtual objects can therefore be SSA variables, constants
 or other virtual objects.
+They are encoded using the same compact two-byte representation
+as local variables.
 
 During the storing of resume data virtual objects are also shared
 between subsequent guards as much as possible.
@@ -282,20 +305,6 @@
 
 % subsection Interaction With Optimization (end)
 
-* High level handling of resumedata
-
-- frames consist of a PC and local variables
-
-compression approaches:
-- use fact that outer frames don't change in the part of the trace that is in the inner frame
-- compact bit-representation for constants/ssa vars
-
-interaction with optimization
-- guard coalescing
-- virtuals
-  - most virtuals not changed between guards
-
-
    * tracing and attaching bridges and throwing away resume data
    * compiling bridges
 \bivab{mention that the failargs also go into the bridge}


More information about the pypy-commit mailing list