[pypy-svn] r22858 - pypy/dist/pypy/rpython
mwh at codespeak.net
mwh at codespeak.net
Sun Jan 29 19:46:38 CET 2006
Author: mwh
Date: Sun Jan 29 19:46:36 2006
New Revision: 22858
Modified:
pypy/dist/pypy/rpython/annlowlevel.py
pypy/dist/pypy/rpython/rspecialcase.py
Log:
a way for a function to have special things happen when you
annotate/rtype it begin called in a low level helper
Modified: pypy/dist/pypy/rpython/annlowlevel.py
==============================================================================
--- pypy/dist/pypy/rpython/annlowlevel.py (original)
+++ pypy/dist/pypy/rpython/annlowlevel.py Sun Jan 29 19:46:36 2006
@@ -44,6 +44,10 @@
allow_someobjects = False
def default_specialize(pol, funcdesc, args_s):
+ if hasattr(funcdesc, 'pyobj') and hasattr(funcdesc.pyobj, 'llresult'):
+ # XXX bug mwh to write some tests for this stuff
+ funcdesc.overridden = True
+ return annmodel.lltype_to_annotation(funcdesc.pyobj.llresult)
key = []
new_args_s = []
for s_obj in args_s:
Modified: pypy/dist/pypy/rpython/rspecialcase.py
==============================================================================
--- pypy/dist/pypy/rpython/rspecialcase.py (original)
+++ pypy/dist/pypy/rpython/rspecialcase.py Sun Jan 29 19:46:36 2006
@@ -7,6 +7,9 @@
if len(s_pbc.descriptions) != 1:
raise TyperError("not monomorphic call_specialcase")
desc, = s_pbc.descriptions
+ if hasattr(desc.pyobj, 'compute_ll_ops'):
+ # XXX bug mwh to write some tests for this stuff
+ return desc.pyobj.compute_ll_ops(hop)
tag = desc.pyobj._annspecialcase_
if not tag.startswith("override:"):
raise TyperError("call_specialcase only supports 'override:' functions")
More information about the Pypy-commit
mailing list