Author: Carl Friedrich Bolz <cfb...@gmx.de>
Branch: unroll-if-alt
Changeset: r46190:4fd7b839acd2
Date: 2011-08-02 12:40 +0200
http://bitbucket.org/pypy/pypy/changeset/4fd7b839acd2/

Log:    only unroll the adding of an attribute when the map and the
        attribute names are constant.

diff --git a/pypy/objspace/std/mapdict.py b/pypy/objspace/std/mapdict.py
--- a/pypy/objspace/std/mapdict.py
+++ b/pypy/objspace/std/mapdict.py
@@ -132,7 +132,10 @@
             cache[selector] = attr
         return attr
 
-    @jit.unroll_safe
+    @jit.unroll_if(lambda self, obj, selector, w_value:
+            jit.isconstant(self) and
+            jit.isconstant(selector[0]) and
+            jit.isconstant(selector[1]))
     def add_attr(self, obj, selector, w_value):
         # grumble, jit needs this
         attr = self._get_new_attr(selector[0], selector[1])
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to