[pypy-commit] pypy default: Add a passing test

arigo noreply at buildbot.pypy.org
Sun Jun 15 12:17:22 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r72048:24bcf07158cb
Date: 2014-06-13 16:32 +0200
http://bitbucket.org/pypy/pypy/changeset/24bcf07158cb/

Log:	Add a passing test

diff --git a/rpython/jit/metainterp/compile.py b/rpython/jit/metainterp/compile.py
--- a/rpython/jit/metainterp/compile.py
+++ b/rpython/jit/metainterp/compile.py
@@ -603,6 +603,11 @@
         increment = jitdriver_sd.warmstate.increment_trace_eagerness
         return jitcounter.tick(hash, increment)
 
+    def get_index_of_guard_value(self):
+        if (self.status & self.ST_TYPE_MASK) == 0:
+            return -1
+        return intmask(self.status >> self.ST_SHIFT)
+
     def start_compiling(self):
         # start tracing and compiling from this guard.
         self.status |= self.ST_BUSY_FLAG
diff --git a/rpython/jit/metainterp/test/test_ajit.py b/rpython/jit/metainterp/test/test_ajit.py
--- a/rpython/jit/metainterp/test/test_ajit.py
+++ b/rpython/jit/metainterp/test/test_ajit.py
@@ -1435,6 +1435,16 @@
         res = self.meta_interp(f, [299], listops=True)
         assert res == f(299)
         self.check_resops(guard_class=0, guard_value=6)
+        #
+        # The original 'guard_class' is rewritten to be directly 'guard_value'.
+        # Check that this rewrite does not interfere with the descr, which
+        # should be a full-fledged multivalued 'guard_value' descr.
+        if self.basic:
+            for loop in get_stats().get_all_loops():
+                for op in loop.get_operations():
+                    if op.getopname() == "guard_value":
+                        descr = op.getdescr()
+                        assert descr.get_index_of_guard_value() >= 0
 
     def test_merge_guardnonnull_guardclass(self):
         myjitdriver = JitDriver(greens = [], reds = ['x', 'l'])


More information about the pypy-commit mailing list