Author: Hakan Ardo <ha...@debian.org> Branch: jit-refactor-tests Changeset: r49808:c6f2c9f35460 Date: 2011-11-26 09:37 +0100 http://bitbucket.org/pypy/pypy/changeset/c6f2c9f35460/
Log: merge diff --git a/pypy/jit/metainterp/history.py b/pypy/jit/metainterp/history.py --- a/pypy/jit/metainterp/history.py +++ b/pypy/jit/metainterp/history.py @@ -1013,6 +1013,36 @@ "found %d %r, expected %d" % (found, insn, expected_count)) return insns + def check_loops(self, expected=None, everywhere=False, **check): + insns = {} + for loop in self.loops: + #if not everywhere: + # if getattr(loop, '_ignore_during_counting', False): + # continue + insns = loop.summary(adding_insns=insns) + if expected is not None: + insns.pop('debug_merge_point', None) + print + print + print " self.check_resops(%s)" % str(insns) + print + import pdb; pdb.set_trace() + else: + chk = ['%s=%d' % (i, insns.get(i, 0)) for i in check] + print + print + print " self.check_resops(%s)" % ', '.join(chk) + print + import pdb; pdb.set_trace() + return + + for insn, expected_count in check.items(): + getattr(rop, insn.upper()) # fails if 'rop.INSN' does not exist + found = insns.get(insn, 0) + assert found == expected_count, ( + "found %d %r, expected %d" % (found, insn, expected_count)) + return insns + def check_consistency(self): "NOT_RPYTHON" for loop in self.loops: _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit