[pypy-commit] pypy result-in-resops: success in running some tests with optimizations on

fijal noreply at buildbot.pypy.org
Wed Jul 25 01:12:07 CEST 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: result-in-resops
Changeset: r56441:150214cc2e9a
Date: 2012-07-25 01:11 +0200
http://bitbucket.org/pypy/pypy/changeset/150214cc2e9a/

Log:	success in running some tests with optimizations on

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
@@ -257,11 +257,7 @@
             opnum == rop.COPYSTRCONTENT or       # no effect on GC struct/array
             opnum == rop.COPYUNICODECONTENT):    # no effect on GC struct/array
             return
-        if (opnum == rop.CALL or
-            opnum == rop.CALL_PURE or
-            opnum == rop.CALL_MAY_FORCE or
-            opnum == rop.CALL_RELEASE_GIL or
-            opnum == rop.CALL_ASSEMBLER):
+        if opnum in opgroups.ALLCALLS:
             if opnum == rop.CALL_ASSEMBLER:
                 self._seen_guard_not_invalidated = False
             else:
diff --git a/pypy/jit/metainterp/optimizeopt/optimizer.py b/pypy/jit/metainterp/optimizeopt/optimizer.py
--- a/pypy/jit/metainterp/optimizeopt/optimizer.py
+++ b/pypy/jit/metainterp/optimizeopt/optimizer.py
@@ -528,7 +528,10 @@
             return None
         else:
             self.ensure_imported(value)
-            return value.force_box(self)
+            value = value.force_box(self)
+            if value is v:
+                return None
+            return value
 
     @specialize.argtype(0)
     def _emit_operation(self, op):
diff --git a/pypy/jit/metainterp/resoperation.py b/pypy/jit/metainterp/resoperation.py
--- a/pypy/jit/metainterp/resoperation.py
+++ b/pypy/jit/metainterp/resoperation.py
@@ -899,6 +899,12 @@
         if not k.startswith('__'):
             setattr(rop_lowercase, k.lower(), v)
 
+    ALLCALLS = []
+    for k, v in rop.__dict__.iteritems():
+        if k.startswith('CALL'):
+            ALLCALLS.append(v)
+    opgroups.ALLCALLS = tuple(ALLCALLS)
+
 def get_base_class(mixin, tpmixin, base):
     try:
         return get_base_class.cache[(mixin, tpmixin, base)]


More information about the pypy-commit mailing list