[pypy-commit] pypy default: Add a jit_merge_point to list.find

fijal noreply at buildbot.pypy.org
Sat Jun 15 07:33:17 CEST 2013


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r64890:87bfc8884702
Date: 2013-06-15 13:32 +0800
http://bitbucket.org/pypy/pypy/changeset/87bfc8884702/

Log:	Add a jit_merge_point to list.find

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
@@ -693,6 +693,7 @@
             raise OperationError(space.w_ValueError,
                                  space.wrap("list modified during sort"))
 
+find_jmp = jit.JitDriver(greens = [], reds = 'auto', name = 'list.find')
 
 class ListStrategy(object):
     sizehint = -1
@@ -717,6 +718,7 @@
         i = start
         # needs to be safe against eq_w mutating stuff
         while i < stop and i < w_list.length():
+            find_jmp.jit_merge_point()
             if space.eq_w(w_list.getitem(i), w_item):
                 return i
             i += 1


More information about the pypy-commit mailing list