Author: Armin Rigo <[email protected]>
Branch: stm-thread-2
Changeset: r57792:5b4fe54db34a
Date: 2012-10-05 13:23 +0200
http://bitbucket.org/pypy/pypy/changeset/5b4fe54db34a/
Log: Delayed pointers are not the same as external pointers. For now,
just return top_result().
diff --git a/pypy/translator/backendopt/graphanalyze.py
b/pypy/translator/backendopt/graphanalyze.py
--- a/pypy/translator/backendopt/graphanalyze.py
+++ b/pypy/translator/backendopt/graphanalyze.py
@@ -73,6 +73,15 @@
if op.opname == "direct_call":
graph = get_graph(op.args[0], self.translator)
if graph is None:
+ try: # detect calls to DelayedPointers
+ op.args[0].value._obj
+ except AttributeError:
+ pass # ootype
+ except lltype.DelayedPointer:
+ x = self.top_result()
+ if self.verbose:
+ print '\tdelayed pointer %s: %r' % (op, x)
+ return x
x = self.analyze_external_call(op, seen)
if self.verbose and x:
print '\tanalyze_external_call %s: %r' % (op, x)
diff --git a/pypy/translator/simplify.py b/pypy/translator/simplify.py
--- a/pypy/translator/simplify.py
+++ b/pypy/translator/simplify.py
@@ -21,9 +21,9 @@
Return an object which is supposed to have attributes such as graph and
_callable
"""
- if hasattr(func, '_obj'):
+ try:
return func._obj # lltypesystem
- else:
+ except AttributeError:
return func # ootypesystem
def get_functype(TYPE):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit