[pypy-svn] r69803 - in pypy/trunk/pypy/jit: backend/llgraph metainterp

arigo at codespeak.net arigo at codespeak.net
Tue Dec 1 15:20:17 CET 2009


Author: arigo
Date: Tue Dec  1 15:20:15 2009
New Revision: 69803

Modified:
   pypy/trunk/pypy/jit/backend/llgraph/runner.py
   pypy/trunk/pypy/jit/metainterp/optimizefindnode.py
Log:
Document sort_key().  Kill an unused method.


Modified: pypy/trunk/pypy/jit/backend/llgraph/runner.py
==============================================================================
--- pypy/trunk/pypy/jit/backend/llgraph/runner.py	(original)
+++ pypy/trunk/pypy/jit/backend/llgraph/runner.py	Tue Dec  1 15:20:15 2009
@@ -32,6 +32,10 @@
         return self.extrainfo
 
     def sort_key(self):
+        """Returns an integer that can be used as a key when sorting the
+        field descrs of a single structure.  The property that this
+        number has is simply that two different field descrs of the same
+        structure give different numbers."""
         return self.ofs
 
     def is_pointer_field(self):
@@ -46,11 +50,6 @@
     def is_array_of_floats(self):
         return self.typeinfo == FLOAT
 
-    def equals(self, other):
-        if not isinstance(other, Descr):
-            return False
-        return self.sort_key() == other.sort_key()
-
     def __lt__(self, other):
         raise TypeError("cannot use comparison on Descrs")
     def __le__(self, other):

Modified: pypy/trunk/pypy/jit/metainterp/optimizefindnode.py
==============================================================================
--- pypy/trunk/pypy/jit/metainterp/optimizefindnode.py	(original)
+++ pypy/trunk/pypy/jit/metainterp/optimizefindnode.py	Tue Dec  1 15:20:15 2009
@@ -371,6 +371,7 @@
                 d.setdefault(ofs, self.node_escaped)
         if d is not None:
             lst = d.keys()
+            # we always use the "standardized" order of fields
             sort_descrs(lst)
             for ofs in lst:
                 try:



More information about the Pypy-commit mailing list