Brian Kearns avatar Brian Kearns committed 7a0d270

add a jitdriver for space.contains, fixes issue1327

Comments (0)

Files changed (1)

pypy/objspace/descroperation.py

 from rpython.tool.sourcetools import compile2, func_with_new_name
 from pypy.module.__builtin__.interp_classobj import W_InstanceObject
 from rpython.rlib.objectmodel import specialize
+from rpython.rlib import jit
 
 def object_getattribute(space):
     "Utility that returns the app-level descriptor object.__getattribute__."
     def descr__init__(space, w_obj, __args__):
         pass
 
+contains_jitdriver = jit.JitDriver(name='contains',
+        greens=['w_type'], reds='auto')
+
 class DescrOperation(object):
     _mixin_ = True
 
 
     def _contains(space, w_container, w_item):
         w_iter = space.iter(w_container)
+        w_type = space.type(w_iter)
         while 1:
+            contains_jitdriver.jit_merge_point(w_type=w_type)
             try:
                 w_next = space.next(w_iter)
             except OperationError, e:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.