Author: Maciej Fijalkowski <fij...@gmail.com>
Branch: 
Changeset: r62775:5e70f599bd12
Date: 2013-03-25 17:31 -0700
http://bitbucket.org/pypy/pypy/changeset/5e70f599bd12/

Log:    merge

diff --git a/.tddium.requirements.txt b/.tddium.requirements.txt
new file mode 100644
--- /dev/null
+++ b/.tddium.requirements.txt
@@ -0,0 +1,1 @@
+pytest
diff --git a/pypy/objspace/std/dictmultiobject.py 
b/pypy/objspace/std/dictmultiobject.py
--- a/pypy/objspace/std/dictmultiobject.py
+++ b/pypy/objspace/std/dictmultiobject.py
@@ -12,6 +12,8 @@
 
 from rpython.rlib import rerased, jit
 
+UNROLL_CUTOFF = 5
+
 def _is_str(space, w_key):
     return space.is_w(space.type(w_key), space.w_str)
 
@@ -35,7 +37,7 @@
     an actual dict
     """
     return jit.isvirtual(w_dct) or (jit.isconstant(w_dct) and
-                                    w_dct.length() <= jit.UNROLL_CUTOFF)
+                                    w_dct.length() <= UNROLL_CUTOFF)
 
 
 class W_DictMultiObject(W_Object):
diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py
--- a/pypy/objspace/std/listobject.py
+++ b/pypy/objspace/std/listobject.py
@@ -18,6 +18,7 @@
 from pypy.objspace.std.stdtypedef import StdTypeDef, SMM
 from sys import maxint
 
+UNROLL_CUTOFF = 5
 
 class W_AbstractListObject(W_Object):
     __slots__ = ()
@@ -42,7 +43,7 @@
     return W_ListObject.from_storage_and_strategy(space, storage, strategy)
 
 @jit.look_inside_iff(lambda space, list_w, sizehint:
-                     jit.loop_unrolling_heuristic(list_w, len(list_w)))
+        jit.loop_unrolling_heuristic(list_w, len(list_w), UNROLL_CUTOFF))
 def get_strategy_from_list_objects(space, list_w, sizehint):
     if not list_w:
         if sizehint != -1:
@@ -956,7 +957,7 @@
         raise NotImplementedError("abstract base class")
 
     @jit.look_inside_iff(lambda space, w_list, list_w:
-                         jit.loop_unrolling_heuristic(list_w, len(list_w)))
+            jit.loop_unrolling_heuristic(list_w, len(list_w), UNROLL_CUTOFF))
     def init_from_list_w(self, w_list, list_w):
         l = [self.unwrap(w_item) for w_item in list_w]
         w_list.lstorage = self.erase(l)
@@ -1005,7 +1006,7 @@
         return self.wrap(r)
 
     @jit.look_inside_iff(lambda self, w_list:
-                         jit.loop_unrolling_heuristic(w_list, w_list.length()))
+            jit.loop_unrolling_heuristic(w_list, w_list.length(), 
UNROLL_CUTOFF))
     def getitems_copy(self, w_list):
         return [self.wrap(item) for item in self.unerase(w_list.lstorage)]
 
@@ -1014,7 +1015,7 @@
         return [self.wrap(item) for item in self.unerase(w_list.lstorage)]
 
     @jit.look_inside_iff(lambda self, w_list:
-                         jit.loop_unrolling_heuristic(w_list, w_list.length()))
+            jit.loop_unrolling_heuristic(w_list, w_list.length(), 
UNROLL_CUTOFF))
     def getitems_fixedsize(self, w_list):
         return self.getitems_unroll(w_list)
 
@@ -1476,8 +1477,8 @@
     return w_list
 
 def list_unroll_condition(space, w_list1, w_list2):
-    return jit.loop_unrolling_heuristic(w_list1, w_list1.length()) or \
-           jit.loop_unrolling_heuristic(w_list2, w_list2.length())
+    return jit.loop_unrolling_heuristic(w_list1, w_list1.length(), 
UNROLL_CUTOFF) or \
+           jit.loop_unrolling_heuristic(w_list2, w_list2.length(), 
UNROLL_CUTOFF)
 
 @jit.look_inside_iff(list_unroll_condition)
 def eq__List_List(space, w_list1, w_list2):
diff --git a/pypy/objspace/std/setobject.py b/pypy/objspace/std/setobject.py
--- a/pypy/objspace/std/setobject.py
+++ b/pypy/objspace/std/setobject.py
@@ -15,6 +15,8 @@
 from rpython.rlib.rarithmetic import intmask, r_uint
 from rpython.rlib import rerased, jit
 
+UNROLL_CUTOFF = 5
+
 class W_BaseSetObject(W_Object):
     typedef = None
 
@@ -391,7 +393,7 @@
         raise NotImplementedError
 
     @jit.look_inside_iff(lambda self, list_w:
-                         jit.loop_unrolling_heuristic(list_w, len(list_w)))
+            jit.loop_unrolling_heuristic(list_w, len(list_w), UNROLL_CUTOFF))
     def get_storage_from_list(self, list_w):
         setdata = self.get_empty_dict()
         for w_item in list_w:
@@ -399,7 +401,7 @@
         return self.erase(setdata)
 
     @jit.look_inside_iff(lambda self, items:
-                         jit.loop_unrolling_heuristic(items, len(items)))
+            jit.loop_unrolling_heuristic(items, len(items), UNROLL_CUTOFF))
     def get_storage_from_unwrapped_list(self, items):
         setdata = self.get_empty_dict()
         for item in items:
@@ -1033,7 +1035,7 @@
     _pick_correct_strategy(space, w_set, iterable_w)
 
 @jit.look_inside_iff(lambda space, w_set, iterable_w:
-                     jit.loop_unrolling_heuristic(iterable_w, len(iterable_w)))
+        jit.loop_unrolling_heuristic(iterable_w, len(iterable_w), 
UNROLL_CUTOFF))
 def _pick_correct_strategy(space, w_set, iterable_w):
     # check for integers
     for w_item in iterable_w:
diff --git a/pypy/objspace/std/tupleobject.py b/pypy/objspace/std/tupleobject.py
--- a/pypy/objspace/std/tupleobject.py
+++ b/pypy/objspace/std/tupleobject.py
@@ -10,6 +10,7 @@
 from rpython.rlib import jit
 from rpython.tool.sourcetools import func_with_new_name
 
+UNROLL_CUTOFF = 10
 
 class W_AbstractTupleObject(W_Object):
     __slots__ = ()
@@ -84,7 +85,7 @@
     return space.newtuple(w_tuple.wrappeditems[start:stop])
 
 @jit.look_inside_iff(lambda space, w_tuple, w_obj:
-        jit.loop_unrolling_heuristic(w_tuple, len(w_tuple.wrappeditems)))
+        jit.loop_unrolling_heuristic(w_tuple, len(w_tuple.wrappeditems), 
UNROLL_CUTOFF))
 def contains__Tuple_ANY(space, w_tuple, w_obj):
     for w_item in w_tuple.wrappeditems:
         if space.eq_w(w_item, w_obj):
@@ -119,8 +120,8 @@
     return mul_tuple_times(space, w_tuple, w_times)
 
 def tuple_unroll_condition(space, w_tuple1, w_tuple2):
-    return jit.loop_unrolling_heuristic(w_tuple1, len(w_tuple1.wrappeditems)) 
or \
-           jit.loop_unrolling_heuristic(w_tuple2, len(w_tuple2.wrappeditems))
+    return jit.loop_unrolling_heuristic(w_tuple1, len(w_tuple1.wrappeditems), 
UNROLL_CUTOFF) or \
+           jit.loop_unrolling_heuristic(w_tuple2, len(w_tuple2.wrappeditems), 
UNROLL_CUTOFF)
 
 @jit.look_inside_iff(tuple_unroll_condition)
 def eq__Tuple_Tuple(space, w_tuple1, w_tuple2):
@@ -173,7 +174,7 @@
     return space.wrap(hash_tuple(space, w_tuple.wrappeditems))
 
 @jit.look_inside_iff(lambda space, wrappeditems:
-        jit.loop_unrolling_heuristic(wrappeditems, len(wrappeditems)))
+        jit.loop_unrolling_heuristic(wrappeditems, len(wrappeditems), 
UNROLL_CUTOFF))
 def hash_tuple(space, wrappeditems):
     # this is the CPython 2.4 algorithm (changed from 2.3)
     mult = 1000003
diff --git a/rpython/rlib/jit.py b/rpython/rlib/jit.py
--- a/rpython/rlib/jit.py
+++ b/rpython/rlib/jit.py
@@ -206,13 +206,11 @@
     return NonConstant(False)
 isvirtual._annspecialcase_ = "specialize:call_location"
 
-UNROLL_CUTOFF = 5
-
 @specialize.call_location()
-def loop_unrolling_heuristic(lst, size):
+def loop_unrolling_heuristic(lst, size, cutoff=2):
     """ In which cases iterating over items of lst can be unrolled
     """
-    return isvirtual(lst) or (isconstant(size) and size <= UNROLL_CUTOFF)
+    return isvirtual(lst) or (isconstant(size) and size <= cutoff)
 
 class Entry(ExtRegistryEntry):
     _about_ = hint
diff --git a/tddium.yml b/tddium.yml
new file mode 100644
--- /dev/null
+++ b/tddium.yml
@@ -0,0 +1,20 @@
+tddium:
+ timeout: 1800
+ python:
+  python_version: 2.7
+  pip_requirements_file: .tddium.requirements.txt  # will go away soon
+ tests:
+  - type: pytest
+    mode: parallel
+    files:
+     - pypy/**/test_*.py
+     - rpython/**/test_*.py
+     - exclude: pypy/module/test_lib_pypy/ctypes_tests/** # don't run in 
CPython
+     - exclude: rpython/jit/backend/cli/**  # bitrotted AFAICT
+     - exclude: rpython/jit/backend/llvm/** # bitrotted AFAICT
+     # and things requiring a fix in Tddium, omitted to avoid confusion:
+     - exclude: pypy/tool/pytest/**  # we're running upstream pytest
+     - exclude: rpython/rlib/unicodedata/test/test_ucd.py # need wide build
+     - exclude: rpython/rlib/test/test_runicode.py # need wide build
+     - exclude: rpython/rlib/test/test_rsocket.py # not clear why fails
+     - exclude: pypy/module/cpyext/test/** # multiple failures due to 
truncated files; not clear why
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to