[pypy-commit] pypy default: merge heads

arigo noreply at buildbot.pypy.org
Thu Oct 24 11:45:25 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r67562:8d2f699e2f5b
Date: 2013-10-24 11:44 +0200
http://bitbucket.org/pypy/pypy/changeset/8d2f699e2f5b/

Log:	merge heads

diff --git a/rpython/jit/codewriter/call.py b/rpython/jit/codewriter/call.py
--- a/rpython/jit/codewriter/call.py
+++ b/rpython/jit/codewriter/call.py
@@ -11,6 +11,7 @@
 from rpython.rtyper.lltypesystem import lltype, llmemory
 from rpython.translator.backendopt.canraise import RaiseAnalyzer
 from rpython.translator.backendopt.writeanalyze import ReadWriteAnalyzer
+from rpython.translator.backendopt.graphanalyze import DependencyTracker
 
 
 class CallControl(object):
@@ -35,6 +36,7 @@
         #
         for index, jd in enumerate(jitdrivers_sd):
             jd.index = index
+        self.seen = DependencyTracker(self.readwrite_analyzer)
 
     def find_all_graphs(self, policy):
         try:
@@ -231,8 +233,8 @@
                 extraeffect = EffectInfo.EF_CANNOT_RAISE
         #
         effectinfo = effectinfo_from_writeanalyze(
-            self.readwrite_analyzer.analyze(op), self.cpu, extraeffect,
-            oopspecindex, can_invalidate, call_release_gil_target,
+            self.readwrite_analyzer.analyze(op, self.seen), self.cpu,
+            extraeffect, oopspecindex, can_invalidate, call_release_gil_target,
         )
         #
         assert effectinfo is not None
diff --git a/rpython/jit/metainterp/heapcache.py b/rpython/jit/metainterp/heapcache.py
--- a/rpython/jit/metainterp/heapcache.py
+++ b/rpython/jit/metainterp/heapcache.py
@@ -82,6 +82,7 @@
         # GETFIELD_GC, MARK_OPAQUE_PTR, PTR_EQ, and PTR_NE don't escape their
         # arguments
         elif (opnum != rop.GETFIELD_GC and
+              opnum != rop.GETFIELD_GC_PURE and
               opnum != rop.MARK_OPAQUE_PTR and
               opnum != rop.PTR_EQ and
               opnum != rop.PTR_NE and
diff --git a/rpython/rtyper/lltypesystem/lltype.py b/rpython/rtyper/lltypesystem/lltype.py
--- a/rpython/rtyper/lltypesystem/lltype.py
+++ b/rpython/rtyper/lltypesystem/lltype.py
@@ -97,8 +97,16 @@
     def __eq__(self, other):
         if isinstance(other, Typedef):
             return other.__eq__(self)
-        return self.__class__ is other.__class__ and (
-            self is other or safe_equal(self.__dict__, other.__dict__))
+        if self.__class__ is other.__class__:
+            if self is other:
+                return True
+            try:
+                if hash(self) != hash(other):
+                    return False
+            except TypeError:
+                pass # too bad, we can't use a fastpath here
+            return safe_equal(self.__dict__, other.__dict__)
+        return False
 
     def __ne__(self, other):
         return not (self == other)
@@ -227,6 +235,9 @@
         self.OF = OF
         self.c_name = c_name
 
+    def __hash__(self):
+        return hash(self.OF)
+
     def __repr__(self):
         return '<Typedef "%s" of %r>' % (self.c_name, self.OF)
 
diff --git a/rpython/translator/backendopt/writeanalyze.py b/rpython/translator/backendopt/writeanalyze.py
--- a/rpython/translator/backendopt/writeanalyze.py
+++ b/rpython/translator/backendopt/writeanalyze.py
@@ -4,6 +4,7 @@
 top_set = object()
 empty_set = frozenset()
 
+CUTOFF = 1000
 
 class WriteAnalyzer(graphanalyze.GraphAnalyzer):
     def bottom_result(self):
@@ -21,6 +22,8 @@
     def add_to_result(self, result, other):
         if other is top_set:
             return top_set
+        if len(other) + len(result) > CUTOFF:
+            return top_set
         result.update(other)
         return result
 


More information about the pypy-commit mailing list