Author: Maciej Fijalkowski <[email protected]>
Branch: speedup-list-comprehension
Changeset: r52916:4c4c935ebd9b
Date: 2012-02-26 10:30 -0800
http://bitbucket.org/pypy/pypy/changeset/4c4c935ebd9b/
Log: add few hints to make those functions pass
diff --git a/pypy/rpython/lltypesystem/rlist.py
b/pypy/rpython/lltypesystem/rlist.py
--- a/pypy/rpython/lltypesystem/rlist.py
+++ b/pypy/rpython/lltypesystem/rlist.py
@@ -321,6 +321,7 @@
def ll_fixed_length(l):
return len(l)
+ll_fixed_length._always_inline_ = True
def ll_fixed_items(l):
return l
@@ -328,10 +329,12 @@
def ll_fixed_getitem_fast(l, index):
ll_assert(index < len(l), "fixed getitem out of bounds")
return l[index]
+ll_fixed_getitem_fast._always_inline_ = True
def ll_fixed_setitem_fast(l, index, item):
ll_assert(index < len(l), "fixed setitem out of bounds")
l[index] = item
+ll_fixed_setitem_fast._always_inline_ = True
def newlist(llops, r_list, items_v, v_sizehint=None):
LIST = r_list.LIST
diff --git a/pypy/rpython/rlist.py b/pypy/rpython/rlist.py
--- a/pypy/rpython/rlist.py
+++ b/pypy/rpython/rlist.py
@@ -559,7 +559,7 @@
def ll_len_foldable(l):
return l.ll_length()
-ll_len_foldable.oopspec = 'list.len_foldable(l)'
+ll_len_foldable._always_inline_ = True
def ll_list_is_true_foldable(l):
return bool(l) and ll_len_foldable(l) != 0
@@ -618,7 +618,6 @@
res = l.ll_getitem_fast(index)
ll_delitem_nonneg(dum_nocheck, l, index)
return res
-ll_pop_nonneg.oopspec = 'list.pop(l, index)'
def ll_pop_default(func, l):
length = l.ll_length()
@@ -652,7 +651,6 @@
l.ll_setitem_fast(newlength, null)
l._ll_resize_le(newlength)
return res
-ll_pop_zero.oopspec = 'list.pop(l, 0)'
def ll_pop(func, l, index):
length = l.ll_length()
@@ -712,7 +710,7 @@
def ll_getitem_foldable_nonneg(l, index):
ll_assert(index >= 0, "unexpectedly negative list getitem index")
return l.ll_getitem_fast(index)
-ll_getitem_foldable_nonneg.oopspec = 'list.getitem_foldable(l, index)'
+ll_getitem_foldable_nonneg._always_inline_ = True
def ll_getitem_foldable(l, index):
if index < 0:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit