[pypy-commit] extradoc extradoc: - add a nice function around the loop
cfbolz
noreply at buildbot.pypy.org
Mon Jul 23 16:17:57 CEST 2012
Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: extradoc
Changeset: r4331:e37e40c69dc2
Date: 2012-07-23 16:08 +0200
http://bitbucket.org/pypy/extradoc/changeset/e37e40c69dc2/
Log: - add a nice function around the loop
- remove hint
- remove variable from the trace that's an artefact of how things are
produced
diff --git a/talk/vmil2012/figures/example.tex b/talk/vmil2012/figures/example.tex
--- a/talk/vmil2012/figures/example.tex
+++ b/talk/vmil2012/figures/example.tex
@@ -20,10 +20,12 @@
return None
return self.build(n)
-while j < 100:
- j += 1
- myjitdriver.jit_merge_point(j=j, a=a)
- if a is None:
- break
- a = a.f()
+def check_reduces(a):
+ j = 1
+ while j < 100:
+ j += 1
+ if a is None:
+ return True
+ a = a.f()
+ return False
\end{lstlisting}
diff --git a/talk/vmil2012/figures/log.tex b/talk/vmil2012/figures/log.tex
--- a/talk/vmil2012/figures/log.tex
+++ b/talk/vmil2012/figures/log.tex
@@ -1,26 +1,26 @@
-\begin{verbatim}
-[i0, i1, p2]
-label(i0, i1, p2, descr=label0))
-guard_nonnull_class(p2, Even) [i1, i0, p2]
+\begin{lstlisting}[mathescape]
+[i1, p2]
+label(i1, p2, descr=label0))
+guard_nonnull_class(p2, Even) [i1, p2]
i4 = getfield_gc(p2, descr='value')
i6 = int_rshift(i4, 2)
i8 = int_eq(i6, 1)
-guard_false(i8) [i6, i1, i0]
+guard_false(i8) [i6, i1]
i10 = int_and(i6, 1)
i11 = int_is_zero(i10)
-guard_true(i11) [i6, i1, i0]
+guard_true(i11) [i6, i1]
i13 = int_lt(i1, 100)
-guard_true(i13) [i1, i0, i6]
+guard_true(i13) [i1, i6]
i15 = int_add(i1, 1)
-label(i0, i15, i6, descr=label1)
+label(i15, i6, descr=label1)
i16 = int_rshift(i6, 2)
i17 = int_eq(i16, 1)
-guard_false(i17) [i16, i15, i0]
+guard_false(i17) [i16, i15]
i18 = int_and(i16, 1)
i19 = int_is_zero(i18)
-guard_true(i19) [i16, i15, i0]
+guard_true(i19) [i16, i15]
i20 = int_lt(i15, 100)
-guard_true(i20) [i15, i0, i16]
+guard_true(i20) [i15, i16]
i21 = int_add(i15, 1)
-jump(i0, i21, i16, descr=label1)
-\end{verbatim}
+jump(i21, i16, descr=label1)
+\end{lstlisting}
More information about the pypy-commit
mailing list