[pypy-commit] pypy py3k: hg merge default
arigo
pypy.commits at gmail.com
Tue Sep 13 04:32:22 EDT 2016
Author: Armin Rigo <arigo at tunes.org>
Branch: py3k
Changeset: r87062:5f216ce9b438
Date: 2016-09-13 10:31 +0200
http://bitbucket.org/pypy/pypy/changeset/5f216ce9b438/
Log: hg merge default
diff --git a/pypy/module/cpyext/memoryobject.py b/pypy/module/cpyext/memoryobject.py
--- a/pypy/module/cpyext/memoryobject.py
+++ b/pypy/module/cpyext/memoryobject.py
@@ -28,10 +28,7 @@
else:
n = len(fmt)
for i in range(n):
- if ord(fmt[i]) > 255:
- view.c_format[i] = '*'
- else:
- view.c_format[i] = fmt[i]
+ view.c_format[i] = fmt[i]
view.c_format[n] = '\x00'
shape = buf.getshape()
strides = buf.getstrides()
diff --git a/pypy/module/cpyext/test/foo3.c b/pypy/module/cpyext/test/foo3.c
--- a/pypy/module/cpyext/test/foo3.c
+++ b/pypy/module/cpyext/test/foo3.c
@@ -4,9 +4,7 @@
PyObject* foo3type_tp_new(PyTypeObject* metatype, PyObject* args, PyObject* kwds)
{
PyObject* newType;
- /*printf("in foo3type_tp_new, preprocessing...\n"); */
newType = PyType_Type.tp_new(metatype, args, kwds);
- /*printf("in foo3type_tp_new, postprocessing...\n"); */
return newType;
}
@@ -93,5 +91,5 @@
return NULL;
if (PyDict_SetItemString(d, "footype", (PyObject *)&footype) < 0)
return NULL;
- return mod;
+ Py_INCREF(&footype);
}
diff --git a/pypy/module/cpyext/test/test_typeobject.py b/pypy/module/cpyext/test/test_typeobject.py
--- a/pypy/module/cpyext/test/test_typeobject.py
+++ b/pypy/module/cpyext/test/test_typeobject.py
@@ -944,7 +944,6 @@
def test_tp_new_in_subclass_of_type(self):
module = self.import_module(name='foo3')
- #print('calling module.footype()...')
module.footype("X", (object,), {})
def test_app_subclass_of_c_type(self):
diff --git a/pypy/module/sys/__init__.py b/pypy/module/sys/__init__.py
--- a/pypy/module/sys/__init__.py
+++ b/pypy/module/sys/__init__.py
@@ -22,7 +22,7 @@
del self.__class__.appleveldefs['__stderr__']
super(Module, self).__init__(space, w_name)
- self.recursionlimit = 100
+ self.recursionlimit = 1000
self.defaultencoding = "utf-8"
self.filesystemencoding = None
self.debug = True
diff --git a/rpython/jit/codewriter/call.py b/rpython/jit/codewriter/call.py
--- a/rpython/jit/codewriter/call.py
+++ b/rpython/jit/codewriter/call.py
@@ -250,6 +250,8 @@
error = '@jit.loop_invariant'
if hasattr(graph.func, '_call_aroundstate_target_'):
error = '_call_aroundstate_target_'
+ if hasattr(graph.func, '_call_shortcut_'):
+ error = '@jit.call_shortcut'
if not error:
continue
raise Exception(
diff --git a/rpython/rlib/jit.py b/rpython/rlib/jit.py
--- a/rpython/rlib/jit.py
+++ b/rpython/rlib/jit.py
@@ -259,6 +259,8 @@
def call_shortcut(func):
"""A decorator to ensure that a function has a fast-path.
+ DOES NOT RELIABLY WORK ON METHODS, USE ONLY ON FUNCTIONS!
+
Only useful on functions that the JIT doesn't normally look inside.
It still replaces residual calls to that function with inline code
that checks for a fast path, and only does the call if not. For
More information about the pypy-commit
mailing list