[pypy-svn] r7235 - in pypy/trunk/src/pypy: interpreter objspace/flow
mwh at codespeak.net
mwh at codespeak.net
Mon Nov 15 12:27:38 CET 2004
Author: mwh
Date: Mon Nov 15 12:27:37 2004
New Revision: 7235
Modified:
pypy/trunk/src/pypy/interpreter/baseobjspace.py
pypy/trunk/src/pypy/objspace/flow/objspace.py
Log:
A rather hackish way for functions to lie to the flow object space about
what its code is.
Modified: pypy/trunk/src/pypy/interpreter/baseobjspace.py
==============================================================================
--- pypy/trunk/src/pypy/interpreter/baseobjspace.py (original)
+++ pypy/trunk/src/pypy/interpreter/baseobjspace.py Mon Nov 15 12:27:37 2004
@@ -41,6 +41,7 @@
return self.generalcache[key]
except KeyError:
return self.generalcache.setdefault(key, builder(key, self))
+ loadfromcache.translated_version = lambda s, k, b: s.generalcache[k]
def make_builtins(self, for_builtins):
# initializing builtins may require creating a frame which in
Modified: pypy/trunk/src/pypy/objspace/flow/objspace.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/flow/objspace.py (original)
+++ pypy/trunk/src/pypy/objspace/flow/objspace.py Mon Nov 15 12:27:37 2004
@@ -108,6 +108,7 @@
def build_flow(self, func, constargs={}):
"""
"""
+ func = getattr(func, "translated_version", func)
code = func.func_code
code = PyCode()._from_code(code)
if func.func_closure is None:
More information about the Pypy-commit
mailing list