Author: Maciej Fijalkowski <[email protected]>
Branch: 
Changeset: r70610:b9eded7b2b4f
Date: 2014-04-13 16:17 +0200
http://bitbucket.org/pypy/pypy/changeset/b9eded7b2b4f/

Log:    A bit more tweaking of details of specialization of some strange jmp

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
@@ -707,7 +707,7 @@
             raise OperationError(space.w_ValueError,
                                  space.wrap("list modified during sort"))
 
-find_jmp = jit.JitDriver(greens = [], reds = 'auto', name = 'list.find')
+find_jmp = jit.JitDriver(greens = ['tp'], reds = 'auto', name = 'list.find')
 
 class ListStrategy(object):
 
@@ -733,8 +733,9 @@
         space = self.space
         i = start
         # needs to be safe against eq_w mutating stuff
+        tp = space.type(w_item)
         while i < stop and i < w_list.length():
-            find_jmp.jit_merge_point()
+            find_jmp.jit_merge_point(tp=tp)
             if space.eq_w(w_list.getitem(i), w_item):
                 return i
             i += 1
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
@@ -1091,6 +1091,7 @@
     def _intersect_wrapped(self, w_set, w_other):
         result = newset(self.space)
         for key in self.unerase(w_set.sstorage):
+            self.intersect_jmp.jit_merge_point()
             w_key = self.wrap(key)
             if w_other.has_key(w_key):
                 result[w_key] = None
@@ -1201,6 +1202,9 @@
     erase = staticmethod(erase)
     unerase = staticmethod(unerase)
 
+    intersect_jmp = jit.JitDriver(greens = [], reds = 'auto',
+                                  name='set(bytes).intersect')
+
     def get_empty_storage(self):
         return self.erase({})
 
@@ -1237,6 +1241,9 @@
     erase = staticmethod(erase)
     unerase = staticmethod(unerase)
 
+    intersect_jmp = jit.JitDriver(greens = [], reds = 'auto',
+                                  name='set(unicode).intersect')
+
     def get_empty_storage(self):
         return self.erase({})
 
@@ -1273,6 +1280,9 @@
     erase = staticmethod(erase)
     unerase = staticmethod(unerase)
 
+    intersect_jmp = jit.JitDriver(greens = [], reds = 'auto',
+                                  name='set(int).intersect')
+
     def get_empty_storage(self):
         return self.erase({})
 
@@ -1311,6 +1321,9 @@
     erase = staticmethod(erase)
     unerase = staticmethod(unerase)
 
+    intersect_jmp = jit.JitDriver(greens = [], reds = 'auto',
+                                  name='set(object).intersect')
+
     def get_empty_storage(self):
         return self.erase(self.get_empty_dict())
 
@@ -1355,6 +1368,9 @@
     erase = staticmethod(erase)
     unerase = staticmethod(unerase)
 
+    intersect_jmp = jit.JitDriver(greens = [], reds = 'auto',
+                                  name='set(identity).intersect')
+
     def get_empty_storage(self):
         return self.erase({})
 
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
@@ -27,7 +27,7 @@
             jit.loop_unrolling_heuristic(other, other.length(), UNROLL_CUTOFF))
 
 
-contains_jmp = jit.JitDriver(greens = [], reds = 'auto',
+contains_jmp = jit.JitDriver(greens = ['tp'], reds = 'auto',
                              name = 'tuple.contains')
 
 class W_AbstractTupleObject(W_Root):
@@ -136,8 +136,9 @@
         return space.w_False
 
     def _descr_contains_jmp(self, space, w_obj):
+        tp = space.type(w_obj)
         for w_item in self.tolist():
-            contains_jmp.jit_merge_point()
+            contains_jmp.jit_merge_point(tp=tp)
             if space.eq_w(w_item, w_obj):
                 return space.w_True
         return space.w_False
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to