[pypy-commit] pypy pypy-in-a-box: an experiment with secondary entrypoints

fijal noreply at buildbot.pypy.org
Wed Jul 18 12:09:16 CEST 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: pypy-in-a-box
Changeset: r56125:9c710fd98326
Date: 2012-07-18 12:08 +0200
http://bitbucket.org/pypy/pypy/changeset/9c710fd98326/

Log:	an experiment with secondary entrypoints

diff --git a/pypy/objspace/std/embedding.py b/pypy/objspace/std/embedding.py
--- a/pypy/objspace/std/embedding.py
+++ b/pypy/objspace/std/embedding.py
@@ -1,10 +1,8 @@
 
+from pypy.rlib.entrypoint import entrypoint
 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.rpython.lltypesystem.lloperation import llop
-from pypy.interpreter.pyopcode import prepare_exec
-from pypy.interpreter.pycode import PyCode
 from pypy.interpreter.error import OperationError
-from pypy.interpreter import eval
 
 FUNCTIONS = {}
 
@@ -65,5 +63,8 @@
     return res
 
 def initialize(space):
-    for name, func in FUNCTIONS.iteritems():
-        pass
+    for name, (func, argtypes, restype) in FUNCTIONS.iteritems():
+        def newfunc(*args):
+            return func(space, *args)
+        deco = entrypoint("embedding", argtypes, 'pypy_' + name, relax=True)
+        deco(newfunc)


More information about the pypy-commit mailing list