1. Pypy
  2. Untitled project
  3. pypy

Commits

Philip Jenvey  committed 77b4d8f Merge

merge default

  • Participants
  • Parent commits 4e8538d, 7afcc00
  • Branches py3k

Comments (0)

Files changed (55)

File lib-python/2.7/uuid.py

View file
  • Ignore whitespace
         """
 
         if hex is not None:
-            if (bytes is not None or bytes_le is not None or fields is not None
-                    or int is not None):
-                raise TypeError('if the hex argument is given, bytes, bytes_le, fields,'
-                                ' and int need to be None')
+            if (bytes is not None or bytes_le is not None or
+                    fields is not None or int is not None):
+                raise TypeError('if the hex argument is given, bytes,'
+                                ' bytes_le, fields,  and int need to be None')
             hex = hex.replace('urn:', '').replace('uuid:', '')
             hex = hex.strip('{}').replace('-', '')
             if len(hex) != 32:
             int = long(hex, 16)
         elif bytes_le is not None:
             if bytes is not None or fields is not None or int is not None:
-                raise TypeError('if the bytes_le argument is given, bytes, fields,'
-                                ' and int need to be None')
+                raise TypeError('if the bytes_le argument is given, bytes,'
+                                ' fields, and int need to be None')
             if len(bytes_le) != 16:
                 raise ValueError('bytes_le is not a 16-char string')
             bytes = (bytes_le[3] + bytes_le[2] + bytes_le[1] + bytes_le[0] +
                    struct.unpack('>Q', bytes[8:])[0])
         elif bytes is not None:
             if fields is not None or int is not None:
-                raise TypeError('if the bytes argument is given, fields'
-                                ' and int need to be None')
+                raise TypeError('if the bytes argument is given, fields '
+                                'and int need to be None')
             if len(bytes) != 16:
                 raise ValueError('bytes is not a 16-char string')
             int = (struct.unpack('>Q', bytes[:8])[0] << 64 |
                    struct.unpack('>Q', bytes[8:])[0])
         elif fields is not None:
             if int is not None:
-                raise TypeError('if the fields argument is given, int needs to be None')
+                raise TypeError('if the fields argument is given, int needs'
+                                ' to be None')
             if len(fields) != 6:
                 raise ValueError('fields is not a 6-tuple')
             (time_low, time_mid, time_hi_version,

File pypy/doc/whatsnew-head.rst

View file
  • Ignore whitespace
 .. branch: numpypy-inplace-op
 .. branch: rewritten-loop-logging
 .. branch: no-release-gil
+.. branch: safe-win-mmap
+.. branch: boolean-index-cleanup
 
 .. branch: nobold-backtrace
 Work on improving UnionError messages and stack trace displays.

File pypy/module/__pypy__/interp_time.py

View file
  • Ignore whitespace
 
     c_clock_gettime = rffi.llexternal("clock_gettime",
         [lltype.Signed, lltype.Ptr(TIMESPEC)], rffi.INT,
-        compilation_info=CConfig._compilation_info_, threadsafe=False
+        compilation_info=CConfig._compilation_info_, releasegil=False
     )
     c_clock_getres = rffi.llexternal("clock_getres",
         [lltype.Signed, lltype.Ptr(TIMESPEC)], rffi.INT,
-        compilation_info=CConfig._compilation_info_, threadsafe=False
+        compilation_info=CConfig._compilation_info_, releasegil=False
     )
 
     @unwrap_spec(clk_id="c_int")

File pypy/module/_multiprocessing/interp_semaphore.py

View file
  • Ignore whitespace
         'CreateSemaphoreA', [rffi.VOIDP, rffi.LONG, rffi.LONG, rwin32.LPCSTR],
         rwin32.HANDLE)
     _CloseHandle = rwin32.winexternal('CloseHandle', [rwin32.HANDLE],
-        rwin32.BOOL, threadsafe=False)
+        rwin32.BOOL, releasegil=False)
     _ReleaseSemaphore = rwin32.winexternal(
         'ReleaseSemaphore', [rwin32.HANDLE, rffi.LONG, rffi.LONGP],
         rwin32.BOOL)
     _sem_open = external('sem_open',
                          [rffi.CCHARP, rffi.INT, rffi.INT, rffi.UINT],
                          SEM_T)
-    # tread sem_close as not threadsafe for now to be able to use the __del__
-    _sem_close = external('sem_close', [SEM_T], rffi.INT, threadsafe=False)
+    # sem_close is releasegil=False to be able to use it in the __del__
+    _sem_close = external('sem_close', [SEM_T], rffi.INT, releasegil=False)
     _sem_unlink = external('sem_unlink', [rffi.CCHARP], rffi.INT)
     _sem_wait = external('sem_wait', [SEM_T], rffi.INT)
     _sem_trywait = external('sem_trywait', [SEM_T], rffi.INT)

File pypy/module/bz2/interp_bz2.py

View file
  • Ignore whitespace
 BZ2_bzCompressInit = external('BZ2_bzCompressInit', [bz_stream, rffi.INT,
                               rffi.INT, rffi.INT], rffi.INT)
 BZ2_bzCompressEnd = external('BZ2_bzCompressEnd', [bz_stream], rffi.INT,
-                             threadsafe=False)
+                             releasegil=False)
 BZ2_bzCompress = external('BZ2_bzCompress', [bz_stream, rffi.INT], rffi.INT)
 BZ2_bzDecompressInit = external('BZ2_bzDecompressInit', [bz_stream, rffi.INT,
                                                          rffi.INT], rffi.INT)
 BZ2_bzDecompressEnd = external('BZ2_bzDecompressEnd', [bz_stream], rffi.INT,
-                               threadsafe=False)
+                               releasegil=False)
 BZ2_bzDecompress = external('BZ2_bzDecompress', [bz_stream], rffi.INT)
 
 def _catch_bz2_error(space, bzerror):

File pypy/module/cppyy/capi/builtin_capi.py

View file
  • Ignore whitespace
 _c_num_scopes = rffi.llexternal(
     "cppyy_num_scopes",
     [C_SCOPE], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_num_scopes(space, cppscope):
     return _c_num_scopes(cppscope.handle)
 _c_resolve_name = rffi.llexternal(
     "cppyy_resolve_name",
     [rffi.CCHARP], rffi.CCHARP,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_resolve_name(space, name):
     return charp2str_free(space, _c_resolve_name(name))
 _c_get_scope_opaque = rffi.llexternal(
     "cppyy_get_scope",
     [rffi.CCHARP], C_SCOPE,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_get_scope_opaque(space, name):
     return _c_get_scope_opaque(name)
 _c_get_template = rffi.llexternal(
     "cppyy_get_template",
     [rffi.CCHARP], C_TYPE,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_get_template(space, name):
     return _c_get_template(name)
 _c_actual_class = rffi.llexternal(
     "cppyy_actual_class",
     [C_TYPE, C_OBJECT], C_TYPE,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_actual_class(space, cppclass, cppobj):
     return _c_actual_class(cppclass.handle, cppobj)
 _c_allocate = rffi.llexternal(
     "cppyy_allocate",
     [C_TYPE], C_OBJECT,
-    threadsafe=ts_memory,
+    releasegil=ts_memory,
     compilation_info=backend.eci)
 def c_allocate(space, cppclass):
     return _c_allocate(cppclass.handle)
 _c_deallocate = rffi.llexternal(
     "cppyy_deallocate",
     [C_TYPE, C_OBJECT], lltype.Void,
-    threadsafe=ts_memory,
+    releasegil=ts_memory,
     compilation_info=backend.eci)
 def c_deallocate(space, cppclass, cppobject):
     _c_deallocate(cppclass.handle, cppobject)
 _c_destruct = rffi.llexternal(
     "cppyy_destruct",
     [C_TYPE, C_OBJECT], lltype.Void,
-    threadsafe=ts_call,
+    releasegil=ts_call,
     compilation_info=backend.eci)
 def c_destruct(space, cppclass, cppobject):
     _c_destruct(cppclass.handle, cppobject)
 _c_call_v = rffi.llexternal(
     "cppyy_call_v",
     [C_METHOD, C_OBJECT, rffi.INT, rffi.VOIDP], lltype.Void,
-    threadsafe=ts_call,
+    releasegil=ts_call,
     compilation_info=backend.eci)
 def c_call_v(space, cppmethod, cppobject, nargs, args):
     _c_call_v(cppmethod, cppobject, nargs, args)
 _c_call_b = rffi.llexternal(
     "cppyy_call_b",
     [C_METHOD, C_OBJECT, rffi.INT, rffi.VOIDP], rffi.UCHAR,
-    threadsafe=ts_call,
+    releasegil=ts_call,
     compilation_info=backend.eci)
 def c_call_b(space, cppmethod, cppobject, nargs, args):
     return _c_call_b(cppmethod, cppobject, nargs, args)
 _c_call_c = rffi.llexternal(
     "cppyy_call_c",
     [C_METHOD, C_OBJECT, rffi.INT, rffi.VOIDP], rffi.CHAR,
-    threadsafe=ts_call,
+    releasegil=ts_call,
     compilation_info=backend.eci)
 def c_call_c(space, cppmethod, cppobject, nargs, args):
     return _c_call_c(cppmethod, cppobject, nargs, args)
 _c_call_h = rffi.llexternal(
     "cppyy_call_h",
     [C_METHOD, C_OBJECT, rffi.INT, rffi.VOIDP], rffi.SHORT,
-    threadsafe=ts_call,
+    releasegil=ts_call,
     compilation_info=backend.eci)
 def c_call_h(space, cppmethod, cppobject, nargs, args):
     return _c_call_h(cppmethod, cppobject, nargs, args)
 _c_call_i = rffi.llexternal(
     "cppyy_call_i",
     [C_METHOD, C_OBJECT, rffi.INT, rffi.VOIDP], rffi.INT,
-    threadsafe=ts_call,
+    releasegil=ts_call,
     compilation_info=backend.eci)
 def c_call_i(space, cppmethod, cppobject, nargs, args):
     return _c_call_i(cppmethod, cppobject, nargs, args)
 _c_call_l = rffi.llexternal(
     "cppyy_call_l",
     [C_METHOD, C_OBJECT, rffi.INT, rffi.VOIDP], rffi.LONG,
-    threadsafe=ts_call,
+    releasegil=ts_call,
     compilation_info=backend.eci)
 def c_call_l(space, cppmethod, cppobject, nargs, args):
     return _c_call_l(cppmethod, cppobject, nargs, args)
 _c_call_ll = rffi.llexternal(
     "cppyy_call_ll",
     [C_METHOD, C_OBJECT, rffi.INT, rffi.VOIDP], rffi.LONGLONG,
-    threadsafe=ts_call,
+    releasegil=ts_call,
     compilation_info=backend.eci)
 def c_call_ll(space, cppmethod, cppobject, nargs, args):
     return _c_call_ll(cppmethod, cppobject, nargs, args)
 _c_call_f = rffi.llexternal(
     "cppyy_call_f",
     [C_METHOD, C_OBJECT, rffi.INT, rffi.VOIDP], rffi.FLOAT,
-    threadsafe=ts_call,
+    releasegil=ts_call,
     compilation_info=backend.eci)
 def c_call_f(space, cppmethod, cppobject, nargs, args):
     return _c_call_f(cppmethod, cppobject, nargs, args)
 _c_call_d = rffi.llexternal(
     "cppyy_call_d",
     [C_METHOD, C_OBJECT, rffi.INT, rffi.VOIDP], rffi.DOUBLE,
-    threadsafe=ts_call,
+    releasegil=ts_call,
     compilation_info=backend.eci)
 def c_call_d(space, cppmethod, cppobject, nargs, args):
     return _c_call_d(cppmethod, cppobject, nargs, args)
 _c_call_r = rffi.llexternal(
     "cppyy_call_r",
     [C_METHOD, C_OBJECT, rffi.INT, rffi.VOIDP], rffi.VOIDP,
-    threadsafe=ts_call,
+    releasegil=ts_call,
     compilation_info=backend.eci)
 def c_call_r(space, cppmethod, cppobject, nargs, args):
     return _c_call_r(cppmethod, cppobject, nargs, args)
 _c_call_s = rffi.llexternal(
     "cppyy_call_s",
     [C_METHOD, C_OBJECT, rffi.INT, rffi.VOIDP], rffi.CCHARP,
-    threadsafe=ts_call,
+    releasegil=ts_call,
     compilation_info=backend.eci)
 def c_call_s(space, cppmethod, cppobject, nargs, args):
     return _c_call_s(cppmethod, cppobject, nargs, args)
 _c_constructor = rffi.llexternal(
     "cppyy_constructor",
     [C_METHOD, C_TYPE, rffi.INT, rffi.VOIDP], C_OBJECT,
-    threadsafe=ts_call,
+    releasegil=ts_call,
     compilation_info=backend.eci)
 def c_constructor(space, cppmethod, cppobject, nargs, args):
     return _c_constructor(cppmethod, cppobject, nargs, args)
 _c_call_o = rffi.llexternal(
     "cppyy_call_o",
     [C_METHOD, C_OBJECT, rffi.INT, rffi.VOIDP, C_TYPE], rffi.LONG,
-    threadsafe=ts_call,
+    releasegil=ts_call,
     compilation_info=backend.eci)
 def c_call_o(space, method, cppobj, nargs, args, cppclass):
     return _c_call_o(method, cppobj, nargs, args, cppclass.handle)
 _c_get_methptr_getter = rffi.llexternal(
     "cppyy_get_methptr_getter",
     [C_SCOPE, C_INDEX], C_METHPTRGETTER_PTR,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci,
     elidable_function=True)
 def c_get_methptr_getter(space, cppscope, index):
 _c_allocate_function_args = rffi.llexternal(
     "cppyy_allocate_function_args",
     [rffi.SIZE_T], rffi.VOIDP,
-    threadsafe=ts_memory,
+    releasegil=ts_memory,
     compilation_info=backend.eci)
 def c_allocate_function_args(space, size):
     return _c_allocate_function_args(size)
 _c_deallocate_function_args = rffi.llexternal(
     "cppyy_deallocate_function_args",
     [rffi.VOIDP], lltype.Void,
-    threadsafe=ts_memory,
+    releasegil=ts_memory,
     compilation_info=backend.eci)
 def c_deallocate_function_args(space, args):
     _c_deallocate_function_args(args)
 _c_function_arg_sizeof = rffi.llexternal(
     "cppyy_function_arg_sizeof",
     [], rffi.SIZE_T,
-    threadsafe=ts_memory,
+    releasegil=ts_memory,
     compilation_info=backend.eci,
     elidable_function=True)
 def c_function_arg_sizeof(space):
 _c_function_arg_typeoffset = rffi.llexternal(
     "cppyy_function_arg_typeoffset",
     [], rffi.SIZE_T,
-    threadsafe=ts_memory,
+    releasegil=ts_memory,
     compilation_info=backend.eci,
     elidable_function=True)
 def c_function_arg_typeoffset(space):
 _c_is_namespace = rffi.llexternal(
     "cppyy_is_namespace",
     [C_SCOPE], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_is_namespace(space, scope):
     return _c_is_namespace(scope)
 _c_is_enum = rffi.llexternal(
     "cppyy_is_enum",
     [rffi.CCHARP], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_is_enum(space, name):
     return _c_is_enum(name)
 _c_final_name = rffi.llexternal(
     "cppyy_final_name",
     [C_TYPE], rffi.CCHARP,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_final_name(space, cpptype):
     return charp2str_free(space, _c_final_name(cpptype))
 _c_scoped_final_name = rffi.llexternal(
     "cppyy_scoped_final_name",
     [C_TYPE], rffi.CCHARP,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_scoped_final_name(space, cpptype):
     return charp2str_free(space, _c_scoped_final_name(cpptype))
 _c_has_complex_hierarchy = rffi.llexternal(
     "cppyy_has_complex_hierarchy",
     [C_TYPE], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_has_complex_hierarchy(space, cpptype):
     return _c_has_complex_hierarchy(cpptype)
 _c_num_bases = rffi.llexternal(
     "cppyy_num_bases",
     [C_TYPE], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_num_bases(space, cppclass):
     return _c_num_bases(cppclass.handle)
 _c_base_name = rffi.llexternal(
     "cppyy_base_name",
     [C_TYPE, rffi.INT], rffi.CCHARP,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_base_name(space, cppclass, base_index):
     return charp2str_free(space, _c_base_name(cppclass.handle, base_index))
 _c_is_subtype = rffi.llexternal(
     "cppyy_is_subtype",
     [C_TYPE, C_TYPE], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci,
     elidable_function=True)
 @jit.elidable_promote('2')
 _c_base_offset = rffi.llexternal(
     "cppyy_base_offset",
     [C_TYPE, C_TYPE, C_OBJECT, rffi.INT], rffi.SIZE_T,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci,
     elidable_function=True)
 @jit.elidable_promote('1,2,4')
 _c_num_methods = rffi.llexternal(
     "cppyy_num_methods",
     [C_SCOPE], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_num_methods(space, cppscope):
     return _c_num_methods(cppscope.handle)
 _c_method_index_at = rffi.llexternal(
     "cppyy_method_index_at",
     [C_SCOPE, rffi.INT], C_INDEX,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_method_index_at(space, cppscope, imethod):
     return _c_method_index_at(cppscope.handle, imethod)
 _c_method_indices_from_name = rffi.llexternal(
     "cppyy_method_indices_from_name",
     [C_SCOPE, rffi.CCHARP], C_INDEX_ARRAY,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_method_indices_from_name(space, cppscope, name):
     indices = _c_method_indices_from_name(cppscope.handle, name)
 _c_method_name = rffi.llexternal(
     "cppyy_method_name",
     [C_SCOPE, C_INDEX], rffi.CCHARP,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_method_name(space, cppscope, index):
     return charp2str_free(space, _c_method_name(cppscope.handle, index))
 _c_method_result_type = rffi.llexternal(
     "cppyy_method_result_type",
     [C_SCOPE, C_INDEX], rffi.CCHARP,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_method_result_type(space, cppscope, index):
     return charp2str_free(space, _c_method_result_type(cppscope.handle, index))
 _c_method_num_args = rffi.llexternal(
     "cppyy_method_num_args",
     [C_SCOPE, C_INDEX], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_method_num_args(space, cppscope, index):
     return _c_method_num_args(cppscope.handle, index)
 _c_method_req_args = rffi.llexternal(
     "cppyy_method_req_args",
     [C_SCOPE, C_INDEX], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_method_req_args(space, cppscope, index):
     return _c_method_req_args(cppscope.handle, index)
 _c_method_arg_type = rffi.llexternal(
     "cppyy_method_arg_type",
     [C_SCOPE, C_INDEX, rffi.INT], rffi.CCHARP,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_method_arg_type(space, cppscope, index, arg_index):
     return charp2str_free(space, _c_method_arg_type(cppscope.handle, index, arg_index))
 _c_method_arg_default = rffi.llexternal(
     "cppyy_method_arg_default",
     [C_SCOPE, C_INDEX, rffi.INT], rffi.CCHARP,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_method_arg_default(space, cppscope, index, arg_index):
     return charp2str_free(space, _c_method_arg_default(cppscope.handle, index, arg_index))
 _c_method_signature = rffi.llexternal(
     "cppyy_method_signature",
     [C_SCOPE, C_INDEX], rffi.CCHARP,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_method_signature(space, cppscope, index):
     return charp2str_free(space, _c_method_signature(cppscope.handle, index))
 _c_method_is_template = rffi.llexternal(
     "cppyy_method_is_template",
     [C_SCOPE, C_INDEX], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_method_is_template(space, cppscope, index):
     return _c_method_is_template(cppscope.handle, index)
 _c_method_num_template_args = rffi.llexternal(
     "cppyy_method_num_template_args",
     [C_SCOPE, C_INDEX], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 _c_method_template_arg_name = rffi.llexternal(
     "cppyy_method_template_arg_name",
     [C_SCOPE, C_INDEX, C_INDEX], rffi.CCHARP,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_template_args(space, cppscope, index):
     nargs = _c_method_num_template_args(cppscope.handle, index)
 _c_get_method = rffi.llexternal(
     "cppyy_get_method",
     [C_SCOPE, C_INDEX], C_METHOD,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_get_method(space, cppscope, index):
     return _c_get_method(cppscope.handle, index)
 _c_get_global_operator = rffi.llexternal(
     "cppyy_get_global_operator",
     [C_SCOPE, C_SCOPE, C_SCOPE, rffi.CCHARP], WLAVC_INDEX,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_get_global_operator(space, nss, lc, rc, op):
     if nss is not None:
 _c_is_constructor = rffi.llexternal(
     "cppyy_is_constructor",
     [C_TYPE, C_INDEX], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_is_constructor(space, cppclass, index):
     return _c_is_constructor(cppclass.handle, index)
 _c_is_staticmethod = rffi.llexternal(
     "cppyy_is_staticmethod",
     [C_TYPE, C_INDEX], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_is_staticmethod(space, cppclass, index):
     return _c_is_staticmethod(cppclass.handle, index)
 _c_num_datamembers = rffi.llexternal(
     "cppyy_num_datamembers",
     [C_SCOPE], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_num_datamembers(space, cppscope):
     return _c_num_datamembers(cppscope.handle)
 _c_datamember_name = rffi.llexternal(
     "cppyy_datamember_name",
     [C_SCOPE, rffi.INT], rffi.CCHARP,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_datamember_name(space, cppscope, datamember_index):
     return charp2str_free(space, _c_datamember_name(cppscope.handle, datamember_index))
 _c_datamember_type = rffi.llexternal(
     "cppyy_datamember_type",
     [C_SCOPE, rffi.INT], rffi.CCHARP,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_datamember_type(space, cppscope, datamember_index):
     return charp2str_free(space, _c_datamember_type(cppscope.handle, datamember_index))
 _c_datamember_offset = rffi.llexternal(
     "cppyy_datamember_offset",
     [C_SCOPE, rffi.INT], rffi.SIZE_T,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_datamember_offset(space, cppscope, datamember_index):
     return _c_datamember_offset(cppscope.handle, datamember_index)
 _c_datamember_index = rffi.llexternal(
     "cppyy_datamember_index",
     [C_SCOPE, rffi.CCHARP], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_datamember_index(space, cppscope, name):
     return _c_datamember_index(cppscope.handle, name)
 _c_is_publicdata = rffi.llexternal(
     "cppyy_is_publicdata",
     [C_SCOPE, rffi.INT], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_is_publicdata(space, cppscope, datamember_index):
     return _c_is_publicdata(cppscope.handle, datamember_index)
 _c_is_staticdata = rffi.llexternal(
     "cppyy_is_staticdata",
     [C_SCOPE, rffi.INT], rffi.INT,
-    threadsafe=ts_reflect,
+    releasegil=ts_reflect,
     compilation_info=backend.eci)
 def c_is_staticdata(space, cppscope, datamember_index):
     return _c_is_staticdata(cppscope.handle, datamember_index)
 _c_strtoll = rffi.llexternal(
     "cppyy_strtoll",
     [rffi.CCHARP], rffi.LONGLONG,
-    threadsafe=ts_helper,
+    releasegil=ts_helper,
     compilation_info=backend.eci)
 def c_strtoll(space, svalue):
     return _c_strtoll(svalue)
 _c_strtoull = rffi.llexternal(
     "cppyy_strtoull",
     [rffi.CCHARP], rffi.ULONGLONG,
-    threadsafe=ts_helper,
+    releasegil=ts_helper,
     compilation_info=backend.eci)
 def c_strtoull(space, svalue):
     return _c_strtoull(svalue)
 c_free = rffi.llexternal(
     "cppyy_free",
     [rffi.VOIDP], lltype.Void,
-    threadsafe=ts_memory,
+    releasegil=ts_memory,
     compilation_info=backend.eci)
 
 def charp2str_free(space, charp):
 _c_charp2stdstring = rffi.llexternal(
     "cppyy_charp2stdstring",
     [rffi.CCHARP], C_OBJECT,
-    threadsafe=ts_helper,
+    releasegil=ts_helper,
     compilation_info=backend.eci)
 def c_charp2stdstring(space, svalue):
     charp = rffi.str2charp(svalue)
 _c_stdstring2stdstring = rffi.llexternal(
     "cppyy_stdstring2stdstring",
     [C_OBJECT], C_OBJECT,
-    threadsafe=ts_helper,
+    releasegil=ts_helper,
     compilation_info=backend.eci)
 def c_stdstring2stdstring(space, cppobject):
     return _c_stdstring2stdstring(cppobject)
 _c_assign2stdstring = rffi.llexternal(
     "cppyy_assign2stdstring",
     [C_OBJECT, rffi.CCHARP], lltype.Void,
-    threadsafe=ts_helper,
+    releasegil=ts_helper,
     compilation_info=backend.eci)
 def c_assign2stdstring(space, cppobject, svalue):
     charp = rffi.str2charp(svalue)
 _c_free_stdstring = rffi.llexternal(
     "cppyy_free_stdstring",
     [C_OBJECT], lltype.Void,
-    threadsafe=ts_helper,
+    releasegil=ts_helper,
     compilation_info=backend.eci)
 def c_free_stdstring(space, cppobject):
     _c_free_stdstring(cppobject)

File pypy/module/cppyy/capi/cint_capi.py

View file
  • Ignore whitespace
 _c_load_dictionary = rffi.llexternal(
     "cppyy_load_dictionary",
     [rffi.CCHARP], rdynload.DLLHANDLE,
-    threadsafe=False,
+    releasegil=False,
     compilation_info=eci)
 
 def c_load_dictionary(name):
 _ttree_Branch = rffi.llexternal(
     "cppyy_ttree_Branch",
     [rffi.VOIDP, rffi.CCHARP, rffi.CCHARP, rffi.VOIDP, rffi.INT, rffi.INT], rffi.LONG,
-    threadsafe=False,
+    releasegil=False,
     compilation_info=eci)
 
 @unwrap_spec(args_w='args_w')
 c_ttree_GetEntry = rffi.llexternal(
     "cppyy_ttree_GetEntry",
     [rffi.VOIDP, rffi.LONGLONG], rffi.LONGLONG,
-    threadsafe=False,
+    releasegil=False,
     compilation_info=eci)
 
 @unwrap_spec(args_w='args_w')

File pypy/module/crypt/interp_crypt.py

View file
  • Ignore whitespace
 else:
     eci = ExternalCompilationInfo(libraries=['crypt'])
 c_crypt = rffi.llexternal('crypt', [rffi.CCHARP, rffi.CCHARP], rffi.CCHARP,
-                          compilation_info=eci, threadsafe=False)
+                          compilation_info=eci, releasegil=False)
 
 @unwrap_spec(word=str, salt=str)
 def crypt(space, word, salt):

File pypy/module/micronumpy/arrayimpl/concrete.py

View file
  • Ignore whitespace
         self.storage = storage
 
     def create_iter(self, shape=None, backward_broadcast=False):
-        if shape is None or shape == self.get_shape():
+        if shape is None or \
+           support.product(shape) <= support.product(self.get_shape()):
             return iter.ConcreteArrayIterator(self)
         r = calculate_broadcast_strides(self.get_strides(),
                                         self.get_backstrides(),
         loop.fill(self, box.convert_to(self.dtype))
 
     def create_iter(self, shape=None, backward_broadcast=False):
-        if shape is not None and shape != self.get_shape():
+        if shape is not None and shape != self.get_shape() and \
+           support.product(shape) > support.product(self.get_shape()):
             r = calculate_broadcast_strides(self.get_strides(),
                                             self.get_backstrides(),
                                             self.get_shape(), shape,

File pypy/module/micronumpy/interp_numarray.py

View file
  • Ignore whitespace
         w_res = W_NDimArray.from_shape(space, res_shape, self.get_dtype(), w_instance=self)
         return loop.getitem_filter(w_res, self, arr)
 
-    def setitem_filter(self, space, idx, value):
-        from pypy.module.micronumpy.interp_boxes import Box
-        val = value
+    def setitem_filter(self, space, idx, val):
         if len(idx.get_shape()) > 1 and idx.get_shape() != self.get_shape():
             raise OperationError(space.w_ValueError,
                                  space.wrap("boolean index array should have 1 dimension"))
                                  space.wrap("index out of range for array"))
         idx_iter = idx.create_iter(self.get_shape())
         size = loop.count_all_true_iter(idx_iter, self.get_shape(), idx.get_dtype())
-        if len(val.get_shape()) > 0 and val.get_shape()[0] > 1 and size > val.get_shape()[0]:
+        if size > val.get_size() and val.get_size() > 1:
             raise OperationError(space.w_ValueError, space.wrap("NumPy boolean array indexing assignment "
                                                                 "cannot assign %d input values to "
-                                                                "the %d output values where the mask is true" % (val.get_shape()[0],size)))
-        if val.get_shape() == [1]:
-            box = val.descr_getitem(space, space.wrap(0))
-            assert isinstance(box, Box)
-            val = W_NDimArray(scalar.Scalar(val.get_dtype(), box))
-        elif val.get_shape() == [0]:
+                                                                "the %d output values where the mask is true" % (val.get_size(), size)))
+        if val.get_shape() == [0]:
             val.implementation.dtype = self.implementation.dtype
-        loop.setitem_filter(self, idx, val)
+        loop.setitem_filter(self, idx, val, size)
 
     def _prepare_array_index(self, space, w_index):
         if isinstance(w_index, W_NDimArray):

File pypy/module/micronumpy/loop.py

View file
  • Ignore whitespace
                                                 'index_dtype'],
                                       reds = 'auto')
 
-def setitem_filter(arr, index, value):
+def setitem_filter(arr, index, value, size):
     arr_iter = arr.create_iter()
     index_iter = index.create_iter(arr.get_shape())
-    value_iter = value.create_iter()
+    value_iter = value.create_iter([size])
     shapelen = len(arr.get_shape())
     index_dtype = index.get_dtype()
     arr_dtype = arr.get_dtype()

File pypy/module/micronumpy/test/test_dtypes.py

View file
  • Ignore whitespace
 
     def test_unicode_boxes(self):
         from numpypy import unicode_
-        assert isinstance(unicode_(3), str)
+        try:
+            u = unicode_(3)
+        except NotImplementedError as e:
+            if e.message.find('not supported yet') >= 0:
+                skip('unicode box not implemented')
+        else:
+            assert isinstance(u, str)
 
     def test_character_dtype(self):
         from numpypy import array, character

File pypy/module/micronumpy/test/test_numarray.py

View file
  • Ignore whitespace
     def test_array_indexing_bool_specialcases(self):
         from numpypy import arange, array
         a = arange(6)
-        try:
-            a[a < 3] = [1, 2]
-            assert False, "Should not work"
-        except ValueError:
-            pass
+        exc = raises(ValueError,'a[a < 3] = [1, 2]')
+        assert exc.value[0].find('cannot assign') >= 0
+        b = arange(4).reshape(2, 2) + 10
+        a[a < 4] = b
+        assert (a == [10, 11, 12, 13, 4, 5]).all()
+        b += 10
+        c = arange(8).reshape(2, 2, 2)
+        a[a > 9] = c[:, :, 1]
+        assert (c[:, :, 1] == [[1, 3], [5, 7]]).all()
+        assert (a == [1, 3, 5, 7, 4, 5]).all()
         a = arange(6)
         a[a > 3] = array([15])
         assert (a == [0, 1, 2, 3, 15, 15]).all()

File pypy/module/pyexpat/interp_pyexpat.py

View file
  • Ignore whitespace
 XML_ParserCreateNS = expat_external(
     'XML_ParserCreateNS', [rffi.CCHARP, rffi.CHAR], XML_Parser)
 XML_ParserFree = expat_external(
-    'XML_ParserFree', [XML_Parser], lltype.Void, threadsafe=False)
+    'XML_ParserFree', [XML_Parser], lltype.Void, releasegil=False)
 XML_SetUserData = expat_external(
     'XML_SetUserData', [XML_Parser, rffi.VOIDP], lltype.Void)
 def XML_GetUserData(parser):

File pypy/module/rctime/interp_time.py

View file
  • Ignore whitespace
     return rffi.llexternal(name, args, result,
                            compilation_info=eci,
                            calling_conv=calling_conv,
-                           threadsafe=False)
+                           releasegil=False)
 
 if _POSIX:
     cConfig.timeval.__name__ = "_timeval"

File pypy/module/test_lib_pypy/test_resource.py

View file
  • Ignore whitespace
 from lib_pypy.ctypes_config_cache import rebuild
 from pypy.module.test_lib_pypy.support import import_lib_pypy
 
+import os
+if os.name != 'posix':
+    skip('resource.h only available on unix')
 
 class AppTestResource:
 

File rpython/jit/backend/arm/runner.py

View file
  • Ignore whitespace
     def finish_once(self):
         self.assembler.finish_once()
 
-    def compile_loop(self, logger, inputargs, operations, looptoken,
-                                                    log=True, name=''):
+    def compile_loop(self, inputargs, operations, looptoken,
+                     log=True, name='', logger=None):
         return self.assembler.assemble_loop(logger, name, inputargs, operations,
                                             looptoken, log=log)
 
-    def compile_bridge(self, logger, faildescr, inputargs, operations,
-                                       original_loop_token, log=True):
+    def compile_bridge(self, faildescr, inputargs, operations,
+                       original_loop_token, log=True, logger=None):
         clt = original_loop_token.compiled_loop_token
         clt.compiling_a_bridge()
         return self.assembler.assemble_bridge(logger, faildescr, inputargs,

File rpython/jit/backend/arm/test/test_generated.py

View file
  • Ignore whitespace
         looptoken = JitCellToken()
         operations[2].setfailargs([v12, v8, v3, v2, v1, v11])
         operations[3].setfailargs([v9, v6, v10, v2, v8, v5, v1, v4])
-        cpu.compile_loop(None, inputargs, operations, looptoken)
+        cpu.compile_loop(inputargs, operations, looptoken)
         args = [-12 , -26 , -19 , 7 , -5 , -24 , -37 , 62 , 9 , 12]
         deadframe = cpu.execute_token(looptoken, *args)
         assert cpu.get_int_value(deadframe, 0) == 0
         operations[9].setfailargs([v15, v7, v10, v18, v4, v17, v1])
         operations[-1].setfailargs([v7, v1, v2])
         looptoken = JitCellToken()
-        cpu.compile_loop(None, inputargs, operations, looptoken)
+        cpu.compile_loop(inputargs, operations, looptoken)
         args = [16 , 5 , 5 , 16 , 46 , 6 , 63 , 39 , 78 , 0]
         deadframe = cpu.execute_token(looptoken, *args)
         assert cpu.get_int_value(deadframe, 0) == 105
         operations[-1].setfailargs([v5, v2, v1, v10, v3, v8, v4, v6])
 
         looptoken = JitCellToken()
-        cpu.compile_loop(None, inputargs, operations, looptoken)
+        cpu.compile_loop(inputargs, operations, looptoken)
         args = [-5 , 24 , 46 , -15 , 13 , -8 , 0 , -6 , 6 , 6]
         deadframe = cpu.execute_token(looptoken, *args)
         assert cpu.get_latest_descr(deadframe).identifier == 2
         operations[5].setfailargs([])
         operations[-1].setfailargs([v8, v2, v6, v5, v7, v1, v10])
         looptoken = JitCellToken()
-        cpu.compile_loop(None, inputargs, operations, looptoken)
+        cpu.compile_loop(inputargs, operations, looptoken)
         args = [19 , -3 , -58 , -7 , 12 , 22 , -54 , -29 , -19 , -64]
         deadframe = cpu.execute_token(looptoken, *args)
         assert cpu.get_int_value(deadframe, 0) == -29
         looptoken = JitCellToken()
         operations[5].setfailargs([])
         operations[-1].setfailargs([v1, v4, v10, v8, v7, v3])
-        cpu.compile_loop(None, inputargs, operations, looptoken)
+        cpu.compile_loop(inputargs, operations, looptoken)
         args = [1073741824 , 95 , -16 , 5 , 92 , 12 , 32 , 17 , 37 , -63]
         deadframe = cpu.execute_token(looptoken, *args)
         assert cpu.get_int_value(deadframe, 0) == 1073741824
         operations[9].setfailargs([v10, v13])
         operations[-1].setfailargs([v8, v10, v6, v3, v2, v9])
         args = [32 , 41 , -9 , 12 , -18 , 46 , 15 , 17 , 10 , 12]
-        cpu.compile_loop(None, inputargs, operations, looptoken)
+        cpu.compile_loop(inputargs, operations, looptoken)
         deadframe = cpu.execute_token(looptoken, *args)
         assert cpu.get_latest_descr(deadframe).identifier == 3
         assert cpu.get_int_value(deadframe, 0) == 12
         operations[8].setfailargs([v5, v9])
         operations[-1].setfailargs([v4, v10, v6, v5, v9, v7])
         looptoken = JitCellToken()
-        cpu.compile_loop(None, inputargs, operations, looptoken)
+        cpu.compile_loop(inputargs, operations, looptoken)
         args = [-8 , 0 , 62 , 35 , 16 , 9 , 30 , 581610154 , -1 , 738197503]
         deadframe = cpu.execute_token(looptoken, *args)
         assert cpu.get_latest_descr(deadframe).identifier == 2
         operations[-2].setfailargs([v9, v4, v10, v11, v14])
         operations[-1].setfailargs([v10, v8, v1, v6, v4])
         looptoken = JitCellToken()
-        cpu.compile_loop(None, inputargs, operations, looptoken)
+        cpu.compile_loop(inputargs, operations, looptoken)
         args = [-39 , -18 , 1588243114 , -9 , -4 , 1252698794 , 0 , 715827882 , -15 , 536870912]
         deadframe = cpu.execute_token(looptoken, *args)
         assert cpu.get_latest_descr(deadframe).identifier == 1
         operations[9].setfailargs([v5, v7, v12, v14, v2, v13, v8])
         operations[-1].setfailargs([v1, v2, v9])
         looptoken = JitCellToken()
-        cpu.compile_loop(None, inputargs, operations, looptoken)
+        cpu.compile_loop(inputargs, operations, looptoken)
         args = [0 , -2 , 24 , 1 , -4 , 13 , -95 , 33 , 2 , -44]
         deadframe = cpu.execute_token(looptoken, *args)
         assert cpu.get_latest_descr(deadframe).identifier == 3
         operations[2].setfailargs([v10, v3, v6, v11, v9, v2])
         operations[-1].setfailargs([v8, v2, v10, v6, v7, v9, v5, v4])
         looptoken = JitCellToken()
-        cpu.compile_loop(None, inputargs, operations, looptoken)
+        cpu.compile_loop(inputargs, operations, looptoken)
         args = [3 , -5 , 1431655765 , 47 , 12 , 1789569706 , 15 , 939524096 , 16 , -43]
         deadframe = cpu.execute_token(looptoken, *args)
         assert cpu.get_latest_descr(deadframe).identifier == 1
         operations[-1].setfailargs([v2, v3, v5, v7, v10, v8, v9])
         operations[4].setfailargs([v14])
         looptoken = JitCellToken()
-        cpu.compile_loop(None, inputargs, operations, looptoken)
+        cpu.compile_loop(inputargs, operations, looptoken)
         args = [14 , -20 , 18 , -2058005163 , 6 , 1 , -16 , 11 , 0 , 19]
         deadframe = cpu.execute_token(looptoken, *args)
         assert cpu.get_latest_descr(deadframe).identifier == 1

File rpython/jit/backend/arm/test/test_regalloc2.py

View file
  • Ignore whitespace
     cpu = CPU(None, None)
     cpu.setup_once()
     looptoken = JitCellToken()
-    cpu.compile_loop(None, inputargs, operations, looptoken)
+    cpu.compile_loop(inputargs, operations, looptoken)
     deadframe = cpu.execute_token(looptoken, 9)
     assert cpu.get_int_value(deadframe, 0) == (9 >> 3)
     assert cpu.get_int_value(deadframe, 1) == (~18)
     cpu = CPU(None, None)
     cpu.setup_once()
     looptoken = JitCellToken()
-    cpu.compile_loop(None, inputargs, operations, looptoken)
+    cpu.compile_loop(inputargs, operations, looptoken)
     deadframe = cpu.execute_token(looptoken, -10)
     assert cpu.get_int_value(deadframe, 0) == 0
     assert cpu.get_int_value(deadframe, 1) == -1000
     cpu = CPU(None, None)
     cpu.setup_once()
     looptoken = JitCellToken()
-    cpu.compile_loop(None, inputargs, operations, looptoken)
+    cpu.compile_loop(inputargs, operations, looptoken)
     args = [-13 , 10 , 10 , 8 , -8 , -16 , -18 , 46 , -12 , 26]
     deadframe = cpu.execute_token(looptoken, *args)
     assert cpu.get_int_value(deadframe, 0) == 0
     cpu = CPU(None, None)
     cpu.setup_once()
     looptoken = JitCellToken()
-    cpu.compile_loop(None, inputargs, operations, looptoken)
+    cpu.compile_loop(inputargs, operations, looptoken)
     args = [17 , -20 , -6 , 6 , 1 , 13 , 13 , 9 , 49 , 8]
     deadframe = cpu.execute_token(looptoken, *args)
     assert cpu.get_int_value(deadframe, 0) == 0

File rpython/jit/backend/arm/test/test_runner.py

View file
  • Ignore whitespace
             ResOperation(rop.FINISH, [inp[1]], None, descr=BasicFinalDescr(1)),
             ]
         operations[-2].setfailargs(out)
-        cpu.compile_loop(None, inp, operations, looptoken)
+        cpu.compile_loop(inp, operations, looptoken)
         args = [i for i in range(1, 15)]
         deadframe = self.cpu.execute_token(looptoken, *args)
         output = [self.cpu.get_int_value(deadframe, i - 1) for i in range(1, 15)]
         i1 = int_sub(i0, 1)
         finish(i1)
         ''')
-        self.cpu.compile_loop(None, loop2.inputargs, loop2.operations, lt2)
-        self.cpu.compile_loop(None, loop3.inputargs, loop3.operations, lt3)
-        self.cpu.compile_loop(None, loop1.inputargs, loop1.operations, lt1)
+        self.cpu.compile_loop(loop2.inputargs, loop2.operations, lt2)
+        self.cpu.compile_loop(loop3.inputargs, loop3.operations, lt3)
+        self.cpu.compile_loop(loop1.inputargs, loop1.operations, lt1)
         df = self.cpu.execute_token(lt1, 10)
         assert self.cpu.get_int_value(df, 0) == 7
 
             ops = "".join(ops)
             loop = parse(ops)
             looptoken = JitCellToken()
-            self.cpu.compile_loop(None, loop.inputargs, loop.operations, looptoken)
+            self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
             ARGS = [lltype.Signed] * numargs
             RES = lltype.Signed
             args = [i+1 for i in range(numargs)]
         try:
             self.cpu.assembler.set_debug(True)
             looptoken = JitCellToken()
-            self.cpu.compile_loop(None, ops.inputargs, ops.operations, looptoken)
+            self.cpu.compile_loop(ops.inputargs, ops.operations, looptoken)
             self.cpu.execute_token(looptoken, 0)
             # check debugging info
             struct = self.cpu.assembler.loop_run_counters[0]
         faildescr = BasicFailDescr(2)
         loop = parse(ops, self.cpu, namespace=locals())
         looptoken = JitCellToken()
-        info = self.cpu.compile_loop(None, loop.inputargs, loop.operations, looptoken)
+        info = self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
         ops2 = """
         [i0, f1]
         i1 = same_as(i0)
         """
         loop2 = parse(ops2, self.cpu, namespace=locals())
         looptoken2 = JitCellToken()
-        info = self.cpu.compile_loop(None, loop2.inputargs, loop2.operations, looptoken2)
+        info = self.cpu.compile_loop(loop2.inputargs, loop2.operations, looptoken2)
 
         deadframe = self.cpu.execute_token(looptoken, -9, longlong.getfloatstorage(-13.5))
         res = longlong.getrealfloat(self.cpu.get_float_value(deadframe, 0))

File rpython/jit/backend/llgraph/runner.py

View file
  • Ignore whitespace
         self.stats = stats or MiniStats()
         self.vinfo_for_tests = kwds.get('vinfo_for_tests', None)
 
-    def compile_loop(self, logger, inputargs, operations, looptoken, log=True,
-                     name=''):
+    def compile_loop(self, inputargs, operations, looptoken, log=True,
+                     name='', logger=None):
         clt = model.CompiledLoopToken(self, looptoken.number)
         looptoken.compiled_loop_token = clt
         lltrace = LLTrace(inputargs, operations)
         clt._llgraph_alltraces = [lltrace]
         self._record_labels(lltrace)
 
-    def compile_bridge(self, logger, faildescr, inputargs, operations,
-                       original_loop_token, log=True):
+    def compile_bridge(self, faildescr, inputargs, operations,
+                       original_loop_token, log=True, logger=None):
         clt = original_loop_token.compiled_loop_token
         clt.compiling_a_bridge()
         lltrace = LLTrace(inputargs, operations)

File rpython/jit/backend/llsupport/regalloc.py

View file
  • Ignore whitespace
             function(arg, node.val)
             node = node.next
 
-    def pop(self, size, tp):
+    def pop(self, size, tp, hint=-1):
         if size == 2:
-            return self._pop_two(tp)
+            return self._pop_two(tp)   # 'hint' ignored for floats on 32-bit
         assert size == 1
         if not self.master_node:
             return None
         node = self.master_node
-        self.master_node = node.next
+        #
+        if hint >= 0:
+            # Look for and remove the Node with the .val matching 'hint'.
+            # If not found, fall back to removing the first Node.
+            # Note that the loop below ignores the first Node, but
+            # even if by chance it is the one with the correct .val,
+            # it will be the one we remove at the end anyway.
+            prev_node = node
+            while prev_node.next:
+                if prev_node.next.val == hint:
+                    node = prev_node.next
+                    prev_node.next = node.next
+                    break
+                prev_node = prev_node.next
+            else:
+                self.master_node = node.next
+        else:
+            self.master_node = node.next
+        #
         return self.fm.frame_pos(node.val, tp)
 
     def _candidate(self, node):
     def __init__(self, start_free_depth=0, freelist=None):
         self.bindings = {}
         self.current_frame_depth = start_free_depth
-        # we disable hints for now
-        #self.hint_frame_locations = {}
+        self.hint_frame_pos = {}
         self.freelist = LinkedList(self, freelist)
 
     def get_frame_depth(self):
             return self.bindings[box]
         except KeyError:
             pass
-        # check if we have a hint for this box
-        #if box in self.hint_frame_locations:
-        #    # if we do, try to reuse the location for this box
-        #    loc = self.hint_frame_locations[box]
-        #    if self.try_to_reuse_location(box, loc):
-        #        return loc
-        ## no valid hint.  make up a new free location
         return self.get_new_loc(box)
 
     def get_new_loc(self, box):
         size = self.frame_size(box.type)
+        hint = self.hint_frame_pos.get(box, -1)
         # frame_depth is rounded up to a multiple of 'size', assuming
         # that 'size' is a power of two.  The reason for doing so is to
         # avoid obscure issues in jump.py with stack locations that try
         # to move from position (6,7) to position (7,8).
-        newloc = self.freelist.pop(size, box.type)
+        newloc = self.freelist.pop(size, box.type, hint)
         if newloc is None:
             #
             index = self.get_frame_depth()
             all[node.val] = 1
             node = node.next
 
-    def try_to_reuse_location(self, box, loc):
-        xxx
-        index = self.get_loc_index(loc)
-        if index < 0:
-            return False
-        size = self.frame_size(box.type)
-        for i in range(size):
-            while (index + i) >= len(self.used):
-                self.used.append(False)
-            if self.used[index + i]:
-                return False    # already in use
-        # good, we can reuse the location
-        for i in range(size):
-            self.used[index + i] = True
-        self.bindings[box] = loc
-        return True
-
     @staticmethod
     def _gather_gcroots(lst, var):
         lst.append(var)

File rpython/jit/backend/llsupport/test/test_gc_integration.py

View file
  • Ignore whitespace
                         'checkdescr': checkdescr,
                         'fielddescr': cpu.fielddescrof(S, 'x')})
         token = JitCellToken()
-        cpu.compile_loop(None, loop.inputargs, loop.operations, token)
+        cpu.compile_loop(loop.inputargs, loop.operations, token)
         p0 = lltype.malloc(S, zero=True)
         p1 = lltype.malloc(S)
         p2 = lltype.malloc(S)
             'calldescr': checkdescr,
         })
         token = JitCellToken()
-        cpu.compile_loop(None, loop.inputargs, loop.operations, token)
+        cpu.compile_loop(loop.inputargs, loop.operations, token)
         S = self.S
         s = lltype.malloc(S)
         cpu.execute_token(token, 1, s)
         token = JitCellToken()
         cpu.gc_ll_descr.init_nursery(20)
         cpu.setup_once()
-        cpu.compile_loop(None, loop.inputargs, loop.operations, token)
+        cpu.compile_loop(loop.inputargs, loop.operations, token)
         arg = longlong.getfloatstorage(2.3)
         frame = cpu.execute_token(token, arg)
         ofs = cpu.get_baseofs_of_frame_field()
         cpu.gc_ll_descr.collections = [[0, sizeof.size]]
         cpu.gc_ll_descr.init_nursery(2 * sizeof.size)
         cpu.setup_once()
-        cpu.compile_loop(None, loop.inputargs, loop.operations, token)
+        cpu.compile_loop(loop.inputargs, loop.operations, token)
         frame = cpu.execute_token(token)
         # now we should be able to track everything from the frame
         frame = lltype.cast_opaque_ptr(JITFRAMEPTR, frame)
         token = JitCellToken()
         cpu.gc_ll_descr.init_nursery(100)
         cpu.setup_once()
-        cpu.compile_loop(None, loop.inputargs, loop.operations, token)
+        cpu.compile_loop(loop.inputargs, loop.operations, token)
         args = [lltype.nullptr(llmemory.GCREF.TO) for i in range(7)]
         frame = cpu.execute_token(token, 1, *args)
         frame = rffi.cast(JITFRAMEPTR, frame)
         token = JitCellToken()
         cpu.gc_ll_descr.init_nursery(100)
         cpu.setup_once()
-        cpu.compile_loop(None, loop.inputargs, loop.operations, token)
+        cpu.compile_loop(loop.inputargs, loop.operations, token)
         frame = lltype.cast_opaque_ptr(JITFRAMEPTR,
                                        cpu.execute_token(token, 1, a))
 
         token = JitCellToken()
         cpu.gc_ll_descr.init_nursery(100)
         cpu.setup_once()
-        cpu.compile_loop(None, loop.inputargs, loop.operations, token)
+        cpu.compile_loop(loop.inputargs, loop.operations, token)
         frame = lltype.cast_opaque_ptr(JITFRAMEPTR,
                                        cpu.execute_token(token, 1, a))
         assert getmap(frame).count('1') == 4

File rpython/jit/backend/llsupport/test/test_regalloc.py

View file
  • Ignore whitespace
 
 
     def test_hint_frame_locations_1(self):
-        py.test.skip("xxx")
-        b0, = newboxes(0)
-        fm = TFrameManager()
-        loc123 = FakeFramePos(123, INT)
-        fm.hint_frame_locations[b0] = loc123
-        assert fm.get_frame_depth() == 0
-        loc = fm.loc(b0)
-        assert loc == loc123
-        assert fm.get_frame_depth() == 124
-
-    def test_hint_frame_locations_2(self):
-        py.test.skip("xxx")
-        b0, b1, b2 = newboxes(0, 1, 2)
-        longevity = {b0: (0, 1), b1: (0, 2), b2: (0, 2)}
-        fm = TFrameManager()
-        asm = MockAsm()
-        rm = RegisterManager(longevity, frame_manager=fm, assembler=asm)
-        rm.force_allocate_reg(b0)
-        rm.force_allocate_reg(b1)
-        rm.force_allocate_reg(b2)
-        rm.force_spill_var(b0)
-        loc = rm.loc(b0)
-        assert isinstance(loc, FakeFramePos)
-        assert fm.get_loc_index(loc) == 0
-        rm.position = 1
-        assert fm.used == [True]
-        rm.possibly_free_var(b0)
-        assert fm.used == [False]
-        #
-        fm.hint_frame_locations[b1] = loc
-        rm.force_spill_var(b1)
-        loc1 = rm.loc(b1)
-        assert loc1 == loc
-        assert fm.used == [True]
-        #
-        fm.hint_frame_locations[b2] = loc
-        rm.force_spill_var(b2)
-        loc2 = rm.loc(b2)
-        assert loc2 != loc1     # because it was not free
-        assert fm.used == [True, True]
-        #
-        rm._check_invariants()
+        for hint_value in range(11):
+            b0, = newboxes(0)
+            fm = TFrameManager()
+            fm.hint_frame_pos[b0] = hint_value
+            blist = newboxes(*range(10))
+            for b1 in blist:
+                fm.loc(b1)
+            for b1 in blist:
+                fm.mark_as_free(b1)
+            assert fm.get_frame_depth() == 10
+            loc = fm.loc(b0)
+            if hint_value < 10:
+                expected = hint_value
+            else:
+                expected = 0
+            assert fm.get_loc_index(loc) == expected
+            assert fm.get_frame_depth() == 10
 
     def test_linkedlist(self):
         class Loc(object):

File rpython/jit/backend/llsupport/test/test_regalloc_integration.py

View file
  • Ignore whitespace
         loop = self.parse(ops, namespace=namespace)
         self.loop = loop
         looptoken = JitCellToken()
-        self.cpu.compile_loop(None, loop.inputargs, loop.operations, looptoken)
+        self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
         arguments = []
         for arg in args:
             if isinstance(arg, int):
         assert ([box.type for box in bridge.inputargs] ==
                 [box.type for box in guard_op.getfailargs()])
         faildescr = guard_op.getdescr()
-        self.cpu.compile_bridge(None, faildescr, bridge.inputargs,
+        self.cpu.compile_bridge(faildescr, bridge.inputargs,
                                 bridge.operations,
                                 loop._jitcelltoken)
         return bridge

File rpython/jit/backend/llsupport/test/test_runner.py

View file
  • Ignore whitespace
         def set_debug(flag):
             pass
     
-    def compile_loop(self, logger, inputargs, operations, looptoken):
+    def compile_loop(self, inputargs, operations, looptoken):
         py.test.skip("llsupport test: cannot compile operations")
 
 

File rpython/jit/backend/model.py

View file
  • Ignore whitespace
         """
         return False
 
-    def compile_loop(self, logger, inputargs, operations, looptoken,
-                     log=True, name=''):
+    def compile_loop(self, inputargs, operations, looptoken,
+                     log=True, name='', logger=None):
         """Assemble the given loop.
         Should create and attach a fresh CompiledLoopToken to
         looptoken.compiled_loop_token and stick extra attributes
         on it to point to the compiled loop in assembler.
-
-        Optionally, return a ``ops_offset`` dictionary, which maps each operation
-        to its offset in the compiled code.  The ``ops_offset`` dictionary is then
-        used by the operation logger to print the offsets in the log.  The
-        offset representing the end of the last operation is stored in
-        ``ops_offset[None]``: note that this might not coincide with the end of
-        the loop, because usually in the loop footer there is code which does
-        not belong to any particular operation.
+        Returns either None or an instance of rpython.rlib.jit.AsmInfo.
         """
         raise NotImplementedError
 
-    def compile_bridge(self, logger, faildescr, inputargs, operations,
-                       original_loop_token, log=True):
+    def compile_bridge(self, faildescr, inputargs, operations,
+                       original_loop_token, log=True, logger=None):
         """Assemble the bridge.
         The FailDescr is the descr of the original guard that failed.
-
-        Optionally, return a ``ops_offset`` dictionary.  See the docstring of
-        ``compiled_loop`` for more information about it.
+        Returns either None or an instance of rpython.rlib.jit.AsmInfo.
         """
         raise NotImplementedError
 

File rpython/jit/backend/test/calling_convention_test.py

View file
  • Ignore whitespace
 
             loop = parse(ops, namespace=locals())
             looptoken = JitCellToken()
-            self.cpu.compile_loop(None, loop.inputargs, loop.operations, looptoken)
+            self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
             argvals, expected_result = self._prepare_args(args, floats, ints)
 
             deadframe = self.cpu.execute_token(looptoken, *argvals)
             called_looptoken = JitCellToken()
             called_looptoken.outermost_jitdriver_sd = FakeJitDriverSD()
             done_descr = called_loop.operations[-1].getdescr()
-            self.cpu.compile_loop(None, called_loop.inputargs, called_loop.operations, called_looptoken)
+            self.cpu.compile_loop(called_loop.inputargs, called_loop.operations, called_looptoken)
 
             argvals, expected_result = self._prepare_args(args, floats, ints)
             deadframe = cpu.execute_token(called_looptoken, *argvals)
             self.cpu.done_with_this_frame_descr_float = done_descr
             try:
                 othertoken = JitCellToken()
-                self.cpu.compile_loop(None, loop.inputargs, loop.operations, othertoken)
+                self.cpu.compile_loop(loop.inputargs, loop.operations, othertoken)
 
                 # prepare call to called_loop
                 argvals, _ = self._prepare_args(args, floats, ints)
 
             loop = parse(ops, namespace=locals())
             looptoken = JitCellToken()
-            self.cpu.compile_loop(None, loop.inputargs, loop.operations, looptoken)
+            self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
             argvals, expected_result = self._prepare_args(args, floats, ints)
 
             deadframe = self.cpu.execute_token(looptoken, *argvals)

File rpython/jit/backend/test/runner_test.py

View file
  • Ignore whitespace
                                                                 valueboxes,
                                                                 descr)
         looptoken = JitCellToken()
-        self.cpu.compile_loop(None, inputargs, operations, looptoken)
+        self.cpu.compile_loop(inputargs, operations, looptoken)
         args = []
         for box in inputargs:
             if isinstance(box, BoxInt):
             ]
         inputargs = [i0]
         looptoken = JitCellToken()
-        self.cpu.compile_loop(None, inputargs, operations, looptoken)
+        self.cpu.compile_loop(inputargs, operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken, 2)
         fail = self.cpu.get_latest_descr(deadframe)
         res = self.cpu.get_int_value(deadframe, 0)
             ]
         inputargs = [i0]
         looptoken = JitCellToken()
-        self.cpu.compile_loop(None, inputargs, operations, looptoken)
+        self.cpu.compile_loop(inputargs, operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken,
                                            longlong.getfloatstorage(2.8))
         fail = self.cpu.get_latest_descr(deadframe)
         inputargs = [i0]
         operations[3].setfailargs([i1])
 
-        self.cpu.compile_loop(None, inputargs, operations, looptoken)
+        self.cpu.compile_loop(inputargs, operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken, 2)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 2
         inputargs = [i3]
         operations[4].setfailargs([None, None, i1, None])
 
-        self.cpu.compile_loop(None, inputargs, operations, looptoken)
+        self.cpu.compile_loop(inputargs, operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken, 44)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 2
         operations[3].setfailargs([i1])
         wr_i1 = weakref.ref(i1)
         wr_guard = weakref.ref(operations[2])
-        self.cpu.compile_loop(None, inputargs, operations, looptoken)
+        self.cpu.compile_loop(inputargs, operations, looptoken)
         if hasattr(looptoken, '_x86_ops_offset'):
             del looptoken._x86_ops_offset # else it's kept alive
         del i0, i1, i2
             ]
         inputargs = [i0]
         operations[3].setfailargs([i1])
-        self.cpu.compile_loop(None, inputargs, operations, looptoken)
+        self.cpu.compile_loop(inputargs, operations, looptoken)
 
         i1b = BoxInt()
         i3 = BoxInt()
         ]
         bridge[1].setfailargs([i1b])
 
-        self.cpu.compile_bridge(None, faildescr1, [i1b], bridge, looptoken)
+        self.cpu.compile_bridge(faildescr1, [i1b], bridge, looptoken)
 
         deadframe = self.cpu.execute_token(looptoken, 2)
         fail = self.cpu.get_latest_descr(deadframe)
             ]
         inputargs = [i3]
         operations[4].setfailargs([None, i1, None])
-        self.cpu.compile_loop(None, inputargs, operations, looptoken)
+        self.cpu.compile_loop(inputargs, operations, looptoken)
 
         i1b = BoxInt()
         i3 = BoxInt()
         ]
         bridge[1].setfailargs([i1b])
 
-        self.cpu.compile_bridge(None, faildescr1, [i1b], bridge, looptoken)
+        self.cpu.compile_bridge(faildescr1, [i1b], bridge, looptoken)
 
         deadframe = self.cpu.execute_token(looptoken, 2)
         fail = self.cpu.get_latest_descr(deadframe)
             ]
         inputargs = [i0]
         operations[0].setfailargs([i0])
-        self.cpu.compile_loop(None, inputargs, operations, looptoken)
+        self.cpu.compile_loop(inputargs, operations, looptoken)
 
         i1list = [BoxInt() for i in range(150)]
         bridge = []
                                    descr=BasicFinalDescr(4)))
         bridge[-2].setfailargs(i1list)
 
-        self.cpu.compile_bridge(None, faildescr1, [i0], bridge, looptoken)
+        self.cpu.compile_bridge(faildescr1, [i0], bridge, looptoken)
 
         deadframe = self.cpu.execute_token(looptoken, 1)
         fail = self.cpu.get_latest_descr(deadframe)
         operations = [
             ResOperation(rop.FINISH, [i0], None, descr=faildescr)
             ]
-        self.cpu.compile_loop(None, [i0], operations, looptoken)
+        self.cpu.compile_loop([i0], operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken, 99)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail is faildescr
         operations = [
             ResOperation(rop.FINISH, [ConstInt(42)], None, descr=faildescr)
             ]
-        self.cpu.compile_loop(None, [], operations, looptoken)
+        self.cpu.compile_loop([], operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail is faildescr
         operations = [
             ResOperation(rop.FINISH, [], None, descr=faildescr)
             ]
-        self.cpu.compile_loop(None, [], operations, looptoken)
+        self.cpu.compile_loop([], operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail is faildescr
             operations = [
                 ResOperation(rop.FINISH, [f0], None, descr=faildescr)
                 ]
-            self.cpu.compile_loop(None, [f0], operations, looptoken)
+            self.cpu.compile_loop([f0], operations, looptoken)
             value = longlong.getfloatstorage(-61.25)
             deadframe = self.cpu.execute_token(looptoken, value)
             fail = self.cpu.get_latest_descr(deadframe)
             operations = [
                 ResOperation(rop.FINISH, [constfloat(42.5)], None, descr=faildescr)
                 ]
-            self.cpu.compile_loop(None, [], operations, looptoken)
+            self.cpu.compile_loop([], operations, looptoken)
             deadframe = self.cpu.execute_token(looptoken)
             fail = self.cpu.get_latest_descr(deadframe)
             assert fail is faildescr
             ResOperation(rop.JUMP, [t, z], None, descr=targettoken),
             ]
         operations[-2].setfailargs([t, z])
-        cpu.compile_loop(None, [x, y], operations, looptoken)
+        cpu.compile_loop([x, y], operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken, 0, 10)
         assert self.cpu.get_int_value(deadframe, 0) == 0
         assert self.cpu.get_int_value(deadframe, 1) == 55
                 ops[1].setfailargs([v_res])
             #
             looptoken = JitCellToken()
-            self.cpu.compile_loop(None, [v1, v2], ops, looptoken)
+            self.cpu.compile_loop([v1, v2], ops, looptoken)
             for x, y, z in testcases:
                 deadframe = self.cpu.execute_token(looptoken, x, y)
                 fail = self.cpu.get_latest_descr(deadframe)
             print inputargs
             for op in operations:
                 print op
-            self.cpu.compile_loop(None, inputargs, operations, looptoken)
+            self.cpu.compile_loop(inputargs, operations, looptoken)
             #
             deadframe = self.cpu.execute_token(looptoken, *values)
             fail = self.cpu.get_latest_descr(deadframe)
             operations[3].setfailargs(inputargs[:])
             operations[3].setdescr(faildescr)
             #
-            self.cpu.compile_loop(None, inputargs, operations, looptoken)
+            self.cpu.compile_loop(inputargs, operations, looptoken)
             #
             values = []
             S = lltype.GcStruct('S')
         operations[-3].setfailargs(fboxes)
         operations[-2].setfailargs(fboxes)
         looptoken = JitCellToken()
-        self.cpu.compile_loop(None, fboxes, operations, looptoken)
+        self.cpu.compile_loop(fboxes, operations, looptoken)
 
         fboxes2 = [BoxFloat() for i in range(12)]
         f3 = BoxFloat()
             ResOperation(rop.JUMP, [f3]+fboxes2[1:], None, descr=targettoken),
         ]
 
-        self.cpu.compile_bridge(None, faildescr1, fboxes2, bridge, looptoken)
+        self.cpu.compile_bridge(faildescr1, fboxes2, bridge, looptoken)
 
         args = []
         for i in range(len(fboxes)):
         finish()"""
         loop = parse(loopops)
         looptoken = JitCellToken()
-        self.cpu.compile_loop(None, loop.inputargs, loop.operations, looptoken)
+        self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
         args = [1]
         args.append(longlong.getfloatstorage(132.25))
         args.append(longlong.getfloatstorage(0.75))
             ResOperation(rop.FINISH, [], None, descr=faildescr2),
             ]
         bridgeops[-2].setfailargs(fboxes[:])
-        self.cpu.compile_bridge(None, loop.operations[-2].getdescr(), fboxes,
+        self.cpu.compile_bridge(loop.operations[-2].getdescr(), fboxes,
                                                         bridgeops, looptoken)
         args = [1,
                 longlong.getfloatstorage(132.25),
                     ]
                 operations[1].setfailargs([])
                 looptoken = JitCellToken()
-                self.cpu.compile_loop(None, inputargs, operations, looptoken)
+                self.cpu.compile_loop(inputargs, operations, looptoken)
                 #
                 for value in [-42, 0, 1, 10]:
                     deadframe = self.cpu.execute_token(looptoken, value)
                         ]
                     operations[-2].setfailargs([])
                     looptoken = JitCellToken()
-                    self.cpu.compile_loop(None, inputargs, operations, looptoken)
+                    self.cpu.compile_loop(inputargs, operations, looptoken)
                     #
                     for test1 in [-65, -42, -11, 0, 1, 10]:
                         if test1 == -42 or combinaison[0] == 'b':
                         ]
                     operations[-2].setfailargs([])
                     looptoken = JitCellToken()
-                    self.cpu.compile_loop(None, inputargs, operations, looptoken)
+                    self.cpu.compile_loop(inputargs, operations, looptoken)
                     #
                     for test1 in [65, 42, 11, 0, 1]:
                         if test1 == 42 or combinaison[0] == 'b':
                         ]
                     operations[-2].setfailargs([])
                     looptoken = JitCellToken()
-                    self.cpu.compile_loop(None, inputargs, operations, looptoken)
+                    self.cpu.compile_loop(inputargs, operations, looptoken)
                     #
                     nan = 1e200 * 1e200
                     nan /= nan
                                        descr=faildescr))
         looptoken = JitCellToken()
         #
-        self.cpu.compile_loop(None, inputargs, operations, looptoken)
+        self.cpu.compile_loop(inputargs, operations, looptoken)
         #
         args = []
         for box in inputargs:
                         looptoken = JitCellToken()
                         # Use "set" to unique-ify inputargs
                         unique_testcase_list = list(set(testcase))
-                        self.cpu.compile_loop(None, unique_testcase_list, operations,
+                        self.cpu.compile_loop(unique_testcase_list, operations,
                                               looptoken)
                         args = [box.getfloatstorage()
                                 for box in unique_testcase_list]
         exc_ptr = xptr
         loop = parse(ops, self.cpu, namespace=locals())
         looptoken = JitCellToken()
-        self.cpu.compile_loop(None, loop.inputargs, loop.operations, looptoken)
+        self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken, 1)
         assert self.cpu.get_ref_value(deadframe, 0) == xptr
         excvalue = self.cpu.grab_exc_value(deadframe)
         exc_ptr = yptr
         loop = parse(ops, self.cpu, namespace=locals())
         looptoken = JitCellToken()
-        self.cpu.compile_loop(None, loop.inputargs, loop.operations, looptoken)
+        self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken, 1)
         assert self.cpu.get_int_value(deadframe, 0) == 1
         excvalue = self.cpu.grab_exc_value(deadframe)
         '''
         loop = parse(ops, self.cpu, namespace=locals())
         looptoken = JitCellToken()
-        self.cpu.compile_loop(None, loop.inputargs, loop.operations, looptoken)
+        self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken, 1)
         assert self.cpu.get_int_value(deadframe, 0) == 1
         excvalue = self.cpu.grab_exc_value(deadframe)
                                          'func_ptr': func_ptr,
                                          'calldescr': calldescr})
             looptoken = JitCellToken()
-            self.cpu.compile_loop(None, loop.inputargs, loop.operations, looptoken)
+            self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
             f1 = longlong.getfloatstorage(1.2)
             f2 = longlong.getfloatstorage(3.4)
             frame = self.cpu.execute_token(looptoken, 1, 0, 1, 2, 3, 4, 5, f1, f2)
         ]
         ops[2].setfailargs([i1, i0])
         looptoken = JitCellToken()
-        self.cpu.compile_loop(None, [i0, i1], ops, looptoken)
+        self.cpu.compile_loop([i0, i1], ops, looptoken)
         deadframe = self.cpu.execute_token(looptoken, 20, 0)