Brian Kearns  committed 7a0d270

add a jitdriver for space.contains, fixes issue1327

  • Participants
  • Parent commits dcf647d
  • Branches default

Comments (0)

Files changed (1)

File pypy/objspace/

 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__):
+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)
                 w_next =
             except OperationError, e: