Author: Armin Rigo <[email protected]>
Branch: all_ordered_dicts
Changeset: r74967:1a8e8c05fb54
Date: 2014-12-17 12:35 +0000
http://bitbucket.org/pypy/pypy/changeset/1a8e8c05fb54/

Log:    (ltratt, arigo)

        Add some jit.look_inside_iff(): so far the ll_dict_grow() call ends
        up as a residual call

diff --git a/rpython/rtyper/lltypesystem/rordereddict.py 
b/rpython/rtyper/lltypesystem/rordereddict.py
--- a/rpython/rtyper/lltypesystem/rordereddict.py
+++ b/rpython/rtyper/lltypesystem/rordereddict.py
@@ -620,8 +620,12 @@
     some += newsize >> 3
     return newsize + some
 
[email protected]_look_inside
[email protected]_inside_iff(lambda d: jit.isvirtual(d))
 def ll_dict_grow(d):
+    # note: this @jit.look_inside_iff is here to inline the three lines
+    # at the end of this function.  It's important because dicts start
+    # with a length-zero 'd.entries' which must be grown as soon as we
+    # insert an element.
     if d.num_live_items < d.num_ever_used_items // 2:
         # At least 50% of the allocated entries are dead, so perform a
         # compaction. If ll_dict_remove_deleted_items detects that over
@@ -644,6 +648,7 @@
     d.entries = newitems
     return False
 
[email protected]_look_inside
 def ll_dict_remove_deleted_items(d):
     if d.num_live_items < len(d.entries) // 4:
         # At least 75% of the allocated entries are dead, so shrink the memory
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to