[pypy-commit] pypy unroll-if-alt: Approprite special case here.

alex_gaynor noreply at buildbot.pypy.org
Sat Jul 30 10:36:18 CEST 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: unroll-if-alt
Changeset: r46103:a02e7bf45eb9
Date: 2011-07-30 01:36 -0700
http://bitbucket.org/pypy/pypy/changeset/a02e7bf45eb9/

Log:	Approprite special case here.

diff --git a/pypy/jit/metainterp/optimizeopt/vstring.py b/pypy/jit/metainterp/optimizeopt/vstring.py
--- a/pypy/jit/metainterp/optimizeopt/vstring.py
+++ b/pypy/jit/metainterp/optimizeopt/vstring.py
@@ -466,6 +466,9 @@
         srcstart = self.getvalue(op.getarg(2))
         dststart = self.getvalue(op.getarg(3))
         length = self.getvalue(op.getarg(4))
+
+        if length.is_constant() and length.box.getint() == 0:
+            return
         copy_str_content(self.optimizer,
             src.force_box(),
             dst.force_box(),


More information about the pypy-commit mailing list