[pypy-svn] pypy jit-short-preamble: debugging

hakanardo commits-noreply at bitbucket.org
Sun Jan 9 11:37:43 CET 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-short-preamble
Changeset: r40503:b50bb976d0a0
Date: 2011-01-08 19:15 +0100
http://bitbucket.org/pypy/pypy/changeset/b50bb976d0a0/

Log:	debugging

diff --git a/pypy/jit/tl/pypyjit_demo.py b/pypy/jit/tl/pypyjit_demo.py
--- a/pypy/jit/tl/pypyjit_demo.py
+++ b/pypy/jit/tl/pypyjit_demo.py
@@ -3,14 +3,16 @@
     import pypyjit
     pypyjit.set_param(threshold=3, inlining=True)
 
-    def main():
-        i=a=0
-        while i<10:
-            i+=1
-            a+=1
-        return a
+    def sqrt(y, n=10000):
+        x = y / 2
+        while n > 0:
+            #assert y > 0 and x > 0
+            if y > 0 and x > 0: pass
+            n -= 1
+            x = (x + y/x) / 2
+        return x
 
-    print main()
+    print sqrt(1234, 4)
     
 except Exception, e:
     print "Exception: ", type(e)


More information about the Pypy-commit mailing list