[pypy-commit] pypy default: Improve pypyjit.py enough to make it work

fijal noreply at buildbot.pypy.org
Tue Oct 22 20:46:42 CEST 2013


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r67521:ff807f024c0a
Date: 2013-10-22 20:45 +0200
http://bitbucket.org/pypy/pypy/changeset/ff807f024c0a/

Log:	Improve pypyjit.py enough to make it work

diff --git a/pypy/tool/pypyjit.py b/pypy/tool/pypyjit.py
--- a/pypy/tool/pypyjit.py
+++ b/pypy/tool/pypyjit.py
@@ -28,15 +28,16 @@
 config.translation.backendopt.inline_threshold = 0.1
 config.translation.gc = 'boehm'
 config.translating = True
+config.translation.rweakref = False
 set_opt_level(config, level='jit')
 config.objspace.allworkingmodules = False
 config.objspace.usemodules.pypyjit = True
 config.objspace.usemodules.array = False
-config.objspace.usemodules._weakref = True
+config.objspace.usemodules._weakref = False
 config.objspace.usemodules._sre = False
 config.objspace.usemodules._lsprof = False
 #
-config.objspace.usemodules._ffi = True
+config.objspace.usemodules._ffi = False
 config.objspace.usemodules.micronumpy = False
 #
 set_pypy_opt_level(config, level='jit')
@@ -101,7 +102,7 @@
 
     from rpython.jit.codewriter.codewriter import CodeWriter
     CodeWriter.debug = True
-    from rpython.jit.tl.pypyjit_child import run_child
+    from pypy.tool.pypyjit_child import run_child
     run_child(globals(), locals())
 
 
diff --git a/pypy/tool/pypyjit_demo.py b/pypy/tool/pypyjit_demo.py
--- a/pypy/tool/pypyjit_demo.py
+++ b/pypy/tool/pypyjit_demo.py
@@ -1,27 +1,20 @@
-import pypyjit
-pypyjit.set_param(threshold=200)
 
-kwargs = {"z": 1}
+def g(i):
+    k = 0
+    while k < 3:
+        k += 1
+    return i + 1
 
-def f(*args, **kwargs):
-    result = g(1, *args, **kwargs)
-    return result + 2
+def f(x):
+    for i in range(10000):
+        t = (1, 2, i)
+        i = g(i)
+        x == t
 
-def g(x, y, z=2):
-    return x - y + z
-
-def main():
-    res = 0
-    i = 0
-    while i < 10000:
-        res = f(res, z=i)
-        g(1, res, **kwargs)
-        i += 1
-    return res
 
 
 try:
-    print main()
+    f((1, 2, 3))
 
 except Exception, e:
     print "Exception: ", type(e)


More information about the pypy-commit mailing list