[pypy-svn] r62901 - pypy/branch/pyjitpl5/pypy/jit/metainterp
fijal at codespeak.net
fijal at codespeak.net
Thu Mar 12 19:10:29 CET 2009
Author: fijal
Date: Thu Mar 12 19:10:28 2009
New Revision: 62901
Modified:
pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py
Log:
a hack for dead code. probably requires proper fix
Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py (original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py Thu Mar 12 19:10:28 2009
@@ -116,6 +116,17 @@
fnptr = self.rtyper.getcallable(graph)
cfnptr = history.ConstAddr(llmemory.cast_ptr_to_adr(fnptr), self.cpu)
FUNC = lltype.typeOf(fnptr).TO
+ # <hack>
+ # these functions come from somewhere and are never called. make sure
+ # we never store a pointer to them since they make C explode,
+ # need to find out where they come from
+ for ARG in FUNC.ARGS:
+ if isinstance(ARG, lltype.Ptr) and ARG.TO == lltype.PyObject:
+ return ()
+ if (isinstance(FUNC.RESULT, lltype.Ptr) and
+ FUNC.RESULT.TO == lltype.PyObject):
+ return ()
+ # </hack>
NON_VOID_ARGS = [ARG for ARG in FUNC.ARGS if ARG is not lltype.Void]
calldescr = self.cpu.calldescrof(NON_VOID_ARGS, FUNC.RESULT)
return (cfnptr, calldescr)
More information about the Pypy-commit
mailing list