[pypy-commit] pypy jit-short_from_state: kill some randomness while running tests

hakanardo noreply at buildbot.pypy.org
Fri Aug 12 09:49:50 CEST 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-short_from_state
Changeset: r46450:55199b392674
Date: 2011-08-12 09:52 +0200
http://bitbucket.org/pypy/pypy/changeset/55199b392674/

Log:	kill some randomness while running tests

diff --git a/pypy/jit/metainterp/optimizeopt/heap.py b/pypy/jit/metainterp/optimizeopt/heap.py
--- a/pypy/jit/metainterp/optimizeopt/heap.py
+++ b/pypy/jit/metainterp/optimizeopt/heap.py
@@ -165,7 +165,17 @@
         return OptHeap()
         
     def produce_potential_short_preamble_ops(self, sb):
-        for descr, d in self.cached_fields.items():
+        descrkeys = self.cached_fields.keys()
+        if not we_are_translated():
+            # XXX Pure operation of boxes that are cached in several places will
+            #     only be removed from the peeled loop when red from the first
+            #     place discovered here. This is far from ideal, as it makes
+            #     the effectiveness of our optimization a bit random. It should
+            #     howevere always generate correct results. For tests we dont
+            #     want this randomness.
+            descrkeys.sort(key=str, reverse=True)
+        for descr in descrkeys:
+            d = self.cached_fields[descr]
             d.produce_potential_short_preamble_ops(self.optimizer, sb, descr)
 
         for descr, submap in self.cached_arrayitems.items():


More information about the pypy-commit mailing list