[pypy-commit] extradoc extradoc: merge

fijal pypy.commits at gmail.com
Sun Apr 3 04:43:17 EDT 2016


Author: fijal
Branch: extradoc
Changeset: r5627:cf47f49e413a
Date: 2016-04-03 09:43 +0100
http://bitbucket.org/pypy/extradoc/changeset/cf47f49e413a/

Log:	merge

diff too long, truncating to 2000 out of 2393 lines

diff --git a/talk/bucharest2016/jit-backend-8vhY1ArTsh.txt b/talk/bucharest2016/jit-backend-8vhY1ArTsh.txt
new file mode 100644
--- /dev/null
+++ b/talk/bucharest2016/jit-backend-8vhY1ArTsh.txt
@@ -0,0 +1,119 @@
+pypy's assembler backend
+
+input: linear sequence of instructions, called a "trace".
+
+A trace is a sequence of instructions in SSA form.  Most instructions correspond to one or a few CPU-level instructions.  There are a few meta-instructions like `label` and debugging stuff.  All branching is done with guards, which are instructions that check that a condition is true and exit the trace if not.  A failing guard can have a new trace added to it later, called a "bridge".  A patched guard becomes a direct `Jcond` instruction going to the bridge, with no indirection, no register spilling, etc.
+
+A trace ends with either a `return` or a `jump to label`.  The target label is either inside the same trace, or in some older one.  For historical reasons we call a "loop" a trace that is not a bridge.  The machine code that we generate is organized as a forest of trees; the trunk of the tree is a "loop", and the branches are all bridges (branching off the trunk or off another branch).
+
+* every trunk or branch that ends in a `jump to label` can target a label from a different tree, too.
+
+* the whole process of assembling a loop or a branch is basically single-threaded, so no synchronization issue there (including to patch older generated instructions).
+
+* the generated assembler has got a "frame" in %rbp, which is actually not on the stack at all, but is a GC object (called a "jitframe").  Spilling goes there.
+
+* the guards are `Jcond` to a very small piece of generated code, which is basically pushing a couple of constants on the stack and then jumping to the general guard-recovery code.  That code will save the registers into the jitframe and then exit the whole generated function.  The caller of that generated function checks how it finished: if it finished by hitting a guard, then the caller is responsible for calling the "blackhole interpreter".  This is the part of the front-end that recovers from failing guards and finishes running the frame (including, possibly, by jumping again into generated assembler).
+
+
+Details about the JITting process:
+
+* front-end and optimization pass
+* rewrite (includes gc related transformation as well as simplifactions)
+* assembler generation
+
+
+# Front-end and optimization pass
+
+Not discussed here in detail.  This produces loops and bridges using an instruction set that is "high-level" in some sense: it contains intructions like "new"/"new_array", and "setfield"/"setarrayitem"/"setinteriorfield" which describe the action of storing a value in a precise field of the structure or array.  For example, the "setfield" action might require implicitly a GC write barrier.  This is the high-level trace that we send to the following step.
+
+
+# Rewrite
+
+A mostly but not completely CPU-independent phase: lowers some instructions.  For example, the variants of "new" are lowered to "malloc" and a few "gc_store": it bumps the pointer of the GC and then sets a few fields explicitly in the newly allocated structure.  The "setfield" is replaced with a "cond_gc_wb_call" (conditional call to the write barrier) if needed, followed by a "gc_store".
+
+The "gc_store" instruction can be encoded in a single MOV assembler instruction, but is not as flexible as a MOV.  The address is always specified as "some GC pointer + an offset".  We don't have the notion of interior pointer for GC objects.
+
+A different instruction, "gc_store_indexed", offers additional operands, which can be mapped to a single MOV instruction using forms like `[rax+8*rcx+24]`.
+
+Some other complex instructions pass through to the backend, which must deal with them: for example, "card marking" in the GC.  (Writing an object pointer inside an array would require walking the whole array later to find "young" references. Instead of that, we flip a bit for every range of 128 entries.  This is a common GC optimization.)  Setting the card bit of a GC object requires a sequence of assembler instructions that depends too much on the target CPU to be expressed explicitly here (moreover, it contains a few branches, which are hard to express at this level).
+
+
+
+
+# Assembly
+
+No fancy code generation technique, but greedy forward pass that tries to avoid some pitfalls
+
+
+## Handling instructions
+
+* One by one (forward direction).   Each instruction asks the register allocator to ensure that some arguments are in registers (not in the jitframe); asks for a register to put its result into; and asks for additional scratch registers that will be freed at  the end of the instruction.  There is a special case for boolean variables: they are stored in the condition code flags instead of being materialized as a 0/1 value.  (They are materialized later, except in the common case where they are only used by the next `guard_false` or `guard_true` and then forgotten.)
+
+* Instruction arguments are loaded into a register on demand.  This makes the backend quite easy to write, but leads do some bad decisions.
+
+
+## Linear scan register allocation
+
+Although it's always a linear trace that we consider, we don't use advanced techniques for register allocation: we do forward, on-demand allocation as the backend produces the assembler.  When it asks for a register to put some value into, we give it any free register, without consideration for what will be done with it later.  We compute the longevity of all variables, but only use it when choosing which register to spill (we spill the variable with the longest longevity).
+
+This works to some extend because it is well integrated with the earlier optimization pass. Loops are unrolled once by the optimization pass to allow more powerful optimizations---the optimization pass itself is the place that benefits the most, but it also has benefits here in the assembly pass.  These are:
+
+* The first peeling initializes the register binding on the first use.
+* This leads to an already allocated register of the trace loop.
+* As well as allocated registers when exiting bridges
+
+[Try to better allocate registers to match the ABI (minor to non benefit in the current state)]
+
+
+## More complex mappings
+
+Some instructions generate more complex code.  These are either or both of:
+
+* complex instructions generating some local control flow, like "cond_gc_wb_call" (for write barriers), "call_assembler" (a call followed by a few checks).
+
+* instructions that invoke custom assembler helpers, like the slow-path of write barriers or the slow-path of allocations.  These slow-paths are typically generated too, so that we are not constrained by the usual calling conventions.
+
+
+## GC pointers
+
+Around most CALL instructions, we need to record a description of where the GC pointers are (registers and stack frame).  This is needed in case the CALL invokes a garbage collection.  The GC pointers can move; the positions in the registers and stack frame are fixed by the GC.  That's a reason for why we don't have explicit interior pointers.
+
+GC pointers can appear as constants in the trace.  We are busy changing that to use a constant table and MOV REG, (%RIP+offset).  The "constant" table can actually change if the GC objects move.
+
+
+## Vectorization
+
+Optimization developed to use SIMD instructions for trace loops. Primary idea was to use it as an optimization of micro numpy. It has several passes on the already optimized trace.
+
+Shortly explained: It builds dependencies for an unrolled trace loop, gathering pairs/packs of operations that could be executed in parallel and finally schedules the operations.
+
+What did it add to the code base:
+
+* Dependencies can be constructed
+* Code motion of guards to relax dependencies
+* Scheduler to reorder trace
+* Array bound check removal (especially for unrolled traces)
+
+What can it do:
+
+* Transform vector loops (element wise operations)
+* Accumulation (reduce([...],operator,0)). Requires Operation to be associative and commutative
+* SSE 4.1 as ``vector backend''
+
+## We do not
+
+* Keep tracing data around to reoptimize the trace tree. (Once a trace is compiled, minimal data is kept.)  This is one reason (there are others in the front-end) for the following result: JIT-compiling a small loop with two common paths ends up as one "loop" and one bridge assembled, and the bridge-following path is slightly less efficient.  This is notably because this bridge is assembled with two constraints: the input registers are fixed (from the guard), and the output registers are fixed (from the jump target); usually these two sets of fixed registers are different, and copying around is needed.
+
+* We don't join trace tails: we only assemble *trees*.
+
+* We don't do any reordering (neither of trace instructions nor of individual assembler instructions)
+
+* We don't do any cross-instruction optimization that makes sense only for the backend and can't easily be expressed at a higher level.  I'm sure there are tons of examples of that, but e.g. loading a large constant in a register that will survive for several instructions; moving out of loops *parts* of some instruction like the address calculation; etc. etc.
+
+* Other optimization opportunities I can think about: look at the function prologue/epilogue; look at the overhead (small but not zero) at the start of a bridge.  Also check if the way guards are implemented makes sense.  Also, we generate large-ish sequences of assembler instructions with tons of `Jcond` that are almost never followed; any optimization opportunity there?  (They all go forward, if it changes anything.)  In theory we could also replace some of these with a signal handler on segfault (e.g. `guard_nonnull_class`).
+
+
+# a GCC or LLVM backend?
+
+At least for comparison we'd like a JIT backend that emits its code using GCC or LLVM (irrespective of the time it would take).  But it's hard to map reasonably well the guards to the C language or to LLVM IR.  The problems are: (1) we have many guards, we would like to avoid having many paths that each do a full saving-all-local-variables-that-are-still-alive; (2) it's hard to patch a guard when a bridge is compiled from it; (3) instructions like a CALL need to expose the local variables that are GC pointers; CALL_MAY_FORCE need to expose *all* local variables for optional off-line reconstruction of the interpreter state.
+
diff --git a/talk/bucharest2016/jit-frontend/Makefile b/talk/bucharest2016/jit-frontend/Makefile
new file mode 100644
--- /dev/null
+++ b/talk/bucharest2016/jit-frontend/Makefile
@@ -0,0 +1,32 @@
+# you can find rst2beamer.py and inkscapeslide.py here:
+# http://bitbucket.org/antocuni/env/src/619f486c4fad/bin/rst2beamer.py
+# http://bitbucket.org/antocuni/env/src/619f486c4fad/bin/inkscapeslide.py
+
+
+talk.pdf: talk.rst author.latex stylesheet.latex diagrams/tracing-phases-p0.pdf diagrams/architecture-p0.pdf diagrams/pypytrace-p0.pdf
+	rst2beamer.py --stylesheet=stylesheet.latex --documentoptions=14pt talk.rst talk.latex || exit
+	sed 's/\\date{}/\\input{author.latex}/' -i talk.latex || exit
+	#sed 's/\\maketitle/\\input{title.latex}/' -i talk.latex || exit
+	pdflatex talk.latex  || exit
+
+view: talk.pdf
+	evince talk.pdf &
+
+xpdf: talk.pdf
+	xpdf talk.pdf &
+
+
+diagrams/tracing-phases-p0.pdf: diagrams/tracing-phases.svg
+	cd diagrams && inkscapeslide.py tracing-phases.svg
+
+# diagrams/trace-p0.pdf: diagrams/trace.svg
+# 	cd diagrams && inkscapeslide.py trace.svg
+
+# diagrams/tracetree-p0.pdf: diagrams/tracetree.svg
+# 	cd diagrams && inkscapeslide.py tracetree.svg
+
+diagrams/architecture-p0.pdf: diagrams/architecture.svg
+	cd diagrams && inkscapeslide.py architecture.svg
+
+diagrams/pypytrace-p0.pdf: diagrams/pypytrace.svg
+	cd diagrams && inkscapeslide.py pypytrace.svg
diff --git a/talk/bucharest2016/jit-frontend/author.latex b/talk/bucharest2016/jit-frontend/author.latex
new file mode 100644
--- /dev/null
+++ b/talk/bucharest2016/jit-frontend/author.latex
@@ -0,0 +1,8 @@
+\definecolor{rrblitbackground}{rgb}{0.0, 0.0, 0.0}
+
+\title[PyPy Intro]{PyPy Intro and JIT Frontend}
+\author[antocuni]
+{Antonio Cuni}
+
+\institute{Intel at Bucharest}
+\date{April 4 2016}
diff --git a/talk/bucharest2016/jit-frontend/beamerdefs.txt b/talk/bucharest2016/jit-frontend/beamerdefs.txt
new file mode 100644
--- /dev/null
+++ b/talk/bucharest2016/jit-frontend/beamerdefs.txt
@@ -0,0 +1,108 @@
+.. colors
+.. ===========================
+
+.. role:: green
+.. role:: red
+
+
+.. general useful commands
+.. ===========================
+
+.. |pause| raw:: latex
+
+   \pause
+
+.. |small| raw:: latex
+
+   {\small
+
+.. |end_small| raw:: latex
+
+   }
+
+.. |scriptsize| raw:: latex
+
+   {\scriptsize
+
+.. |end_scriptsize| raw:: latex
+
+   }
+
+.. |strike<| raw:: latex
+
+   \sout{
+
+.. closed bracket
+.. ===========================
+
+.. |>| raw:: latex
+
+   }
+
+
+.. example block
+.. ===========================
+
+.. |example<| raw:: latex
+
+   \begin{exampleblock}{
+
+
+.. |end_example| raw:: latex
+
+   \end{exampleblock}
+
+
+
+.. alert block
+.. ===========================
+
+.. |alert<| raw:: latex
+
+   \begin{alertblock}{
+
+
+.. |end_alert| raw:: latex
+
+   \end{alertblock}
+
+
+
+.. columns
+.. ===========================
+
+.. |column1| raw:: latex
+
+   \begin{columns}
+      \begin{column}{0.45\textwidth}
+
+.. |column2| raw:: latex
+
+      \end{column}
+      \begin{column}{0.45\textwidth}
+
+
+.. |end_columns| raw:: latex
+
+      \end{column}
+   \end{columns}
+
+
+
+.. |snake| image:: ../../img/py-web-new.png
+           :scale: 15%
+           
+
+
+.. nested blocks
+.. ===========================
+
+.. |nested| raw:: latex
+
+   \begin{columns}
+      \begin{column}{0.85\textwidth}
+
+.. |end_nested| raw:: latex
+
+      \end{column}
+   \end{columns}
diff --git a/talk/bucharest2016/jit-frontend/diagrams/architecture.svg b/talk/bucharest2016/jit-frontend/diagrams/architecture.svg
new file mode 100644
--- /dev/null
+++ b/talk/bucharest2016/jit-frontend/diagrams/architecture.svg
@@ -0,0 +1,700 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="1685.75"
+   height="949.56055"
+   id="svg3076"
+   version="1.1"
+   inkscape:version="0.48.2 r9819"
+   sodipodi:docname="architecture.svg">
+  <defs
+     id="defs3078">
+    <marker
+       inkscape:stockid="Arrow2Mend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow2Mend"
+       style="overflow:visible">
+      <path
+         id="path4380"
+         style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
+         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+         transform="scale(-0.6,-0.6)"
+         inkscape:connector-curvature="0" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Lend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow2Lend"
+       style="overflow:visible">
+      <path
+         id="path4374"
+         style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
+         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+         transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
+         inkscape:connector-curvature="0" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Lend"
+       style="overflow:visible">
+      <path
+         id="path4356"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
+         transform="matrix(-0.8,0,0,-0.8,-10,0)"
+         inkscape:connector-curvature="0" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Mend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow2Mend-3"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path4380-3"
+         style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
+         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+         transform="scale(-0.6,-0.6)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Mend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow2Mend-4"
+       style="overflow:visible">
+      <path
+         id="path4380-1"
+         style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
+         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+         transform="scale(-0.6,-0.6)"
+         inkscape:connector-curvature="0" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Mend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow2Mend-2"
+       style="overflow:visible">
+      <path
+         id="path4380-15"
+         style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
+         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+         transform="scale(-0.6,-0.6)"
+         inkscape:connector-curvature="0" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Mend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow2Mend-8"
+       style="overflow:visible">
+      <path
+         id="path4380-34"
+         style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
+         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+         transform="scale(-0.6,-0.6)"
+         inkscape:connector-curvature="0" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Mend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow2Mend-22"
+       style="overflow:visible">
+      <path
+         id="path4380-2"
+         style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
+         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+         transform="scale(-0.6,-0.6)"
+         inkscape:connector-curvature="0" />
+    </marker>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35355339"
+     inkscape:cx="1138.0708"
+     inkscape:cy="300.08853"
+     inkscape:document-units="px"
+     inkscape:current-layer="g4325"
+     showgrid="false"
+     inkscape:window-width="1280"
+     inkscape:window-height="748"
+     inkscape:window-x="0"
+     inkscape:window-y="1"
+     inkscape:window-maximized="1"
+     fit-margin-top="0"
+     fit-margin-left="0"
+     fit-margin-right="0"
+     fit-margin-bottom="0" />
+  <metadata
+     id="metadata3081">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:groupmode="layer"
+     id="layer4"
+     inkscape:label="content"
+     transform="translate(48.09375,-13.439453)">
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="1877.4071"
+       y="21.292315"
+       id="text5315"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan5317"
+         x="1877.4071"
+         y="21.292315">rpython</tspan><tspan
+         sodipodi:role="line"
+         x="1877.4071"
+         y="71.292313"
+         id="tspan5319">+codewriter</tspan><tspan
+         sodipodi:role="line"
+         x="1877.4071"
+         y="121.29231"
+         id="tspan5321">+jitcode</tspan><tspan
+         sodipodi:role="line"
+         x="1877.4071"
+         y="171.29231"
+         id="tspan5710">+timeline</tspan><tspan
+         sodipodi:role="line"
+         x="1877.4071"
+         y="221.29231"
+         id="tspan5712">+metatracer</tspan><tspan
+         sodipodi:role="line"
+         x="1877.4071"
+         y="271.29233"
+         id="tspan5714">+optimizer</tspan><tspan
+         sodipodi:role="line"
+         x="1877.4071"
+         y="321.29233"
+         id="tspan5716">+backend</tspan><tspan
+         sodipodi:role="line"
+         x="1877.4071"
+         y="371.29233"
+         id="tspan5720">+jitted</tspan></text>
+  </g>
+  <g
+     inkscape:label="rpython"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(584.875,133.32532)">
+    <g
+       id="g5340"
+       transform="translate(0,56.011525)">
+      <g
+         id="g5323">
+        <g
+           id="g3908"
+           transform="translate(-622,-168.57143)">
+          <text
+             sodipodi:linespacing="125%"
+             id="text3084"
+             y="246.54382"
+             x="106.92159"
+             style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Monospace;-inkscape-font-specification:Monospace"
+             xml:space="preserve"><tspan
+               y="246.54382"
+               x="106.92159"
+               id="tspan3086"
+               sodipodi:role="line">def LOAD_GLOBAL(self):</tspan><tspan
+               id="tspan3088"
+               y="276.54382"
+               x="106.92159"
+               sodipodi:role="line">    ...</tspan></text>
+          <rect
+             y="206.6479"
+             x="85.714287"
+             height="91.428574"
+             width="354.28571"
+             id="rect3138"
+             style="fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none" />
+        </g>
+        <g
+           transform="translate(-622,-49.999979)"
+           id="g3908-1">
+          <text
+             sodipodi:linespacing="125%"
+             id="text3084-9"
+             y="246.54382"
+             x="106.92159"
+             style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Monospace;-inkscape-font-specification:Monospace"
+             xml:space="preserve"><tspan
+               y="246.54382"
+               x="106.92159"
+               id="tspan3086-3"
+               sodipodi:role="line">def STORE_FAST(self):</tspan><tspan
+               id="tspan3088-8"
+               y="276.54382"
+               x="106.92159"
+               sodipodi:role="line">    ...</tspan></text>
+          <rect
+             y="206.6479"
+             x="85.714287"
+             height="91.428574"
+             width="354.28571"
+             id="rect3138-0"
+             style="fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none" />
+        </g>
+        <g
+           transform="translate(-622,68.571421)"
+           id="g3908-16">
+          <text
+             sodipodi:linespacing="125%"
+             id="text3084-3"
+             y="246.54382"
+             x="106.92159"
+             style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Monospace;-inkscape-font-specification:Monospace"
+             xml:space="preserve"><tspan
+               y="246.54382"
+               x="106.92159"
+               id="tspan3086-0"
+               sodipodi:role="line">def BINARY_ADD(self):</tspan><tspan
+               id="tspan3088-4"
+               y="276.54382"
+               x="106.92159"
+               sodipodi:role="line">    ...</tspan></text>
+          <rect
+             y="206.6479"
+             x="85.714287"
+             height="91.428574"
+             width="354.28571"
+             id="rect3138-8"
+             style="fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none" />
+        </g>
+      </g>
+    </g>
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="-454.88504"
+       y="-103.63782"
+       id="text5192"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan5194"
+         x="-454.88504"
+         y="-103.63782">RPYTHON</tspan></text>
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer2"
+     inkscape:label="codewriter"
+     transform="translate(48.09375,-13.439453)">
+    <g
+       id="g4343"
+       transform="translate(550.78125,204.20488)">
+      <text
+         sodipodi:linespacing="125%"
+         id="text3084-92"
+         y="214.0381"
+         x="28.557568"
+         style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
+         xml:space="preserve"><tspan
+           id="tspan3088-3"
+           y="214.0381"
+           x="28.557568"
+           sodipodi:role="line">CODEWRITER</tspan></text>
+      <rect
+         y="155.21931"
+         x="8.5714369"
+         height="91.428574"
+         width="285.97812"
+         id="rect3138-7"
+         style="fill:none;stroke:#ff0000;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:9, 3;stroke-dashoffset:0" />
+    </g>
+    <path
+       style="fill:none;stroke:#000000;stroke-width:12.49669838;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow2Mend)"
+       d="m 381.19733,405.25855 130.48659,0"
+       id="path4348"
+       inkscape:connector-curvature="0" />
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer3"
+     inkscape:label="jitcode"
+     transform="translate(48.09375,-13.439453)">
+    <g
+       id="g5358"
+       transform="translate(7.9254937,0)">
+      <g
+         transform="translate(956.78125,-444.07872)"
+         id="g4105">
+        <g
+           transform="translate(2.8571441,301.42856)"
+           id="g3908-6">
+          <text
+             xml:space="preserve"
+             style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Monospace;-inkscape-font-specification:Monospace"
+             x="100.07337"
+             y="231.73483"
+             id="text3084-33"
+             sodipodi:linespacing="125%"><tspan
+               sodipodi:role="line"
+               x="100.07337"
+               y="231.73483"
+               id="tspan3088-9">...</tspan><tspan
+               id="tspan4077"
+               sodipodi:role="line"
+               x="100.07337"
+               y="261.73483">p0 = getfield_gc(p0, 'func_globals')</tspan><tspan
+               id="tspan4075"
+               sodipodi:role="line"
+               x="100.07337"
+               y="291.73483">p2 = getfield_gc(p1, 'strval')</tspan><tspan
+               id="tspan4057"
+               sodipodi:role="line"
+               x="100.07337"
+               y="321.73483">call(dict_lookup, p0, p2)</tspan><tspan
+               id="tspan4059"
+               sodipodi:role="line"
+               x="100.07337"
+               y="351.73483">....</tspan></text>
+          <rect
+             style="fill:none;stroke:#000000;stroke-width:1.67027557;stroke-miterlimit:4;stroke-dasharray:none"
+             id="rect3138-85"
+             width="544.94354"
+             height="165.82893"
+             x="86.099648"
+             y="207.03326" />
+          <flowRoot
+             style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+             id="flowRoot4061"
+             xml:space="preserve"><flowRegion
+               id="flowRegion4063"><rect
+                 y="353.79074"
+                 x="315.71429"
+                 height="77.14286"
+                 width="102.85714"
+                 id="rect4065" /></flowRegion><flowPara
+               id="flowPara4067"></flowPara></flowRoot>        </g>
+      </g>
+      <g
+         id="g4105-0"
+         transform="translate(958.20983,-261.44707)">
+        <g
+           transform="translate(2.8571441,301.42856)"
+           id="g3908-6-7">
+          <text
+             xml:space="preserve"
+             style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Monospace;-inkscape-font-specification:Monospace"
+             x="100.07337"
+             y="231.73483"
+             id="text3084-33-8"
+             sodipodi:linespacing="125%"><tspan
+               sodipodi:role="line"
+               x="100.07337"
+               y="231.73483"
+               id="tspan3088-9-8">...</tspan><tspan
+               id="tspan4077-6"
+               sodipodi:role="line"
+               x="100.07337"
+               y="261.73483">p0 = getfield_gc(p0, 'locals_w')</tspan><tspan
+               id="tspan4075-1"
+               sodipodi:role="line"
+               x="100.07337"
+               y="291.73483">setarrayitem_gc(p0, i0, p1)</tspan><tspan
+               id="tspan4059-8"
+               sodipodi:role="line"
+               x="100.07337"
+               y="321.73483">....</tspan></text>
+          <rect
+             style="fill:none;stroke:#000000;stroke-width:1.49203587;stroke-miterlimit:4;stroke-dasharray:none"
+             id="rect3138-85-9"
+             width="544.94354"
+             height="132.3252"
+             x="86.099648"
+             y="207.03326" />
+          <flowRoot
+             style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+             id="flowRoot4061-4"
+             xml:space="preserve"><flowRegion
+               id="flowRegion4063-2"><rect
+                 y="353.79074"
+                 x="315.71429"
+                 height="77.14286"
+                 width="102.85714"
+                 id="rect4065-2" /></flowRegion><flowPara
+               id="flowPara4067-6" /></flowRoot>        </g>
+      </g>
+      <g
+         transform="matrix(1.0073841,0,0,1,716.36172,92.764781)"
+         id="g4325">
+        <text
+           sodipodi:linespacing="125%"
+           id="text3084-33-1"
+           y="346.14929"
+           x="341.50195"
+           style="font-size:24px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Monospace;-inkscape-font-specification:Monospace"
+           xml:space="preserve"><tspan
+             id="tspan3088-9-0"
+             y="346.14929"
+             x="341.50195"
+             sodipodi:role="line">...</tspan><tspan
+             y="376.14929"
+             x="341.50195"
+             sodipodi:role="line"
+             id="tspan6723">promote_class(p0)</tspan><tspan
+             y="406.14929"
+             x="341.50195"
+             sodipodi:role="line"
+             id="tspan4077-62">i0 = getfield_gc(p0, 'intval')</tspan><tspan
+             y="436.14929"
+             x="341.50195"
+             sodipodi:role="line"
+             id="tspan6727">promote_class(p1)</tspan><tspan
+             y="466.14929"
+             x="341.50195"
+             sodipodi:role="line"
+             id="tspan4075-3">i1 = getfield_gc(p1, 'intval')</tspan><tspan
+             y="496.14929"
+             x="341.50195"
+             sodipodi:role="line"
+             id="tspan4059-7">i2 = int_add(i0, i1)</tspan><tspan
+             y="526.14929"
+             x="341.50195"
+             sodipodi:role="line"
+             id="tspan4242">if (overflowed) goto ...</tspan><tspan
+             y="556.14929"
+             x="341.50195"
+             sodipodi:role="line"
+             id="tspan4246">p2 = new_with_vtable('W_IntObject')</tspan><tspan
+             y="586.14929"
+             x="341.50195"
+             sodipodi:role="line"
+             id="tspan4248">setfield_gc(p2, i2, 'intval')</tspan><tspan
+             y="616.14929"
+             x="341.50195"
+             sodipodi:role="line"
+             id="tspan4304">....</tspan></text>
+        <g
+           transform="matrix(1,0,0,1.1400311,480.57144,-267.23566)"
+           id="g4105-2">
+          <g
+             id="g3908-6-5"
+             transform="matrix(1,0,0,1.1954725,2.8571441,206.67858)">
+            <rect
+               y="257.17258"
+               x="-155.76105"
+               height="227.55032"
+               width="540.66492"
+               id="rect3138-85-5"
+               style="fill:none;stroke:#000000;stroke-width:1.94887984;stroke-miterlimit:4;stroke-dasharray:none" />
+            <flowRoot
+               xml:space="preserve"
+               id="flowRoot4061-0"
+               style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><flowRegion
+                 id="flowRegion4063-6"><rect
+                   id="rect4065-1"
+                   width="102.85714"
+                   height="77.14286"
+                   x="315.71429"
+                   y="353.79074" /></flowRegion><flowPara
+                 id="flowPara4067-1" /></flowRoot>          </g>
+        </g>
+      </g>
+    </g>
+    <path
+       style="fill:none;stroke:#000000;stroke-width:12.49669838;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow2Mend)"
+       d="m 874.38698,405.25855 130.48662,0"
+       id="path4348-5"
+       inkscape:connector-curvature="0" />
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="1240.5885"
+       y="43.126953"
+       id="text5192-9"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan5194-4"
+         x="1240.5885"
+         y="43.126953">JITCODE</tspan></text>
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer5"
+     inkscape:label="timeline"
+     transform="translate(48.09375,-13.439453)">
+    <path
+       style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+       d="m -48.083261,738.03442 1685.742561,0"
+       id="path5619"
+       inkscape:connector-curvature="0" />
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="506.28845"
+       y="697.26794"
+       id="text5623"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan5625"
+         x="506.28845"
+         y="697.26794"
+         style="fill:#800000">compile-time</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="557.99744"
+       y="804.74817"
+       id="text5627"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan5629"
+         x="557.99744"
+         y="804.74817"
+         style="fill:#008000">runtime</tspan></text>
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer6"
+     inkscape:label="metatracer"
+     transform="translate(48.09375,-13.439453)">
+    <text
+       xml:space="preserve"
+       style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
+       x="1331.2896"
+       y="928.88922"
+       id="text3084-92-9"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         x="1331.2896"
+         y="928.88922"
+         id="tspan3088-3-5">META-TRACER</tspan></text>
+    <rect
+       style="fill:none;stroke:#00ff00;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:9, 3;stroke-dashoffset:0"
+       id="rect3138-7-6"
+       width="285.97812"
+       height="91.428574"
+       x="1311.3035"
+       y="870.07043" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:10.14441872;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow2Mend)"
+       d="m 1446.1263,750.28419 -0.6836,86.05037"
+       id="path4348-5-9"
+       inkscape:connector-curvature="0" />
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer7"
+     inkscape:label="optimizer"
+     transform="translate(48.09375,-13.439453)">
+    <text
+       xml:space="preserve"
+       style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
+       x="918.10229"
+       y="928.88922"
+       id="text3084-92-9-5"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         x="918.10229"
+         y="928.88922"
+         id="tspan3088-3-5-2">OPTIMIZER</tspan></text>
+    <rect
+       style="fill:none;stroke:#00ff00;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:9, 3;stroke-dashoffset:0"
+       id="rect3138-7-6-7"
+       width="285.97812"
+       height="91.428574"
+       x="874.03418"
+       y="870.07043" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:10.88625526;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow2Mend)"
+       d="m 1289.6562,915.68014 -99.0221,0"
+       id="path4348-5-94"
+       inkscape:connector-curvature="0" />
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer8"
+     inkscape:label="backend"
+     transform="translate(48.09375,-13.439453)">
+    <text
+       xml:space="preserve"
+       style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
+       x="491.6084"
+       y="928.88922"
+       id="text3084-92-9-5-0"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         x="491.6084"
+         y="928.88922"
+         id="tspan3088-3-5-2-7">BACKEND</tspan></text>
+    <rect
+       style="fill:none;stroke:#00ff00;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:9, 3;stroke-dashoffset:0"
+       id="rect3138-7-6-7-1"
+       width="285.97812"
+       height="91.428574"
+       x="436.76486"
+       y="870.07043" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:10.88625526;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow2Mend)"
+       d="m 852.38686,915.68014 -99.02217,0"
+       id="path4348-5-94-1"
+       inkscape:connector-curvature="0" />
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer9"
+     inkscape:label="jitted"
+     transform="translate(48.09375,-13.439453)">
+    <text
+       xml:space="preserve"
+       style="font-size:36px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans"
+       x="29.307829"
+       y="928.88922"
+       id="text3084-92-9-5-9"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         x="29.307829"
+         y="928.88922"
+         id="tspan3088-3-5-2-9">ASSEMBLER</tspan></text>
+    <rect
+       style="fill:none;stroke:#00ff00;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:9, 3;stroke-dashoffset:0"
+       id="rect3138-7-6-7-6"
+       width="285.97812"
+       height="91.428574"
+       x="-0.50445831"
+       y="870.07043" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:10.88625526;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow2Mend)"
+       d="m 415.11751,915.68014 -99.02217,0"
+       id="path4348-5-94-2"
+       inkscape:connector-curvature="0" />
+  </g>
+</svg>
diff --git a/talk/bucharest2016/jit-frontend/diagrams/pypytrace.svg b/talk/bucharest2016/jit-frontend/diagrams/pypytrace.svg
new file mode 100644
--- /dev/null
+++ b/talk/bucharest2016/jit-frontend/diagrams/pypytrace.svg
@@ -0,0 +1,346 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="847.5791"
+   height="534.64679"
+   id="svg5724"
+   version="1.1"
+   inkscape:version="0.48.2 r9819"
+   sodipodi:docname="pypytrace.svg">
+  <defs
+     id="defs5726" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.7"
+     inkscape:cx="592.59034"
+     inkscape:cy="238.97744"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer13"
+     showgrid="false"
+     inkscape:window-width="1280"
+     inkscape:window-height="748"
+     inkscape:window-x="0"
+     inkscape:window-y="1"
+     inkscape:window-maximized="1"
+     fit-margin-top="0"
+     fit-margin-left="0"
+     fit-margin-right="0"
+     fit-margin-bottom="0" />
+  <metadata
+     id="metadata5729">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:groupmode="layer"
+     id="layer15"
+     inkscape:label="content"
+     transform="translate(37.14286,891.38847)">
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="-713.01819"
+       y="-786.45428"
+       id="text6436"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan6438"
+         x="-713.01819"
+         y="-786.45428">python</tspan><tspan
+         sodipodi:role="line"
+         x="-713.01819"
+         y="-736.45428"
+         id="tspan6440">+dis</tspan><tspan
+         sodipodi:role="line"
+         x="-713.01819"
+         y="-686.45428"
+         id="tspan6442">+trace0</tspan><tspan
+         sodipodi:role="line"
+         x="-713.01819"
+         y="-636.45428"
+         id="tspan6444">+trace1</tspan><tspan
+         sodipodi:role="line"
+         x="-713.01819"
+         y="-586.45428"
+         id="tspan6446">+trace2</tspan><tspan
+         sodipodi:role="line"
+         x="-713.01819"
+         y="-536.45428"
+         id="tspan6448">+trace3</tspan></text>
+  </g>
+  <g
+     inkscape:label="python"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(37.14286,891.38847)">
+    <flowRoot
+       transform="translate(-881.42853,413.45203)"
+       xml:space="preserve"
+       id="flowRoot4061-4-6"
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><flowRegion
+         id="flowRegion4063-2-1"><rect
+           id="rect4065-2-4"
+           width="102.85714"
+           height="77.14286"
+           x="315.71429"
+           y="353.79074" /></flowRegion><flowPara
+         id="flowPara4067-6-1" /></flowRoot>    <flowRoot
+       transform="translate(-878.57142,-63.29983)"
+       xml:space="preserve"
+       id="flowRoot4061-9-6"
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><flowRegion
+         id="flowRegion4063-9-2"><rect
+           id="rect4065-9-0"
+           width="102.85714"
+           height="77.14286"
+           x="315.71429"
+           y="353.79074" /></flowRegion><flowPara
+         id="flowPara4067-5-0" /></flowRoot>    <flowRoot
+       style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       id="flowRoot6192"
+       xml:space="preserve"><flowRegion
+         id="flowRegion6194"><rect
+           y="-101.92353"
+           x="-842.85712"
+           height="940"
+           width="717.14288"
+           id="rect6196" /></flowRegion><flowPara
+         id="flowPara6198"></flowPara></flowRoot>    <text
+       xml:space="preserve"
+       style="font-size:32px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Monospace;-inkscape-font-specification:Monospace"
+       x="-37.14286"
+       y="-765.78998"
+       id="text5732"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan5734"
+         x="-37.14286"
+         y="-765.78998">def fn():</tspan><tspan
+         sodipodi:role="line"
+         x="-37.14286"
+         y="-725.78998"
+         id="tspan5736">    c = a+b</tspan><tspan
+         sodipodi:role="line"
+         x="-37.14286"
+         y="-685.78998"
+         id="tspan5770">    ...</tspan></text>
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer10"
+     inkscape:label="dis"
+     transform="translate(37.14286,891.38847)">
+    <text
+       xml:space="preserve"
+       style="font-size:32px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Monospace;-inkscape-font-specification:Monospace"
+       x="-39.314735"
+       y="-619.57458"
+       id="text5732-8"
+       sodipodi:linespacing="125%"
+       inkscape:transform-center-x="-25.714286"
+       inkscape:transform-center-y="-97.142857"><tspan
+         sodipodi:role="line"
+         x="-39.314735"
+         y="-619.57458"
+         id="tspan5736-8">LOAD_GLOBAL A</tspan><tspan
+         sodipodi:role="line"
+         x="-39.314735"
+         y="-579.57458"
+         id="tspan5764">LOAD_GLOBAL B</tspan><tspan
+         sodipodi:role="line"
+         x="-39.314735"
+         y="-539.57458"
+         id="tspan5766">BINARY_ADD</tspan><tspan
+         sodipodi:role="line"
+         x="-39.314735"
+         y="-499.57458"
+         id="tspan5768">STORE_FAST  C</tspan></text>
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer11"
+     inkscape:label="trace0"
+     transform="translate(37.14286,891.38847)">
+    <g
+       id="g4105-5"
+       transform="translate(321.42858,-1421.8712)">
+      <text
+         xml:space="preserve"
+         style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Monospace;-inkscape-font-specification:Monospace"
+         x="102.93052"
+         y="533.16339"
+         id="text3084-33-6"
+         sodipodi:linespacing="125%"><tspan
+           sodipodi:role="line"
+           x="102.93052"
+           y="533.16339"
+           id="tspan3088-9-84">...</tspan><tspan
+           id="tspan4077-7"
+           sodipodi:role="line"
+           x="102.93052"
+           y="555.66339">p0 = getfield_gc(p0, 'func_globals')</tspan><tspan
+           id="tspan4075-9"
+           sodipodi:role="line"
+           x="102.93052"
+           y="578.16339">p2 = getfield_gc(p1, 'strval')</tspan><tspan
+           id="tspan4057-8"
+           sodipodi:role="line"
+           x="102.93052"
+           y="600.66339">call(dict_lookup, p0, p2)</tspan><tspan
+           id="tspan4059-4"
+           sodipodi:role="line"
+           x="102.93052"
+           y="623.16339">...</tspan></text>
+      <flowRoot
+         transform="translate(2.8571441,301.42856)"
+         style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+         id="flowRoot4061-9"
+         xml:space="preserve"><flowRegion
+           id="flowRegion4063-9"><rect
+             y="353.79074"
+             x="315.71429"
+             height="77.14286"
+             width="102.85714"
+             id="rect4065-9" /></flowRegion><flowPara
+           id="flowPara4067-5" /></flowRoot>    </g>
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer12"
+     inkscape:label="trace1"
+     transform="translate(37.14286,891.38847)">
+    <text
+       sodipodi:linespacing="125%"
+       id="text3084-33-6-5"
+       y="-772.99359"
+       x="424.3591"
+       style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Monospace;-inkscape-font-specification:Monospace"
+       xml:space="preserve"><tspan
+         id="tspan3088-9-84-1"
+         y="-772.99359"
+         x="424.3591"
+         sodipodi:role="line">...</tspan><tspan
+         y="-750.49359"
+         x="424.3591"
+         sodipodi:role="line"
+         id="tspan4077-7-4">p0 = getfield_gc(p0, 'func_globals')</tspan><tspan
+         y="-727.99359"
+         x="424.3591"
+         sodipodi:role="line"
+         id="tspan4075-9-6">p2 = getfield_gc(p1, 'strval')</tspan><tspan
+         y="-705.49359"
+         x="424.3591"
+         sodipodi:role="line"
+         id="tspan4057-8-5">call(dict_lookup, p0, p2)</tspan><tspan
+         y="-682.99359"
+         x="424.3591"
+         sodipodi:role="line"
+         id="tspan4059-4-2">...</tspan></text>
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer13"
+     inkscape:label="trace2"
+     transform="translate(37.14286,891.38847)">
+    <text
+       transform="scale(1.0036853,0.99632824)"
+       sodipodi:linespacing="125%"
+       id="text3084-33-1-3"
+       y="-652.034"
+       x="423.3837"
+       style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Monospace;-inkscape-font-specification:Monospace"
+       xml:space="preserve"><tspan
+         id="tspan3088-9-0-4"
+         y="-652.034"
+         x="423.3837"
+         sodipodi:role="line">...</tspan><tspan
+         y="-629.534"
+         x="423.3837"
+         sodipodi:role="line"
+         id="tspan4077-62-3"
+         style="font-weight:bold">guard_class(p0, W_IntObject)</tspan><tspan
+         y="-607.034"
+         x="423.3837"
+         sodipodi:role="line"
+         id="tspan6717">i0 = getfield_gc(p0, 'intval')</tspan><tspan
+         y="-584.534"
+         x="423.3837"
+         sodipodi:role="line"
+         id="tspan6719"
+         style="font-weight:bold">guard_class(p1, W_IntObject)</tspan><tspan
+         y="-562.034"
+         x="423.3837"
+         sodipodi:role="line"
+         id="tspan4075-3-2">i1 = getfield_gc(p1, 'intval')</tspan><tspan
+         y="-539.534"
+         x="423.3837"
+         sodipodi:role="line"
+         id="tspan4059-7-0">i2 = int_add(00, i1)</tspan><tspan
+         y="-517.034"
+         x="423.3837"
+         sodipodi:role="line"
+         id="tspan4246-1"
+         style="font-weight:bold">guard_not_overflow()</tspan><tspan
+         id="tspan6279"
+         y="-494.534"
+         x="423.3837"
+         sodipodi:role="line">p2 = new_with_vtable('W_IntObject')</tspan><tspan
+         y="-472.034"
+         x="423.3837"
+         sodipodi:role="line"
+         id="tspan4248-1">setfield_gc(p2, i2, 'intval')</tspan><tspan
+         y="-449.534"
+         x="423.3837"
+         sodipodi:role="line"
+         id="tspan4304-5">...</tspan></text>
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer14"
+     inkscape:label="trace3"
+     transform="translate(37.14286,891.38847)">
+    <text
+       sodipodi:linespacing="125%"
+       id="text3084-33-8-9"
+       y="-424.24167"
+       x="424.3591"
+       style="font-size:18px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Monospace;-inkscape-font-specification:Monospace"
+       xml:space="preserve"><tspan
+         id="tspan3088-9-8-7"
+         y="-424.24167"
+         x="424.3591"
+         sodipodi:role="line">...</tspan><tspan
+         y="-401.74167"
+         x="424.3591"
+         sodipodi:role="line"
+         id="tspan4077-6-9">p0 = getfield_gc(p0, 'locals_w')</tspan><tspan
+         y="-379.24167"
+         x="424.3591"
+         sodipodi:role="line"
+         id="tspan4075-1-4">setarrayitem_gc(p0, i0, p1)</tspan><tspan
+         y="-356.74167"
+         x="424.3591"
+         sodipodi:role="line"
+         id="tspan4059-8-3">....</tspan></text>
+  </g>
+</svg>
diff --git a/talk/bucharest2016/jit-frontend/diagrams/tracing-phases.svg b/talk/bucharest2016/jit-frontend/diagrams/tracing-phases.svg
new file mode 100644
--- /dev/null
+++ b/talk/bucharest2016/jit-frontend/diagrams/tracing-phases.svg
@@ -0,0 +1,473 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.2 r9819"
+   width="397.1475"
+   height="228.3725"
+   xml:space="preserve"
+   sodipodi:docname="tracing-phases.svg"><metadata
+     id="metadata8"><rdf:RDF><cc:Work
+         rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
+     id="defs6" /><sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1286"
+     inkscape:window-height="838"
+     id="namedview4"
+     showgrid="false"
+     inkscape:zoom="1.8028567"
+     inkscape:cx="41.424167"
+     inkscape:cy="90.543544"
+     inkscape:window-x="1926"
+     inkscape:window-y="96"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="layer8" /><g
+     inkscape:groupmode="layer"
+     id="layer8"
+     inkscape:label="content"><text
+   xml:space="preserve"
+   style="font-size:7.55956697px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;display:inline;font-family:Sans"
+   x="-81.325111"
+   y="36.299587"
+   id="text5362"
+   sodipodi:linespacing="125%"><tspan
+     sodipodi:role="line"
+     id="tspan5364"
+     x="-81.325111"
+     y="36.299587">interp</tspan><tspan
+     sodipodi:role="line"
+     x="-81.325111"
+     y="45.74905"
+     id="tspan5366">+tracing</tspan><tspan
+     sodipodi:role="line"
+     x="-81.325111"
+     y="55.198505"
+     id="tspan5368">+compilation</tspan><tspan
+     sodipodi:role="line"
+     x="-81.325111"
+     y="64.647964"
+     id="tspan5370">+running</tspan><tspan
+     sodipodi:role="line"
+     x="-81.325111"
+     y="74.097427"
+     id="tspan5372">+cold_guard</tspan><tspan
+     sodipodi:role="line"
+     x="-81.325111"
+     y="83.546883"
+     id="tspan5374">+compiled_loop</tspan><tspan
+     sodipodi:role="line"
+     x="-81.325111"
+     y="92.996338"
+     id="tspan5376">+bridge</tspan><tspan
+     sodipodi:role="line"
+     x="-81.325111"
+     y="102.4458"
+     id="tspan5378">+hot_guard</tspan></text>
+
+</g><g
+     id="g10"
+     inkscape:groupmode="layer"
+     inkscape:label="interp"
+     transform="matrix(1.25,0,0,-1.25,56.76125,122.78375)"
+     style="display:inline"><g
+   id="g14" /><g
+   id="g18"><g
+     id="g20"><g
+       id="g22"><g
+         id="g24"
+         transform="translate(2.14474,-2.14474)"><path
+           d="M 29.89998,0 C 29.89998,16.5135 16.5135,29.89998 0,29.89998 -16.5135,29.89998 -29.89998,16.5135 -29.89998,0 c 0,-16.5135 13.38648,-29.89998 29.89998,-29.89998 16.5135,0 29.89998,13.38648 29.89998,29.89998 z"
+           style="fill:#808080;fill-opacity:0.5;fill-rule:nonzero;stroke:none"
+           id="path26"
+           inkscape:connector-curvature="0" /></g></g></g><g
+     id="g28"><path
+       d="M 29.89998,0 C 29.89998,16.5135 16.5135,29.89998 0,29.89998 -16.5135,29.89998 -29.89998,16.5135 -29.89998,0 c 0,-16.5135 13.38648,-29.89998 29.89998,-29.89998 16.5135,0 29.89998,13.38648 29.89998,29.89998 z"
+       style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+       id="path30"
+       inkscape:connector-curvature="0" /></g><g
+     id="g32"
+     transform="translate(-25.879,-1.948)"><g
+       id="g34"><g
+         id="g36"
+         transform="translate(-19.53,-82.523)"><text
+   transform="matrix(1,0,0,-1,19.53,82.523)"
+   id="text38"><tspan
+     style="font-size:7.97009993px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMR8;-inkscape-font-specification:CMR8"
+     x="0 3.0493603 7.5229774 10.816223 14.579704 17.880123 22.584873 25.88529 29.648771 32.942017 37.176533 40.469776 42.821754 47.056267"
+     y="0"
+     sodipodi:role="line"
+     id="tspan40">Interpretation</tspan></text>
+
+
+<g
+   id="g42"
+   transform="translate(19.53,82.523)" /></g></g><g
+       id="g44"
+       transform="translate(25.879,1.948)" /></g></g>
+</g><g
+     inkscape:groupmode="layer"
+     id="layer1"
+     inkscape:label="tracing"
+     style="display:inline"><g
+       transform="matrix(1.25,0,0,-1.25,56.76125,122.78375)"
+       style="display:inline"
+       id="g46"><g
+         id="g48"><g
+           id="g50"><g
+             id="g52"
+             transform="translate(2.14474,-2.14474)"><path
+               d="m 95.35454,70.44759 c 0,13.7559 -11.15105,24.90695 -24.90695,24.90695 -13.75591,0 -24.90696,-11.15105 -24.90696,-24.90695 0,-13.75591 11.15105,-24.90696 24.90696,-24.90696 13.7559,0 24.90695,11.15105 24.90695,24.90696 z"
+               style="fill:#808080;fill-opacity:0.5;fill-rule:nonzero;stroke:none"
+               id="path54"
+               inkscape:connector-curvature="0" /></g></g></g><g
+         id="g56"><path
+           d="m 95.35454,70.44759 c 0,13.7559 -11.15105,24.90695 -24.90695,24.90695 -13.75591,0 -24.90696,-11.15105 -24.90696,-24.90695 0,-13.75591 11.15105,-24.90696 24.90696,-24.90696 13.7559,0 24.90695,11.15105 24.90695,24.90696 z"
+           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+           id="path58"
+           inkscape:connector-curvature="0" /></g><g
+         id="g60"
+         transform="translate(56.447,68.499)"><g
+           id="g62"><g
+             id="g64"
+             transform="translate(-101.856,-152.97)"><text
+   transform="matrix(1,0,0,-1,101.856,152.97)"
+   id="text66"><tspan
+     style="font-size:7.97009993px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMR8;-inkscape-font-specification:CMR8"
+     x="0 5.4069157 8.7073345 12.941849 16.70533 19.057306 23.762056"
+     y="0"
+     sodipodi:role="line"
+     id="tspan68">Tracing</tspan></text>
+
+
+<g
+   id="g70"
+   transform="translate(101.856,152.97)" /></g></g><g
+           id="g72"
+           transform="translate(-56.447,-68.499)" /></g></g><g
+       transform="matrix(1.25,0,0,-1.25,56.76125,122.78375)"
+       style="display:inline"
+       id="g130"><path
+         d="m 7.8308,29.22702 c 6.14624,19.1698 18.54745,30.42239 36.0576,34.21565"
+         style="fill:none;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+         id="path132"
+         inkscape:connector-curvature="0" /><g
+         id="g134"
+         transform="matrix(0.97865,0.21199,-0.21199,0.97865,43.8884,63.44267)"><g
+           id="g136"><path
+             d="m 0.91655,0 c -1.14568,0.22913 -2.29138,0.68741 -3.66621,1.4894 1.37483,-1.03113 1.37483,-1.94767 0,-2.9788 1.37483,0.80199 2.52053,1.26027 3.66621,1.4894 z"
+             style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+             id="path138"
+             inkscape:connector-curvature="0" /></g></g><g
+         id="g140"><g
+           id="g142"
+           transform="translate(-41.588,57.135)"><g
+             id="g144"><g
+               id="g146"
+               transform="translate(-3.821,-141.606)"><text
+   transform="matrix(1,0,0,-1,3.821,141.606)"
+   id="text148"><tspan
+     style="font-size:6.97380018px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMTI7;-inkscape-font-specification:CMTI7"
+     x="0 4.2065964 8.4131927 14.163788 16.32218 20.117321 24.323917 31.508326 35.71492 39.512157 42.284939 45.670719 49.467953 52.240734 55.633488"
+     y="0"
+     sodipodi:role="line"
+     id="tspan150">hotloopdetected</tspan></text>
+
+
+<g
+   id="g152"
+   transform="translate(3.821,141.606)" /></g></g><g
+             id="g154"
+             transform="translate(41.588,-57.135)" /></g></g></g></g><g
+     inkscape:groupmode="layer"
+     id="layer2"
+     inkscape:label="compilation"
+     style="display:inline"><g
+       transform="matrix(1.25,0,0,-1.25,56.76125,122.78375)"
+       style="display:inline"
+       id="g74"><g
+         id="g76"><g
+           id="g78"><g
+             id="g80"
+             transform="translate(2.14474,-2.14474)"><path
+               d="m 197.05687,70.44759 c 0,14.90161 -12.07983,26.98144 -26.98145,26.98144 -14.90161,0 -26.98144,-12.07983 -26.98144,-26.98144 0,-14.90162 12.07983,-26.98145 26.98144,-26.98145 14.90162,0 26.98145,12.07983 26.98145,26.98145 z"
+               style="fill:#808080;fill-opacity:0.5;fill-rule:nonzero;stroke:none"
+               id="path82"
+               inkscape:connector-curvature="0" /></g></g></g><g
+         id="g84"><path
+           d="m 197.05687,70.44759 c 0,14.90161 -12.07983,26.98144 -26.98145,26.98144 -14.90161,0 -26.98144,-12.07983 -26.98144,-26.98144 0,-14.90162 12.07983,-26.98145 26.98144,-26.98145 14.90162,0 26.98145,12.07983 26.98145,26.98145 z"
+           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+           id="path86"
+           inkscape:connector-curvature="0" /></g><g
+         id="g88"
+         transform="translate(147.255,68.455)"><g
+           id="g90"><g
+             id="g92"
+             transform="translate(-192.664,-152.926)"><text
+   transform="matrix(1,0,0,-1,192.664,152.926)"
+   id="text94"><tspan
+     style="font-size:7.97009993px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMR8;-inkscape-font-specification:CMR8"
+     x="0 6.1162548 10.350769 17.407495 22.112246 24.464222 26.816198 31.050713 34.34396 36.695934 40.93045"
+     y="0"
+     sodipodi:role="line"
+     id="tspan96">Compilation</tspan></text>
+
+
+<g
+   id="g98"
+   transform="translate(192.664,152.926)" /></g></g><g
+           id="g100"
+           transform="translate(-147.255,-68.455)" /></g></g><g
+       transform="matrix(1.25,0,0,-1.25,56.76125,122.78375)"
+       style="display:inline"
+       id="g182"><path
+         d="m 92.34576,83.0905 c 18.11411,10.92772 35.50846,11.2639 52.09127,2.11029"
+         style="fill:none;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+         id="path184"
+         inkscape:connector-curvature="0" /><g
+         id="g186"
+         transform="matrix(0.87622,-0.48367,0.48367,0.87622,144.43703,85.20079)"><g
+           id="g188"><path
+             d="m 0.91655,0 c -1.14568,0.22913 -2.29138,0.68741 -3.66621,1.4894 1.37483,-1.03113 1.37483,-1.94767 0,-2.9788 1.37483,0.80199 2.52053,1.26027 3.66621,1.4894 z"
+             style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+             id="path190"
+             inkscape:connector-curvature="0" /></g></g></g></g><g
+     inkscape:groupmode="layer"
+     id="layer3"
+     inkscape:label="running"
+     style="display:inline"><g
+       transform="matrix(1.25,0,0,-1.25,56.76125,122.78375)"
+       style="display:inline"
+       id="g102"><g
+         id="g104"><g
+           id="g106"><g
+             id="g108"
+             transform="translate(2.14474,-2.14474)"><path
+               d="m 265.42998,0 c 0,13.7559 -11.15105,24.90694 -24.90695,24.90694 -13.75591,0 -24.90696,-11.15104 -24.90696,-24.90694 0,-13.7559 11.15105,-24.90694 24.90696,-24.90694 13.7559,0 24.90695,11.15104 24.90695,24.90694 z"
+               style="fill:#808080;fill-opacity:0.5;fill-rule:nonzero;stroke:none"
+               id="path110"
+               inkscape:connector-curvature="0" /></g></g></g><g
+         id="g112"><path
+           d="m 265.42998,0 c 0,13.7559 -11.15105,24.90694 -24.90695,24.90694 -13.75591,0 -24.90696,-11.15104 -24.90696,-24.90694 0,-13.7559 11.15105,-24.90694 24.90696,-24.90694 13.7559,0 24.90695,11.15104 24.90695,24.90694 z"
+           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+           id="path114"
+           inkscape:connector-curvature="0" /></g><g
+         id="g116"
+         transform="translate(224.702,-1.948)"><g
+           id="g118"><g
+             id="g120"
+             transform="translate(-270.111,-82.523)"><text
+   transform="matrix(1,0,0,-1,270.111,82.523)"
+   id="text122"><tspan
+     style="font-size:7.97009993px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMR8;-inkscape-font-specification:CMR8"
+     x="0 6.2294302 10.93418 15.63893 20.343679 22.695656 27.400406"
+     y="0"
+     sodipodi:role="line"
+     id="tspan124">Running</tspan></text>
+
+
+<g
+   id="g126"
+   transform="translate(270.111,82.523)" /></g></g><g
+           id="g128"
+           transform="translate(-224.702,1.948)" /></g></g><g
+       transform="matrix(1.25,0,0,-1.25,56.76125,122.78375)"
+       style="display:inline"
+       id="g192"><path
+         d="m 196.47784,63.3736 c 20.31107,-5.86295 32.43097,-18.45757 36.97692,-36.8283"
+         style="fill:none;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+         id="path194"
+         inkscape:connector-curvature="0" /><g
+         id="g196"
+         transform="matrix(0.24063,-0.97238,0.97238,0.24063,233.45476,26.5453)"><g
+           id="g198"><path
+             d="m 0.91655,0 c -1.14568,0.22913 -2.29138,0.68741 -3.66621,1.4894 1.37483,-1.03113 1.37483,-1.94767 0,-2.9788 1.37483,0.80199 2.52053,1.26027 3.66621,1.4894 z"
+             style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+             id="path200"
+             inkscape:connector-curvature="0" /></g></g></g></g><g
+     inkscape:groupmode="layer"
+     id="layer4"
+     inkscape:label="cold_guard"
+     style="display:inline"><g
+       transform="matrix(1.25,0,0,-1.25,56.76125,122.78375)"
+       style="display:inline"
+       id="g202"><path
+         d="M 224.24709,-19.39551 C 173.87463,-81.7608 72.17174,-83.67355 20.95428,-24.90617"
+         style="fill:none;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+         id="path204"
+         inkscape:connector-curvature="0" /><g
+         id="g206"
+         transform="matrix(-0.65752,0.75444,-0.75444,-0.65752,20.95428,-24.90617)"><g
+           id="g208"><path
+             d="m 0.91655,0 c -1.14568,0.22913 -2.29138,0.68741 -3.66621,1.4894 1.37483,-1.03113 1.37483,-1.94767 0,-2.9788 1.37483,0.80199 2.52053,1.26027 3.66621,1.4894 z"
+             style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+             id="path210"
+             inkscape:connector-curvature="0" /></g></g><g
+         id="g212"><g
+           id="g214"
+           transform="translate(93.378,-75.828)"><g
+             id="g216"><g
+               id="g218"
+               transform="translate(-138.787,-8.643)"><text
+   transform="matrix(1,0,0,-1,138.787,8.643)"
+   id="text220"><tspan
+     style="font-size:6.97380018px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMTI7;-inkscape-font-specification:CMTI7"
+     x="0 3.3857799 7.5923762 9.7507668 16.935177 20.73241 25.144035 29.350632 32.428867 39.613277 42.181728 46.388325 48.956772 51.115166 54.507919"
+     y="0"
+     sodipodi:role="line"
+     id="tspan222">coldguardfailed</tspan></text>
+
+
+<g
+   id="g224"
+   transform="translate(138.787,8.643)" /></g></g><g
+             id="g226"
+             transform="translate(-93.378,75.828)" /></g></g></g></g><g
+     inkscape:groupmode="layer"
+     id="layer5"
+     inkscape:label="compiled_loop"
+     style="display:inline"><g
+       transform="matrix(1.25,0,0,-1.25,56.76125,122.78375)"
+       style="display:inline"
+       id="g156"><path
+         d="M 215.66725,-9.05807 C 147.99724,-34.38509 97.67914,-34.84343 29.35406,-10.67384"
+         style="fill:none;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+         id="path158"
+         inkscape:connector-curvature="0" /><g
+         id="g160"
+         transform="matrix(0.93787,0.35104,-0.35104,0.93787,215.66725,-9.05807)"><g
+           id="g162"><path
+             d="m 0.91655,0 c -1.14568,0.22913 -2.29138,0.68741 -3.66621,1.4894 1.37483,-1.03113 1.37483,-1.94767 0,-2.9788 1.37483,0.80199 2.52053,1.26027 3.66621,1.4894 z"
+             style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+             id="path164"
+             inkscape:connector-curvature="0" /></g></g><g
+         id="g166"><g
+           id="g168"
+           transform="translate(82.498,-36.794)"><g
+             id="g170"><g
+               id="g172"
+               transform="translate(-127.907,-47.677)"><text
+   transform="matrix(1,0,0,-1,127.907,47.677)"
+   id="text174"><tspan
+     style="font-size:6.97380018px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMTI7;-inkscape-font-specification:CMTI7"
+     x="0 3.7972341 8.4131927 11.185975 14.98321 18.472898 21.041349 25.657307 32.432354 35.818134 40.024731 46.688892 50.895489 53.46394 55.62233 59.00811 66.19252 68.350914 72.15303 76.359627"
+     y="0"
+     sodipodi:role="line"
+     id="tspan176">enteringcompiledloop</tspan></text>
+
+
+<g
+   id="g178"
+   transform="translate(127.907,47.677)" /></g></g><g
+             id="g180"
+             transform="translate(-82.498,36.794)" /></g></g></g></g><g
+     inkscape:groupmode="layer"
+     id="layer6"
+     inkscape:label="bridge"
+     style="display:inline"><g
+       transform="matrix(1.25,0,0,-1.25,56.76125,122.78375)"
+       style="display:inline"
+       id="g228"><path
+         d="M 215.52757,3.29033 C 163.03967,10.19096 132.52094,22.82886 92.27628,53.69821"
+         style="fill:none;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+         id="path230"
+         inkscape:connector-curvature="0" /><g
+         id="g232"
+         transform="matrix(-0.79616,0.61072,-0.61072,-0.79616,92.27628,53.69821)"><g
+           id="g234"><path
+             d="m 0.91655,0 c -1.14568,0.22913 -2.29138,0.68741 -3.66621,1.4894 1.37483,-1.03113 1.37483,-1.94767 0,-2.9788 1.37483,0.80199 2.52053,1.26027 3.66621,1.4894 z"
+             style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+             id="path236"
+             inkscape:connector-curvature="0" /></g></g><g
+         id="g238"><g
+           id="g240"
+           transform="translate(74.916,11.213)"><g
+             id="g242"><g
+               id="g244"
+               transform="translate(-120.325,-95.684)"><text
+   transform="matrix(1,0,0,-1,120.325,95.684)"
+   id="text246"><tspan
+     style="font-size:6.97380018px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMTI7;-inkscape-font-specification:CMTI7"
+     x="0 3.7972341 8.2088604 12.415456 15.493691 22.678101 25.246552 29.453146 32.021599 34.179989 38.591614 41.669849"
+     y="0"
+     sodipodi:role="line"
+     id="tspan248">guardfailure</tspan></text>
+
+
+<text
+   transform="matrix(1,0,0,-1,168.772,95.684)"
+   id="text250"><tspan
+     style="font-size:6.97380018px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMSY7;-inkscape-font-specification:CMSY7"
+     x="0"
+     y="0"
+     id="tspan252">→</tspan></text>
+
+
+<text
+   transform="matrix(1,0,0,-1,179.692,95.684)"
+   id="text254"><tspan
+     style="font-size:6.97380018px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMTI7;-inkscape-font-specification:CMTI7"
+     x="0 4.2065964 8.4131927"
+     y="0"
+     sodipodi:role="line"
+     id="tspan256">hot</tspan></text>
+
+
+<g
+   id="g258"
+   transform="translate(120.325,95.684)" /></g></g><g
+             id="g260"
+             transform="translate(-74.916,-11.213)" /></g></g></g></g><g
+     inkscape:groupmode="layer"
+     id="layer7"
+     inkscape:label="hot_guard"
+     style="display:inline"><g
+       transform="matrix(1.25,0,0,-1.25,56.76125,122.78375)"
+       id="g262"><path
+         d="m 247.05948,-24.39468 c 10.55665,-39.39658 -23.62958,-39.39658 -13.64681,-2.14055"
+         style="fill:none;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+         id="path264"
+         inkscape:connector-curvature="0" /><g
+         id="g266"
+         transform="matrix(0.25931,0.96782,-0.96782,0.25931,233.41267,-26.53523)"><g
+           id="g268"><path
+             d="m 0.91655,0 c -1.14568,0.22913 -2.29138,0.68741 -3.66621,1.4894 1.37483,-1.03113 1.37483,-1.94767 0,-2.9788 1.37483,0.80199 2.52053,1.26027 3.66621,1.4894 z"
+             style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.59776002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
+             id="path270"
+             inkscape:connector-curvature="0" /></g></g><g
+         id="g272"><g
+           id="g274"
+           transform="translate(212.551,-62.403)"><g
+             id="g276"><g
+               id="g278"
+               transform="translate(-257.96,-22.068)"><text
+   transform="matrix(1,0,0,-1,257.96,22.068)"
+   id="text280"><tspan
+     style="font-size:6.97380018px;font-variant:normal;font-weight:normal;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;font-family:CMTI7;-inkscape-font-specification:CMTI7"
+     x="0 4.2065964 8.4131927 14.163788 17.961021 22.372648 26.579245 29.657478 36.841888 39.410339 43.616936 46.185387 48.343777 51.729557"
+     y="0"
+     sodipodi:role="line"
+     id="tspan282">hotguardfailed</tspan></text>
+
+
+<g
+   id="g284"
+   transform="translate(257.96,22.068)" /></g></g><g
+             id="g286"
+             transform="translate(-212.551,62.403)" /></g></g></g></g></svg>
\ No newline at end of file
diff --git a/talk/bucharest2016/jit-frontend/stylesheet.latex b/talk/bucharest2016/jit-frontend/stylesheet.latex
new file mode 100644
--- /dev/null
+++ b/talk/bucharest2016/jit-frontend/stylesheet.latex
@@ -0,0 +1,11 @@
+\usetheme{Boadilla}
+\usecolortheme{whale}
+\setbeamercovered{transparent}
+\setbeamertemplate{navigation symbols}{}
+
+\definecolor{darkgreen}{rgb}{0, 0.5, 0.0}
+\newcommand{\docutilsrolegreen}[1]{\color{darkgreen}#1\normalcolor}
+\newcommand{\docutilsrolered}[1]{\color{red}#1\normalcolor}
+
+\newcommand{\green}[1]{\color{darkgreen}#1\normalcolor}
+\newcommand{\red}[1]{\color{red}#1\normalcolor}
diff --git a/talk/bucharest2016/jit-frontend/talk.pdf b/talk/bucharest2016/jit-frontend/talk.pdf
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4ad8022637420b08f8a93bc24ddfd00d4b13adb2
GIT binary patch

[cut]

diff --git a/talk/bucharest2016/jit-frontend/talk.rst b/talk/bucharest2016/jit-frontend/talk.rst
new file mode 100644
--- /dev/null
+++ b/talk/bucharest2016/jit-frontend/talk.rst
@@ -0,0 +1,544 @@
+.. include:: beamerdefs.txt
+
+================================
+PyPy Intro and JIT Frontend
+================================
+
+About this talk
+----------------
+
+* What is PyPy? What is RPython?
+
+* Tracing JIT 101
+
+* PyPy JIT frontend and optimizer
+
+  - "how we manage to make things fast"
+
+
+Part 1
+-------
+
+**PyPy introduction**
+
+What is PyPy?
+--------------
+
+* For most people, the final product:
+
+|scriptsize|
+
+.. sourcecode:: python
+
+    $ pypy
+    Python 2.7.10 (173add34cdd2, Mar 15 2016, 23:00:19)
+    [PyPy 5.1.0-alpha0 with GCC 4.8.4] on linux2
+    >>>> import test.pystone
+    >>>> test.pystone.main()
+    Pystone(1.1) time for 50000 passes = 0.0473992
+    This machine benchmarks at 1.05487e+06 pystones/second
+
+|end_scriptsize|
+
+* More in general: a broader project, ecosystem and community
+
+
+PyPy as a project
+------------------
+
+* ``rpython``: a fancy compiler
+
+  - source code: "statically typed Python with type inference and metaprogramming"
+
+  - fancy features: C-like performance, GC, meta-JIT
+
+  - "like GCC" (it statically produces a binary)
+
+  - you can run RPython programs on top of CPython (veeery slow, for
+    development only)
+
+|pause|
+
+* ``pypy``: a Python interpreter
+
+  - "like CPython", but written in RPython
+
+  - CPython : GCC = PyPy : RPython
+
+
+
+Important fact
+---------------
+
+* We **did not** write a JIT compiler for Python
+
+* The "meta JIT" works with all RPython programs
+
+* The "Python JIT" is automatically generated from the interpreter
+
+* Writing an interpreter is vastly easier than a compiler
+
+* Other interpreters: smalltalk, prolog, ruby, php, ...
+
+
+The final product
+------------------
+
+* ``rpython`` + ``pypy``: the final binary you download and execute
+
+  - a Python interpreter
+
+  - with a GC
+
+  - with a JIT
+
+  - fast
+
+
+
+Part 2
+------
+
+**Overview of tracing JITs**
+
+
+Assumptions
+-----------
+
+* Pareto Principle (80-20 rule)
+
+  - the 20% of the program accounts for the 80% of the runtime
+
+  - **hot-spots**
+
+* Fast Path principle
+
+  - optimize only what is necessary
+
+  - fall back for uncommon cases
+
+|pause|
+
+* Most of runtime spent in **loops**
+
+* Always the same code paths (likely)
+
+
+Tracing JIT
+-----------
+
+* Interpret the program as usual
+
+* Detect **hot** loops
+
+* Tracing phase
+
+  - **linear** trace
+
+* Compiling
+
+* Execute
+
+  - guards to ensure correctness
+
+* Profit :-)
+
+
+Tracing JIT phases
+-------------------
+
+.. animage:: diagrams/tracing-phases-p*.pdf
+   :align: center


More information about the pypy-commit mailing list